Entering edit mode
Fong Chun Chan
▴
320
@fong-chun-chan-5706
Last seen 10.2 years ago
Hi,
I am using the GenomicFeatures package to extract exons from a
transcript
database file. I am using the ensembl transcript database which has no
chr,
yet my bam files that I am working have the chr prefix.
I was thinking one could append chr to the seqlevels in the transcript
database like this:
library('GenomicFeatures')
txdb <- loadDb(txdbFile)
newSeqNames <- paste('chr', seqlevels(txdb), sep = '')
names(newSeqNames) <- seqlevels(txdb)
txdb <- renameSeqlevels( txdb, newSeqNames )
seqlevels(txdb)
[1] "chr1" "chr2" "chr3" "chr4" "chr5" "chr6" "chr7" "chr8" "chr9"
"chr10"
"chr11" "chr12" [13] "chr13" "chr14"
This appears to work.
But when I run:
transcripts(txdb, vals = list( tx_chrom = "chr1") )
GRanges with 0 ranges and 2 metadata columns:
seqnames ranges strand | tx_id tx_name
<rle> <iranges> <rle> | <integer> <character>
---
seqlengths:
It suggests that the chromosome renaming is not working...because when
I
run:
transcripts(txdb, vals = list( tx_chrom = '1') )
GRanges with 17239 ranges and 2 metadata columns:
seqnames ranges strand | tx_id
tx_name
<rle> <iranges> <rle> | <integer>
<character>
[1] chr1 [11869, 14409] + | 126213
ENST00000456328
Has anyone had any luck in getting this to work?
Thanks,
[[alternative HTML version deleted]]