[BioC] extract introns
Steve Lianoglou
mailinglist.honeypot at gmail.com
Tue Nov 15 20:39:25 CET 2011
Hi,
On Tue, Nov 15, 2011 at 12:19 PM, Yating Cheng <yating.cheng at charite.de> wrote:
> Hi,
>
> I checked the function"gaps". But I am not sure how to use it. Is someone
> know how to use it to get the positions of introns?
Imagine a simple gene with two exons defined by these regions:
R> (exons <- GRanges('chr1', IRanges(c(10, 100), width=21), '+'))
GRanges with 2 ranges and 0 elementMetadata values:
seqnames ranges strand
<Rle> <IRanges> <Rle>
[1] chr1 [ 10, 30] +
[2] chr1 [100, 120] +
Look for its introns here:
R> gaps(exons)
GRanges with 2 ranges and 0 elementMetadata values:
seqnames ranges strand
<Rle> <IRanges> <Rle>
[1] chr1 [ 1, 9] +
[2] chr1 [31, 99] +
In this case, you will have to remove the [1,9] range (maybe that's
intergenic region), which you can do with over fun interval operations
-- perhaps you can subsetByOverlaps the ranges returned from `gaps`
with the transcription start and end of your gene.
Or, if you're working w/ a GenomicFeatures TranscriptDb, there is
always the `intronsByTranscript` method ...
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