Your problem is that you use an alignment id as the read id. See my proposal for a fixed version attached that yields consistent results for me (regarding the positions, there still is the bug using alignment ids for read ids so the printed read names are wrong). $ ./demos/SAMtest -s bug2.sam Loading SAM file bug2.sam Reads cached... n:2825 id: 1022 illumina_80bp_3kb.000000199 19625,19705 $ ./demos/SAMtest -s bug3.sam Loading SAM file bug3.sam Reads cached... n:3253 id: 1022 illumina_80bp_3kb.000000170 19625,19705 $ ./demos/SAMtest -s bug4.sam Loading SAM file bug4.sam Reads cached... n:3648 id: 1022 illumina_80bp_3kb.000000148 19625,19705 Am 21.03.2011 um 12:52 schrieb Mat: > Hi! > > So if i adapt the code i still get the weired results: > > test.sam: > > illumina_80bp_3kb.000000571 > 2128,2048 > > > bug2.sam (70000 lines of test.sam): > > illumina_80bp_3kb.000000571 > 237,157 > > (code attached...) > > cheers > <SAMtest.cpp><ATT00001..txt>
Attachment:
SAMtest.cpp
Description: SAMtest.cpp