|
From: Juan D. M. C. <jdm...@gm...> - 2016-10-07 05:25:01
|
Hello, I just finished mapping illumina reads to a large reference sequence with bowtie2. I converted the sam output to sorted bam with this command: samtools view -bh@ 15 in.sam | samtools sort -T tmp -@ 15 -o out.sorted.bam - When I try to index the sorted bam file it complains: samtools index out.sorted.bam [E::hts_idx_push] NO_COOR reads not in a single block at the end 16 -1 samtools index: "SORT.0.bam" is corrupted or unsorted when I check the last lines of the file, it effectively has mapped reads at the end, instead of the unmapped reads. The last 194 records in the sorted bam file are mapped reads and they come right after the unmapped reads: tail -n 195 SynOpDH_0.sam | head -n 2 SRR1170581.75133375 141 * 0 0 * * 0 0 CAACATAAATTTGGCACACAAATAGTTCTCCATTAACCCTTTTAGTAAAAAGAGTAGAATCTATTTTCCAATTTCAAAGCCTTTTTCAATGAGGAACTTGGTTAAGCATTTATAGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGAT CCCFFFFFHHHHHJJHJJJJJJHIIHIJJJJJJJJJJJJJJJJJJHIIJJHIIIBBFHIIJJJJJJJJJJIJJJJJJJHIHHHHHFFFFFFEEEEDDDDDDDDDDCDDCDDEFEDDEDDDDDBDDDB@BDBDACDDBCDDDDC >C>BCDA YT:Z:UP SRR1170581.75025193 133 6B_concat 1073997887 0 * = 1073997887 0 AGGGTAGTAGCATTGCCCCTTCTCTCTTTTTCTCTCATTTTTTTGTTTTATCTTTTTTTGGGGGGGCCCTCTATTTTTTTGGCCTCTTTTTTTTCGTCCGGAGTCTCAACCCGACTTGTGGGGGAATCATAGTCTCCATCATCCTTTCCT BBCFDDFFHHHHHJJJJJJJJIIIJJJJJJJIIIJJGIIJJJJJJJJJJGFHIJJJJJHFFDDDDDDDDDDDCDEEEDDDD@CDDDDDDDDDDDCBBDBBBB @BCDDEDDDDD>BBDCCCDBD@9BBDDDCDDEEDDCDDDDDDDCCDCC YT:Z:UP In total there are 4561428 reads that map to the 6B_concat reference, but for some reason these 194 reads keep appearing at the end of the sorted file. Any ideas why this might be happening? Best regards, Juan Montenegro |