Question: samtools index error
gravatar for pt.taklifi
9 days ago by
pt.taklifi60 wrote:

Hello everyone I am trying to extract uniquely aligned reads and sort them with samtools with the following command

samtools view -h -f 2 -q 10 -bS -@ 20 hg38.sam | samtools sort -n -@ 1 > hg38.sort.bam

after this when I try to index the output file

samtools index hg38.sort.bam

I get this error message

[E::hts_idx_push] Unsorted positions on sequence #16: 73874275 followed by 73874203
[E::sam_index] Read 'SRR10984462.26' with ref_name='chr16', ref_length=90338345, flags=163, pos=73874203 cannot be indexed
samtools index: failed to create index for "hg38.sort.bam": No such file or directory

any suggestions ?

alignment • 84 views
ADD COMMENTlink modified 9 days ago by Pierre Lindenbaum134k • written 9 days ago by pt.taklifi60
gravatar for Pierre Lindenbaum
9 days ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum134k wrote:

option -n of samtools sort is for sorting on read name, not on coordinate. Remove this this.option.

ADD COMMENTlink written 9 days ago by Pierre Lindenbaum134k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2210 users visited in the last hour