ngmlr icon indicating copy to clipboard operation
ngmlr copied to clipboard

NGMLR with samtools 1.10 and 1.11

Open marcotoffoli opened this issue 4 years ago • 5 comments

This issue is somewhat related to #75 I use NGMLR to align data produced by nanopore using the command: ngmlr -t8 -r ./reference.fa -q ./reads.fastq -o ./output.sam -x ont -bam-fix

And get proper output.

When I try to sort with samtools sort ./output.sam -o ./sorted.bam

I get the error parse error at line 20892 samtools sort: truncated file. Aborting

This only happens with samtools versions 1.10 and 1.11, while it works normally with samtools version 1.09.

Any help?

marcotoffoli avatar Oct 07 '20 09:10 marcotoffoli

Have you checked line 20892 in your sam file? I think it's very likely that you'll find the mapping quality is given as a negative integer. If you do, then it's also related to #83

OmarOakheart avatar Oct 12 '20 10:10 OmarOakheart

Have you checked line 20892 in your sam file? I think it's very likely that you'll find the mapping quality is given as a negative integer. If you do, then it's also related to #83

Hi nPhasePipeline, you are right, read quality is negative there. Hopefully someone will be able to merge our two issues (and issue #75) and to help us solving it.

marcotoffoli avatar Oct 12 '20 10:10 marcotoffoli

That means your problem is that newer versions of samtools do some file formats format checks that 1.09 doesn't do. So they see a negative mapQ and presume that the entire file is broken and abort the entire process.

Unless if there is a specific feature in samtools >=1.10 you want, or if you're interested in using mapQ for all of your reads, you can continue with 1.09 until there's a fix, which is what I'm doing.

OmarOakheart avatar Oct 12 '20 10:10 OmarOakheart

That means your problem is that newer versions of samtools do some file formats format checks that 1.09 doesn't do. So they see a negative mapQ and presume that the entire file is broken and abort the entire process.

Unless if there is a specific feature in samtools >=1.10 you want, or if you're interested in using mapQ for all of your reads, you can continue with 1.09 until there's a fix, which is what I'm doing.

Yep, that's what I've been doing so far

marcotoffoli avatar Oct 12 '20 11:10 marcotoffoli

Has anything changed regarding this? I think I am running into the same error, though the error message is a different one in samtools 1.12: samtools view: error reading file "/data/MN1.sam": Input/output error samtools view: error closing "/data//MN1.sam": -5 When trying to convert from .sam to .bam. If I switch to version 1.9 its fine.

RonaldOellers avatar Jul 04 '22 12:07 RonaldOellers