Intron length per transcript using GenomicFeatures
2
1
Entering edit mode
@leonardsquall15-14462
Last seen 7.0 years ago

Hi,

I am looking to get the intron length per transcript using the package GenomicFeatures and a gff file.

This is what I got so far:

library(GenomicFeatures)
library(rtracklayer)

txdb <- makeTxDbFromGFF(file = "data.gff", format = "gff")
introns <- intronsByTranscript(txdb)

# mean, median all intron
i <- unlist(introns)
summary(width(i))

So I am able to get the length of all introns but not the length of combined intron per transcript.

Any help please ?

Thanks

intron GenomicFeatures • 2.1k views
ADD COMMENT
1
Entering edit mode
@michael-lawrence-3846
Last seen 3.0 years ago
United States
sum(width(introns))
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 3 months ago
United States

Have a look at: looping through a GRangesList object In short, though:

uli = unlist(introns)
iwidths = width(uli)
lintrons = relist(iwidths, introns)
head(lintrons)

The sum of intron lengths per transcript:

intron_length_per_transcript = sapply(lintrons, sum)
ADD COMMENT

Login before adding your answer.

Traffic: 737 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6