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

Error with salmon quant when filtering alignments by MAPQ #975

Open
Taylorain opened this issue Dec 15, 2024 · 0 comments
Open

Error with salmon quant when filtering alignments by MAPQ #975

Taylorain opened this issue Dec 15, 2024 · 0 comments

Comments

@Taylorain
Copy link

Hello,
Thank you for providing and maintaining this fantastic tool!
I am using salmon quant to quantify reads mapped with minimap2, and I encountered an issue when filtering alignments by MAPQ before running salmon quant.

Here is the pipeline I followed:

# Filter reads by quality and length
NanoFilt -q 7 -l 50 ~/fastq/0_A.fa > ~/nanofilt/0_A.filt.fa

# Align reads to reference
minimap2 -ax map-ont -uf -k15 -t 80 --secondary=no ~/drs.fa.idx ~/nanofilt/0_A.filt.fa | samtools view -bS -o 0_A.align.bam 

# Filter alignments by MAPQ >= 1
nohup samtools view -bq 1 -h -@ 80 0_A.align.bam -O bam > 5.0A.filt_bam &

# Quantify with salmon
salmon quant --writeUnmappedNames -t ~/drs.fa --libType A -a 5.0A.filt_bam -o 0_A.salmon.quant --fldMax 200000 -p 64 --ont -g ~/drs.gtf

Issue:

I'm dealing with the quantification of Direct RNA sequencing data.
When I filter the BAM file using samtools view -bq 1, I get an error from salmon quant stating that samtools sort cannot be used, even though I did not use samtools sort in my pipeline.

If I skip filtering alignments by MAPQ (e.g., directly using 0_A.align.bam without the filtering step), the error does not occur.

Questions:

Is there a specific requirement for filtered BAM files used in salmon quant?
How can I correctly filter alignments by MAPQ without encountering this error?
Are there alternative approaches to remove low-quality alignments compatible with salmon quant?

Thank you in advance for your help!

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

1 participant