Closed bma-genetics closed 7 years ago
This is a good catch. The problem is that there is no chromosome name for an unmapped-unmapped read, creating this error. I'll keep this issue report open to remember to fix this issue (should be a quick few lines).
I'll also add a flag so that all of extra tags can be stripped from the BAM during convert. Presumably, the original BAM is still there, and the extra flags (like CR) may not be useful at all anyway.
Hello,
I have encountered an error when I use bxtools convert to convert a lariat generated bam file.
[bma@node63 Test]$ /usr/bin/time bxtools convert $bam > test.bam terminate called after throwing an instance of 'std::invalid_argument' what(): BamHeader::IDtoName - ID must be >= 0
I found these code in bxconvert.cpp
and
these code in BamHeader.cpp
have generated this error message.
I tried to print out the r.ChrID() and readname
and get the result : -1 ST-E00126:314:HFL3FALXX:6:2202:30776:15953
Then I grep the readname and get an unmapped pair-end read:
Is this hdr.IDtoName line necessary? I found it only used for generating CR tag in r.AddZTag line. I just commented these two lines to walk around this error message.