Thanks for your suggestions Michael,


On 29 October 2012 14:35, Michael Lawrence <lawrence.michael@gene.com>wrote:

>
> On Mon, Oct 29, 2012 at 3:37 AM, António Miguel de Jesus Domingues <
> amjdomingues@gmail.com> wrote:
>
>> Hi Bioconducters,
>>
>> I have a GRanges object created with the package  GenomicFeatures that
>> contains gene coordinates:
>>
>> ##########################################################
>> hg19RefGenes <- loadFeatures(file='hg19RefGenes.sqlite')
>> hg19RefGenes
>>
>> # generate a GRanges object containing contiguous transcribed regions of
>> the genome (from the 1st to last exon)
>> GeneRegions <- transcriptsBy(hg19RefGenes, by='gene')
>> gene.bounds <- seqapply(GeneRegions, range, progress="text")
>>
>
> You should be able to simply call range() on GeneRegions, i.e., no need to
> call seqapply. Btw, what is the progress="text" argument here? I'm not
> aware of this feature.
>

In this case I actually have a GRangesList and it does not work. I was
doing one too many things and posted the result after seqapply/unlist and
not the TranscriptbBy.
Ah, the progress=text is not a feature as far as I'm aware (and it does not
work). I was experimenting with something else and got in the mail somehow.


>
>
>> GeneRegions <- unlist(gene.bounds)
>> head(GeneRegions)
>> GRanges with 6 ranges and 0 elementMetadata cols:
>>             seqnames                 ranges strand
>>                <Rle>              <IRanges>  <Rle>
>>           1    chr19 [ 58858172,  58864865]      -
>>          10     chr8 [ 18248755,  18258723]      +
>>         100    chr20 [ 43248163,  43280376]      -
>>        1000    chr18 [ 25530930,  25757445]      -
>>       10000     chr1 [243651535, 244006886]      -
>>   100008586     chrX [ 49217771,  49342266]      +
>>   ---
>>   seqlengths:
>>                     chr1                  chr2 ... chr18_gl000207_random
>>                249250621             243199373 ...                  4262
>> ##########################################################
>>
>> I want to do something that should be simple: extend the ranges to that it
>> also includes 1Kb upstream of the gene (~Promoter region), for example,
>> chr19 [ 58858172,  58864865] becomes chr19 [ 58858172,  58865865]. Looking
>> at the GenomicFeatures fucntions it seems that neither resize or flank
>> will
>> do. Is there another function that I am missing that will do the job ?
>>
>>
> resize() should work. Simply call resize(GeneRegions, width(GeneRegions) +
> 1000L, fix = "end").
>
>
This tip is great - it works beautifully!
Cheers.


> Michael
>
>
>> Cheers,
>> António
>>
>> --
>> --
>> António Miguel de Jesus Domingues, PhD
>> Neugebauer group
>> Max Planck Institute of Molecular Cell Biology and Genetics, Dresden
>> Pfotenhauerstrasse 108
>> 01307 Dresden
>> Germany
>>
>> e-mail: domingue@mpi-cbg.de
>> tel. +49 351 210 2481
>> The Unbearable Lightness of Molecular Biology
>>
>>         [[alternative HTML version deleted]]
>>
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>
>
>


-- 
-- 
António Miguel de Jesus Domingues, PhD
Neugebauer group
Max Planck Institute of Molecular Cell Biology and Genetics, Dresden
Pfotenhauerstrasse 108
01307 Dresden
Germany

e-mail: domingue@mpi-cbg.de
tel. +49 351 210 2481
The Unbearable Lightness of Molecular Biology

	[[alternative HTML version deleted]]

