fastp icon indicating copy to clipboard operation
fastp copied to clipboard

Fastp does not remove G homopolymers

Open Homap opened this issue 1 year ago • 1 comments

Hello,

In my Illumina NovaSeq read, I have many G and C homopolymer reads. I used fastp --trim_poly_g option.

However, this option detects reads with at least 10 Gs at the end and trims the 10 Gs. If the whole read is made up of Gs, those reads still stay there but will only be 10 base pairs shorted. In addition, if G homopolymers appear in the middle of reads, this filtering option does not remove them.

I can easily imagine to write a python script to filter reads based on GC% but given I have 300 million reads, it will probably take forever to finish the job.

Is there any way you would suggest for doing this filtering in an efficient way?

Screenshot 2024-09-26 at 09 43 17 Screenshot 2024-09-26 at 09 43 38

Homap avatar Sep 26 '24 07:09 Homap

I had the similar problem recently. One workaround is that you can turn off other trimming such as adapter trimming, and pairing polyG trimming with reads length filter (--length_required). In that way, you can discard reads with polyG, and the leftover reads will have little polyG.

neil-n-zhang avatar Dec 31 '24 19:12 neil-n-zhang