Dear all,
I have aligned a file with the command:
bwa mem -t 10 <refFile> <input_1.fq.gz> <input_2.fq.gz> -o <output>.sam
then I converted the SAM to BAM with:
samtools view -Sb <output>.sam > <output>.bam
and I wanted to make the index of it with:
samtools index <output>.bam
but I got the error:
[E::hts_idx_push] NO_COOR reads not in a single block at the end 0 -1 samtools index: failed to create index for "output.bam"
To check if the error was due to missing alignment I checked the number of mapped reads with:
samtools -c -F 4 <output>.bam
but I got the error:
[main] unrecognized command '-c'
and when removing the flag -c I got:
samtools -F 4 <output>.bam
[main] unrecognized command '-F'
Why I got the [E::hts_idx_push] error? maybe a missing heading?
And why the flags are not recognized?
Thank you.
thanks, you are right, now it works!
If the answer helped you, please consider to mark it as accepted to help others in the future.
Well done bro!