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

NGMLR with samtools 1.10 and 1.11 #86

Open
marcotoffoli opened this issue Oct 7, 2020 · 5 comments
Open

NGMLR with samtools 1.10 and 1.11 #86

marcotoffoli opened this issue Oct 7, 2020 · 5 comments

Comments

@marcotoffoli
Copy link

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?

@OmarOakheart
Copy link

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

@marcotoffoli
Copy link
Author

marcotoffoli commented Oct 12, 2020

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.

@OmarOakheart
Copy link

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.

@marcotoffoli
Copy link
Author

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

@RonaldOellers
Copy link

RonaldOellers commented Jul 4, 2022

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.

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

3 participants