Trimming primers from both ends of paired-end reads

Happy to be part of the Qiime2 community. So I’m processing my amplicon paired-end reads using Deblur and I’m following this tutorial: https://docs.qiime2.org/2019.4/tutorials/read-joining/. However, I only want to keep reads in which all the primers are present in both the forward and reverse read and trim off the primers (barcodes were trimmed by the collaborators). I used native cutadapt with the following code template:

cutadapt -a FWDPRIMER...RCREVPRIMER -A REVPRIMER...RCFWDPRIMER --discard-untrimmed -o out.1.fastq.gz -p out.2.fastq.gz in.1.fastq.gz in.2.fastq.gz

Example:
for file in $(ls *R1_001.fastq.gz | cut -d "_" -f 1,2,3); do cutadapt --cores=0 -a GTGBCAGCMGCCGCGGTAA...ATTAGAWACCCBDGTAGTCC -A GGACTACHVGGGTWTCTAAT...TTACCGCGGCKGCTGVCAC --discard-untrimmed -o ${file}_R1_001.primer-trim.fastq.gz -p ${file}_R2_001.primer-trim.fastq.gz ${file}_R1_001.fastq.gz ${file}_R2_001.fastq.gz >> primer_trim.log; done

Description can be found here

Do you know the qiime2 cutadapt equivalence to these parameters? It isnt very clear how to link the primers in the qiime2 cutadapt documentation found here.

Thank you

How about this?

qiime cutadapt trim-paired \
  --i-demultiplexed-sequences demux.qza \
  --p-adapter-f 'GTGBCAGCMGCCGCGGTAA...ATTAGAWACCCBDGTAGTCC' \
  --p-adapter-r 'GGACTACHVGGGTWTCTAAT...TTACCGCGGCKGCTGVCAC' \
  --p-cores 1 \
  --p-discard-untrimmed \
  --o-trimmed-sequences trimmed.qza \
  --verbose

:t_rex: :qiime2:

2 Likes

Perfect. The code produces the exact same results, it seems. Thank you

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.