I am using the .Net Bio nuget package 2.0 and have noticed an issue with the BAM parser.
Parsing the BAM file crashes when it finds a dummy read. The SAM file below is a minimalist example:
@HD VN:1.3 SO:coordinate
@SQ SN:fakeref LN:1000
* 768 fakeref 10 255 1M * 0 0 * * CT:Z:.;ESDN;
Simply converting it to BAM and trying to parse it results in the following error:
Unhandled Exception: System.Exception: Run failure. ---> System.IndexOutOfRangeE
xception: Index was outside the bounds of the array.
at Bio.IO.BAM.BAMParser.GetAlignedSequence(Int32 start, Int32 end)