Support for CSI indexes in Rsamtools
1
0
Entering edit mode
bernatgel ▴ 150
@bernatgel-7226
Last seen 29 days ago
Spain

Hi,

I cannot find any indication that CSI indexes are supported by Rsamtools and I cannot access a BAM file indexed with a CSI index. I indexed it with samtools index -c my.file.bam and on the command line samtools idxstats my.file.bam worked correctly, so the index is correct.

However, when I create the BamFile object with Rsamtools::BamFile(file = "my.file.bam") it does not find the index

class: BamFile 
path: my.file.bam
index: NA
isOpen: FALSE 
yieldSize: NA 
obeyQname: FALSE 
asMates: FALSE 
qnamePrefixEnd: NA 
qnameSuffixStart: NA

and trying to access it with Rsamtools::idxstatsBam(file = MyBamFile) fail with error Error in Rsamtools::idxstatsBam(file = data) : file.exists(index(file)) is not TRUE.

Am I missing something? or CSI indexes are not supported? If so, are there any plans to support them?

Thanks!

Bernat

Rsamtools • 1.4k views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 5 months ago
United States

The index file can be specified explicitly as a second argument to BamFile(). But it might be that the CSI index does not work; you might try (on a non-Windows, and this would be an advanced / unsupported step) installing the in-development versions

BiocManager::install("Bioconductor/Rhtslib", ref = "enable-cram")
BiocManager::install("Bioconductor/Rsamtools", ref = "cram")

It would be useful to me to know how this goes...

ADD COMMENT
0
Entering edit mode

Thanks a lot Martin,

I'll give it a try and report back if this worked.

ADD REPLY

Login before adding your answer.

Traffic: 549 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