-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels