walaj / SeqLib

C++ htslib/bwa-mem/fermi interface for interrogating sequence data
http://bioinformatics.oxfordjournals.org/content/early/2016/12/21/bioinformatics.btw741.full.pdf+html
Other
133 stars 36 forks source link

BamReader::SetCramReference #34

Open agraubert opened 5 years ago

agraubert commented 5 years ago

Hello, I'm unable to reliably read from a CRAM file when using BamReader::SetCramReference().

Failed to populate reference for id 4
Unable to fetch reference #4 16121..256523

Since I'm able to get ~16750000 reads into the bam before I encounter this issue, would you say that this is more of an issue with the fasta I'm using?

walaj commented 5 years ago

I'm wondering if there is some mismatch between the reference that was used for compressing and the reference used for fetching. If you find this is a bug with SeqLib, feel free to re-open, but I don't have enough info here to see that this is a SeqLib issue.

walaj commented 5 years ago

Reopening as a note to self to fix the second CRAM issue you found (calling BamReader::Open issue with CRAM).

SebastianHollizeck commented 4 years ago

@walaj Hey, I ran into a very similar issue with freebayes and i am currently trying to get to the bottom of this.

As i described in the freebayes issue already: it works, as long as the reference, that was used to encode the cram can be found at the exact same path, but if it is not at this path, it fails with

Failed to populate reference for id 0
Unable to fetch reference #0 10027..910379
Failure to decode slice
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: sam_read1 return status: -2 file: /Users/hollizecksebastian/Documents/Data/IN-PM1003_rmd.cram
Abort trap: 6

If you need anymore information I am happy to assist