This is a test version of Biostars. For the public version, visit https://www.biostars.org.
sambamba-depth: All files must be coordinate-sorted error?

I am trying to use sambamba to an indexed whole genome dataset.

basename_X $dataset
f="$(basename_X -- $dataset)"
sambamba depth base -L genomic.bed $dataset> ./reads/"$f.txt"

However, the above script gives the following error.

sambamba-depth: All files must be coordinate-sorted

What is the reason and how can I solve it?

read linux sambamba

1 answer

What is the reason

All files must be coordinate-sorted

how can I solve it?

samtools sort

samtools sort $filename works in that case, right?

samtools sort -o sorted.bam input.bam

Log in to answer this question.