fastp - can I trim specific adapters only?
1
0
Entering edit mode
19 days ago
liorglic ★ 1.4k

I am using fastp for quality trimming, PE read merging and adapter trimming. However, it behaves unexpectly with regard to adapter trimming - leaving some untrimmed while other reads are over-trimmed.
I suspect that this is related to the automatic adapter detection applied by fastp. I would like to provide fastp with the R1 and R2 adapters and only trim these specific primers. Here the command I used:

fastp -i R1.fq -I R2.fq -o R1_trim.fq -O R2_trim.fq -m --merged_out merge_trim.fq --cut_front --cut_front_window_size 10 --cut_front_mean_quality 30 --cut_tail --cut_tail_window_size 10 --cut_tail_mean_quality 30  --adapter_sequence GAT... --adapter_sequence_r2 TGG... 

but when I look at the report, it seems that other sequences are also detected as adapters. I tried adding the --detect_adapter_for_pe flag or the -A (--disable_adapter_trimming) flag, but they do not create the behavior I want.
Any idea how this could be achieved?

trimming fastp adapter • 450 views
ADD COMMENT
0
Entering edit mode

Not a fastp user but look for an option where you could provide a file with adapters. You certainly can with bbduk.sh with ref=file.fa option.

ADD REPLY
0
Entering edit mode

Thanks, just tried it. However, it seems like fastp behaves exactly the same using --adapter_sequence + --adapter_sequence_r2 and --adapter_fasta. It still autodetects adapters. Maybe I should just switch to another tool like bbduk or trimmomatic...

ADD REPLY
0
Entering edit mode

I recommend bbduk.sh. Simple to understand options and performant.

ADD REPLY
0
Entering edit mode
19 days ago

From the fastp github README.md

Adapter trimming is enabled by default, but you can disable it by -A or --disable_adapter_trimming. Adapter sequences can be automatically detected for both PE/SE data.

You can also specify --adapter_fasta to give a FASTA file to tell fastp to trim multiple adapters in this FASTA file. Here is a sample of such adapter FASTA file:

>Illumina TruSeq Adapter Read 1
AGATCGGAAGAGCACACGTCTGAACTCCAGTCA
>Illumina TruSeq Adapter Read 2
AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT
>polyA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
ADD COMMENT
0
Entering edit mode

I appreciate the effort to answer, but copy-pasting from the software docs (which I've linked in my question) is not very helpful. If you look above, I've already tried all these options and they do not behave the way I expected.

ADD REPLY
0
Entering edit mode

Thanks for the catty response. For what its worth I didn't and still don't see that you've tried --disable_adapter_trimming.

ADD REPLY
1
Entering edit mode

--disable_adapter_trimming is equivalent to -A (I've now edited the original question to make this clear). This disables adapter trimming altogether, and thus does not do what I want. In any case, I gave up fastp and switched to pandaseq, which features the behavior I required.

ADD REPLY

Login before adding your answer.

Traffic: 2548 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6