daj
daj

Reputation: 7183

SeqAn C++ library : different rID values for bam vs. sam with identical data, bam results in assertion failure due to length of namestore

I'm using seqan 1.4.1 to read sam/bam files. I have a sam and bam file from the same data (an alignment to rn5 refseq genes). Oddly enough I didn't get this error when I aligned to ensembl genes.

I am reading the sam/bam files BamStream, but the same error occurs if I drop down to the lower-level Stream approach.

I print length(bamStreamIn._nameStore) and each record.rID as it's read in. Here's my output when I use the bam file version of the data:

namestore size 42252
record.rID : 10364
record.rID : 41714
record.rID : 20136
record.rID : 5043
..c/Users/XXXX/shared/seqan-library-1.4.1/include/seqan/bam_io/read_bam.h:208 Assertion failed : static_cast<__uint64>(record.rID) < length(nameStore(context)) was: 43257 >= 42252

Here's the output when I use the sam file:

namestore size 42252
record.rID : 10318
record.rID : 41436
record.rID : 20031
record.rID : 5009
record.rID : 13876
record.rID : 12206
...
(output continues successfully until the end of the file)

Interestingly the namestore size is the same, but the rIDs are different. Any idea why the rIDs are different and what's causing the assertion error?

Upvotes: 1

Views: 219

Answers (0)

Related Questions