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

quality filter: imbalance forward vs reverse reads - dada2- #1948

Open
valengirardi opened this issue May 7, 2024 · 3 comments
Open

quality filter: imbalance forward vs reverse reads - dada2- #1948

valengirardi opened this issue May 7, 2024 · 3 comments

Comments

@valengirardi
Copy link

Hello! I'm performing quality filtering on my sequences due to low quality in the reverse reads. However, I've encountered an imbalance where I have fewer reverse reads compared to forward reads, making it impossible to proceed with DADA2. Can you advise me on how to address this issue?

this is the filtering code:
for file in "${INPUT_DIR}"/*.fastq; do
base_name=$(basename "${file}" .fastq)
bbduk.sh in="${file}" out="${OUTPUT_DIR}/${base_name}.fastq" qtrim=rl trimq=10
echo "Archivo ${file} procesado."
done

Additionally, I've attempted to apply separate quality filters for the forward and reverse reads, but I'm unable to achieve a balanced number of sequences in both:

for file in "${INPUT_DIR}"/*.fastq; do
base_name=$(basename "${file}" .fastq)
if [[ $base_name == "_2".fastq ]]; then
bbduk.sh in="${file}" out="${OUTPUT_DIR}/${base_name}.fastq" qtrim=rl trimq=10
echo "Archivo ${file} procesado."
else
bbduk.sh in="${file}" out="${OUTPUT_DIR}/${base_name}.fastq" qtrim=rl trimq=15
echo "Archivo ${file} procesado."
fi
done

@benjjneb
Copy link
Owner

benjjneb commented May 7, 2024

I'd recommend using filterAndTrim to jointly filter your forward and reverse reads (i.e. each read pair is evaluated, and then filter out or kept). This will maintain the matching between forward and reverse reads that is lost when you separately filter those files. The dada2 tutorial shows an example of this for Illumina paired end data.

@valengirardi
Copy link
Author

Hi! thank u for your response. I usually run this kind of things on terminal, not on R. How can I adapt filterandtrim in this situation? I tried with bbduk, cutadapt and Trimmomatic

@benjjneb
Copy link
Owner

The dada2 tutorial gives a worked example of inspecting the quality profile and then running filterAndTrim on paired-end Illumina reads: https://benjjneb.github.io/dada2/tutorial.html

If you are using dada2 later, then just run the filterAndTrim part in the same way you would have run the later parts of the workflow.

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

2 participants