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!