[BioC] using GenomicFeature

Steve Lianoglou mailinglist.honeypot at gmail.com
Tue Dec 6 22:42:37 CET 2011


Hi,

On Tue, Dec 6, 2011 at 4:13 PM, Zhi Zhang <zhizhang at sanfordburnham.org> wrote:
> Hi, All,
> I wonder if I can generate an Granges in GenomicFeature for 5kb upstream from start codons, and intergenic region of Drosophila genome, then I can find overlap between my SNP position and GenomicFeature. Like
>
>
>
> txdb <- TxDb.Dmelanogaster.UCSC.dm3.ensGene
> UTR5 <- fiveUTRsByTranscript(txdb)
> rngs <- GRanges("chr4", IRanges(c(252054, 252561), width=1))
> findOverlaps(rngs, UTR5)
>
> but not UTR5, replaced by custom  GenomicFeature for 5kb upstream from start codons, and intergenic region of Drosophila genome

Let's assume you don't need this in a GRangesList object -- or if you
do, I'll let you figure out how to reconstruct the GRangesList from
the resulting GRanges below :-)

## use use.names=TRUE here:
R> utr5 <- fiveUTRsByTranscript(txdb, use.names=TRUE)
R> up5kb <- resize(unlist(utr5), width=5000, fix='end')

You'll need to do a bit more bookkeeping if you need to make sure that
the 5kb upstream doesn't run into a gene that's less than 5kb away.

HTH,
-steve

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the Bioconductor mailing list