Entering edit mode
7.4 years ago
anc.informatics
•
0
I would like to know how to issue the command when sorting a BAM file based on name. The problem is that when I used the command,
samtools sort -n -o WT.bam /home/exp/accepted_hits.bam
It run without any error. However, when tried to index the BAM file like,
samtools index WT.bam
I go the error,
[E::hts_idx_push] Unsorted positions on sequence #8: 29211960 followed by 29211761
samtools index: failed to create index for "WT.bam"
I noticed that sorting based on position was successful in indexing. I tried different form of inputing -n and -o , but failed.
It was a doubt from my previous post. I think i need to use -r option in HTSeq since I will sort bam file using position and not by name.