THANK YOU
Hi everyone, I am learning to build a Ribo-seq analysis pipeline and have a question about trimming and filtering. I used fastp for adapter removal and quality trimming with standard parameters. My samples are collected from different published studies, so the read length distributions differ across datasets. After trimming, I noticed that 2–3 samples still contain some low-quality reads that were not completely removed. My question is: Should low-quality reads be removed at the FASTQ stage, or is it acceptable to perform filtering later at the BAM stage using typical Ribo-seq footprint length selection (e.g., 28–34 nt)? Because these datasets come from different protocols, I am unsure what the recommended consistent practice is for combining them in one pipeline. Any suggestions or best-practice references would be greatly appreciated. Thank you.
1 answer
Hi Sammy! Short answer: I'd run adapter trimming first, then get rid of low-quality reads by filtering them (not trimming them), then align and assess soft-clipping rates.
Long answer: I'd be cautious about using FastP for "quality trimming with standard parameters" as you state. Trimming the adapters is important as it gives you the real footprint length. Trimming for quality muddies the water, as it gives you a fragment that appears to have a certain footprint length, which it didn't have in the original data, and the only reason it has that length is because the sequencing quality randomly dipped below your threshold at one particular location within the read.
I usually approach Riboseq by adaptor-trimming first, to preserve the footprint length, then just filter out reads entirely if some part of the read falls below the quality thresholds. Sometimes I map those rejected reads too, just to check that my thresholds were not too stringent, looking at mapping rates etc.
After mapping you should assess the aligner's soft-clipping patterns carefully. I usually still count soft-clipped bases as part of the "footprint" when assessing length distributions (although there can be an argument to excluding soft-clipped parts from the footprint length - for example if you get a lot of chimeric reads in the library, or some sort of cryptic adapter sequence being somehow ligated on - but ideally you would go back to the adapter-trimming step and make it more greedy if this happened to a large proportion of the reads.)
Also, I note that you are trying to compare data from different protocols (and maybe different platforms?). Could be that different platforms are more or less optimistic about the PHRED quality metrics so it might make sense to see whether the reads that are rejected due to 'low quality' really do have a disproportionate number of errors or lower mapping rates - if not (and you really need every last read) then maybe you could tweak QC thresholds for these samples.
I have a trimming / soft-clipping visualisation package which should make it easier to assess what is happening, rather than doing a deep dive into your bam files etc. It's here: https://github.com/MonashBioinformaticsPlatform/trimviz. Maybe that can help. Good luck!
Log in to answer this question.