The value of _Bam::m_cram_reference is never meaningfully propagated to the underlying htslib bam constructs.
If BamReader::SetCramReference is called before any crams are opened, BamReader::m_cram_reference is never passed to new bams in BamReader::Open, so the new _Bam never calls htslib::cram_load_reference.
This PR adds a single line so that m_cram_reference is passed into new bams when opened.
This PR does not fix the case where bams have already opened via BamReader::Open before setting a reference. It will probably involve copying this code segment into BamReader::SetCramReference, but I didn't want to just start duplicating code blocks in case you wanted to move that into it's own function.
See #34
The value of
_Bam::m_cram_reference
is never meaningfully propagated to the underlying htslib bam constructs.If
BamReader::SetCramReference
is called before any crams are opened,BamReader::m_cram_reference
is never passed to new bams inBamReader::Open
, so the new_Bam
never callshtslib::cram_load_reference
.This PR adds a single line so that
m_cram_reference
is passed into new bams when opened.This PR does not fix the case where bams have already opened via
BamReader::Open
before setting a reference. It will probably involve copying this code segment intoBamReader::SetCramReference
, but I didn't want to just start duplicating code blocks in case you wanted to move that into it's own function.