This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bedtools genomecov -bg -split -ibam bamfile. error: the input file is not sorted correctly.

Hi there,

I try to run command "bedtools genomecov -bg -split -ibam bamfile" to obtain the bed output, while the error is showed as "Input error: Chromosome * found in non-sequential lines. This suggests that the input file is not sorted correctly." To solve that, I try to sort the bam file using "samtools sort -n bamfile -o sortedfile" and then redo the test. The result have the same error.

Anyone can help? Many thanks!

Joe

software error

1 answer

Hello,

I guess bedtools need the bam file sorted by coordinates and not by readnames as you do with samtools sort -n. And did you use sortedfile for redoing yohr test?

fin swimmer

Hi finswimmer,

Thanks for your comment. It works after sorting the bam file by coordinates.

Joe

Log in to answer this question.