I am working on the TxDb.Hsapiens.UCSC.hg19.knownGene
data. I found that the length of the largest exon is 205012. How can I proceed to find the genomic coordinate of that exon?
You can use which.max()
on the Granges, something like below:
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
txdb = TxDb.Hsapiens.UCSC.hg19.knownGene
ex = exons(txdb)
ex$len = width(ex)
ex[which.max(ex$len)]
GRanges object with 1 range and 2 metadata columns:
seqnames ranges strand | exon_id len
<Rle> <IRanges> <Rle> | <integer> <integer>
[1] chr12 102591363-102796374 + | 164764 205012
-------
seqinfo: 93 sequences (1 circular) from hg19 genome
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.