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
Thanks a lot Martin,
I'll give it a try and report back if this worked.