Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO_COOR error when trying to index the output bam file #71

Open
ghost opened this issue Apr 4, 2023 · 0 comments
Open

NO_COOR error when trying to index the output bam file #71

ghost opened this issue Apr 4, 2023 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 4, 2023

Hi,

I am running the following elprep command

elprep sfm input.bam outputl.bam \
  --mark-duplicates \
  --mark-optical-duplicates output.mkdup.metrics \
  --sorting-order coordinate \
  --bqsr output.recal \
  --known-sites ${references__dbsnp} \
  --known-sites ${references__hapmap} \
  --reference ${references__elfasta} \
  --haplotypecaller output.vcf.gz \
  --tmp-path $(TMPDIR) \
  --nr-of-threads ${resources__threads}

When I try to run

samtools index outputl.bam

I get the following error

[E::hts_idx_push] NO_COOR reads not in a single block at the end 0 -1
[E::sam_index] Read 'HWI-D00360:5:H814YADXX:1:1111:9027:67970' with ref_name='chr1', ref_length=248956422, flags=163, pos=10004 cannot be indexed

Usually, this would imply that the output bam is not coordinate sorted. However, the coordinate sorted flag is set, and when I run
stats to check if samtools thinks the file is coordiante sorted, then it seems that samtools thinks it is sorted.

samtools stats output.bam | grep "is sorted:"
SN	is sorted:	1

Further, when I run output.bam through samtools sort, the NO_COOR error goes away and the newly sorted bam is indexed appropriately.

I am not sure what the issue here is, but samtools stats thinks the output of elprep is sorted. On the other hand it requires another sort command to get the output bam to be indexed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants