Open jorainer opened 6 years ago
I've rewritten big part of the mapping functionality (based on the original code in Pbase
) in ensembldb
and now it works nicely:
> library(ensembldb)
> library(AnnotationHub)
> edb <- query(AnnotationHub(), c("Ensembl 90 EnsDb", "Homo sapiens"))[[1]]
snapshotDate(): 2017-10-27
downloading 0 resources
loading from cache
'/Users/jo//.AnnotationHub/64495'
> ## Define the region within the protein
> rng <- IRanges(start = 281, end = 391, names = "ENSP00000269305")
> ## Now map the coordinates
> proteinToGenome(rng, edb)
Fetching CDS for 1 proteins ... 1 found
Checking CDS and protein sequence lengths ... 1/1 OK
$ENSP00000269305
GRanges object with 4 ranges and 7 metadata columns:
seqnames ranges strand | protein_id tx_id
<Rle> <IRanges> <Rle> | <character> <character>
[1] 17 [7673701, 7673779] - | ENSP00000269305 ENST00000269305
[2] 17 [7673535, 7673608] - | ENSP00000269305 ENST00000269305
[3] 17 [7670609, 7670715] - | ENSP00000269305 ENST00000269305
[4] 17 [7669618, 7669690] - | ENSP00000269305 ENST00000269305
exon_id exon_rank cds_ok protein_start protein_end
<character> <integer> <logical> <integer> <integer>
[1] ENSE00003725258 8 TRUE 281 391
[2] ENSE00003786593 9 TRUE 281 391
[3] ENSE00003545950 10 TRUE 281 391
[4] ENSE00003605891 11 TRUE 281 391
-------
seqinfo: 1 sequence from GRCh38 genome
Got the following example
So, mapping works. But if a single IRanges is added it fails:
Interstingly, it works if one of the protein domains is selected: