If i filter based on non-existing chromosome: it displays output from random chromosome say from 1 or 2
samtools view input.sorted.bam M | head
/soft/samtools-0.1.18/samtools view Sample_2_NS.bam.sorted.bam 555 | head
HWI-ST388-W7D:304:D0KG0ACXX:1:1301:12638:194719 89 1 9993 37 7M2D83M = 9993 0 CTGTCTGCACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCC <<<>>587A<=<;53???>;6>?6?;7>?6ADA@DCA@7C@CB?0DDBB?3DDDDDEDC:):1EEC8CACAEC?3@EDDA<DBB:DA?<= RG:Z:120208_SN388_0304_AD0KG0ACXX XT:A:U NM:i:4 XN:i:8 SM:i:37 AM:i:0 X0:i:1 X1:i:0 XM:i:2 XO:i:1XG:i:2 MD:Z:5C1^AT0A82
HWI-ST388-W7D:304:D0KG0ACXX:1:1301:12638:194719 181 1 9993 0 * = 9993 0 AAATAATTCATTCCCCCCACCTCCCACGGCAGGGGGTAGCGTGGGAATCAAGCATGTGTACGGCCCTGCCCCCGCCAGACCCTTCTAACT ####################################################################DJIHF@GC?BHAFDDBDDD@B? RG:Z:120208_SN388_0304_AD0KG0ACXX
Is this a bug? or I am i doing something wrong?
I still think that it is a bug; as it should output anything irrelevant if not present in the bam.
In my pipeline: I used M instead of MT for extracting mitochondria: that resulted in extracting all the alignments from Chr2 without any error messages.