[BioC] Introns in exons and vice versa (Genomic Features)

Alex Gutteridge alexg at ruggedtextile.com
Wed Oct 3 13:18:55 CEST 2012


On 03.10.2012 11:50, Fenton Christopher Graham wrote:
> library(GenomicFeatures)
>
> #get known genes
> genes <- makeTranscriptDbFromUCSC(genome = "hg19",tablename = 
> "knownGene")
> saveFeatures(genes, file="hg19_knownGene.sqlite")
> txdb    <- loadFeatures("hg19_knownGene.sqlite")
>
> #get introns
> introns <- intronsByTranscript(txdb)
> introns <- unlist(introns)
>
> #get exons
> exons    <- exonsBy(txdb)
> exons    <- unlist(exons)
>
> #take chr1 and "+" stand
> introns_ind  <- which(seqnames(introns) == "chr1" & strand(introns) 
> == "+")
> exons_ind   <- which(seqnames(exons) == "chr1" & stand(exons) == "+")
>
> #convert to ranges
> introns_chr1 <- ranges(introns[introns_ind,])
> exons_chr1   <- ranges(exons[exons_ind,])
>
> #look for introns in exons?
> sum(countOverlaps(introns_chr1, exons_chr1, type="within"))
>
> Why isn't this number 0?
> Why are we looking at over 1000 introns within exons?
>
>
> Chris

Alternative splicing. An exon in one transcript from a given gene may 
well have introns removed in other transcripts from the same gene (and 
will hence overlap).

-- 
Alex Gutteridge



More information about the Bioconductor mailing list