error in cutting primer with qiime cutadapt trim

I’m running qiime2-2024.2.
I want to trim primers from my reads using this command:

qiime cutadapt trim-paired
--i-demultiplexed-sequences demux.qza
--p-cores 4
--p-front-f CCTACGGGAGGCAGCAG
--p-front-r GGACTACHVGGGTWTCTAAT
--p-error-rate 0.1
--o-trimmed-sequences trimmed-seqs.qza

I get the following error:
Plugin error from cutadapt:

Command '['cutadapt', '--cores', '4', '--error-rate', '0.1', '--times', '1', '--overlap', '3', '--minimum-length', '1', '-q', '0,0', '--quality-base', '33', '-o', '/tmp/q2-CasavaOneEightSingleLanePerSampleDirFmt-wcwvhz4h/GSC0.3_1_33_L001_R1_001.fastq.gz', '-p', '/tmp/q2-CasavaOneEightSingleLanePerSampleDirFmt-wcwvhz4h/GSC0.3_1_93_L001_R2_001.fastq.gz', '--front', 'CCTACGGGAGGCAGCAG--p-front-r', '--front', 'GGACTACHVGGGTWTCTAAT--p-error-rate', '--front', '0.1', '/tmp/qiime2/wygcsu/data/50029cc6-25da-44c4-a2e6-b81378c3821a/data/GSC0.3_1_33_L001_R1_001.fastq.gz', '/tmp/qiime2/wygcsu/data/50029cc6-25da-44c4-a2e6-b81378c3821a/data/GSC0.3_1_93_L001_R2_001.fastq.gz']' returned non-zero exit status 2.

Debug info has been saved to /tmp/qiime2-q2cli-err-5950rea4.log

Debug info as ffollowing:
Running external command line application. This may print messages to stdout and/or stderr.
The commands to be run are below. These commands cannot be manually re-run as they will depend on temporary files that no longer exist.

Command: cutadapt --cores 4 --error-rate 0.1 --times 1 --overlap 3 --minimum-length 1 -q 0,0 --quality-base 33 -o /tmp/q2-CasavaOneEightSingleLanePerSampleDirFmt-_uqcjtwb/GSC0.3_1_33_L001_R1_001.fastq.gz -p /tmp/q2-CasavaOneEightSingleLanePerSampleDirFmt-_uqcjtwb/GSC0.3_1_93_L001_R2_001.fastq.gz --front CCTACGGGAGGCAGCAG--p-front-r --front GGACTACHVGGGTWTCTAAT--p-error-rate --front 0.1 /tmp/qiime2/wygcsu/data/50029cc6-25da-44c4-a2e6-b81378c3821a/data/GSC0.3_1_33_L001_R1_001.fastq.gz /tmp/qiime2/wygcsu/data/50029cc6-25da-44c4-a2e6-b81378c3821a/data/GSC0.3_1_93_L001_R2_001.fastq.gz

This is cutadapt 4.6 with Python 3.8.15
Command line parameters: --cores 4 --error-rate 0.1 --times 1 --overlap 3 --minimum-length 1 -q 0,0 --quality-base 33 -o /tmp/q2-CasavaOneEightSingleLanePerSampleDirFmt-_uqcjtwb/GSC0.3_1_33_L001_R1_001.fastq.gz -p /tmp/q2-CasavaOneEightSingleLanePerSampleDirFmt-_uqcjtwb/GSC0.3_1_93_L001_R2_001.fastq.gz --front CCTACGGGAGGCAGCAG--p-front-r --front GGACTACHVGGGTWTCTAAT--p-error-rate --front 0.1 /tmp/qiime2/wygcsu/data/50029cc6-25da-44c4-a2e6-b81378c3821a/data/GSC0.3_1_33_L001_R1_001.fastq.gz /tmp/qiime2/wygcsu/data/50029cc6-25da-44c4-a2e6-b81378c3821a/data/GSC0.3_1_93_L001_R2_001.fastq.gz
ERROR: Character '-' in adapter sequence 'CCTACGGGAGGCAGCAG--P-FRONT-R' is not a valid IUPAC code. Use only characters 'ABCDGHIKMNRSTUVWXY'.
Traceback (most recent call last):
File "/home/wygcsu/miniconda3/envs/qiime2-amplicon-2024.2/lib/python3.8/site-packages/q2cli/commands.py", line 520, in call
results = self._execute_action(
File "/home/wygcsu/miniconda3/envs/qiime2-amplicon-2024.2/lib/python3.8/site-packages/q2cli/commands.py", line 581, in _execute_action
results = action(**arguments)
File "", line 2, in trim_paired
File "/home/wygcsu/miniconda3/envs/qiime2-amplicon-2024.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 342, in bound_callable
outputs = self.callable_executor(
File "/home/wygcsu/miniconda3/envs/qiime2-amplicon-2024.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 566, in callable_executor
output_views = self._callable(**view_args)
File "/home/wygcsu/miniconda3/envs/qiime2-amplicon-2024.2/lib/python3.8/site-packages/q2_cutadapt/_trim.py", line 229, in trim_paired
run_commands(cmds)
File "/home/wygcsu/miniconda3/envs/qiime2-amplicon-2024.2/lib/python3.8/site-packages/q2_cutadapt/_trim.py", line 29, in run_commands
subprocess.run(cmd, check=True)
File "/home/wygcsu/miniconda3/envs/qiime2-amplicon-2024.2/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cutadapt', '--cores', '4', '--error-rate', '0.1', '--times', '1', '--overlap', '3', '--minimum-length', '1', '-q', '0,0', '--quality-base', '33', '-o', '/tmp/q2-CasavaOneEightSingleLanePerSampleDirFmt-_uqcjtwb/GSC0.3_1_33_L001_R1_001.fastq.gz', '-p', '/tmp/q2-CasavaOneEightSingleLanePerSampleDirFmt-_uqcjtwb/GSC0.3_1_93_L001_R2_001.fastq.gz', '--front', 'CCTACGGGAGGCAGCAG--p-front-r', '--front', 'GGACTACHVGGGTWTCTAAT--p-error-rate', '--front', '0.1', '/tmp/qiime2/wygcsu/data/50029cc6-25da-44c4-a2e6-b81378c3821a/data/GSC0.3_1_33_L001_R1_001.fastq.gz', '/tmp/qiime2/wygcsu/data/50029cc6-25da-44c4-a2e6-b81378c3821a/data/GSC0.3_1_93_L001_R2_001.fastq.gz']' returned non-zero exit status 2.

Hi there @SouthGateProject,

Looks like the issue is "ERROR: Character '-' in adapter sequence 'CCTACGGGAGGCAGCAG--P-FRONT-R' is not a valid IUPAC code. Use only characters 'ABCDGHIKMNRSTUVWXY'."

The error appears to just be a typo where there is no gap between your commands, they are directly next to each other. It's trying to read the '-' at the front of --p-front-r as part of your front adapter sequence from the previous line.

let us know if that helps.

2 Likes

Thanks very much! I works well.
But it is very strange. In fact, there is one blank space, it reports error. If two blank space, it is well. I also tried with other data and it is normal even with only one blank space.

2 Likes

Perhaps there is a way we can make this more clear for future users!

Can you share with us the commands and examples with one and two blank spaces?

very sorry. The error cannot be reproduced. I just tried it again, both is ok.