Home > Community > Samtools Index: Chromosome Blocks not Continuous
Upvote

31

Downvote
+ Bioinformatics
+ Genome
Posted by
NPK

Samtools Index: Chromosome Blocks not Continuous

Butch Black  Follow
samtools sort blasted_SRR6649368.bam -o sorted_SRR6649368.bam -n

These error messages indicate that the reads are not sorted by coordinate — in particular, that the reads mapped to ScdB1pO_646;HRSCAF=880 are not all together, and that the reads at positions 11159020 < 11158717 are not sorted by position on their chromosome.

This is because samtools sort -n has been used to sort the reads by name instead. Remove -n to sort by position, which is what is needed to prepare a BAM file for indexing with samtools index.

More

Upvote

VOTE

Downvote
Extraterrestrials  Follow
soundedMore
Upvote

VOTE

Downvote
Eric Henderson  Follow
like the correct thing to do, but it looks like I was incorrectMore
Upvote

VOTE

Downvote
Jessica Taylor  Follow
Thank you, it worked! As for why I used the -n flag, I am trying replicate the results of a journal article. The journal article did not provide explicit instructions for sorting/indexing the files, and this is my first time sorting/indexing files. I think "sort by reads" simply More
Upvote

VOTE

Downvote