issue with cutadapt trim-paired

Dear all,
here my code

qiime cutadapt trim-paired
--i-demultiplexed-sequences demux-paired-end.qza \
--p-front-f 'CCTACGGGNGGCWGCAG$'
--p-front-r 'GACTACNVGGGTWTCTAATCC$'
--o-trimmed-sequences paired-end-demux-trimmed.qza

qiime output
There were some problems with the command:
(1/2) Missing option "--o-trimmed-sequences". ("--output-dir" may also be
used)
(2/2) Got unexpected extra argument ( )

then it goes on
(qiime2-2020.2) Ulis-MacBook-Pro:Tovel16S uli$ --p-front-f 'CCTACGGGNGGCWGCAG$' \

--p-front-r 'GACTACNVGGGTWTCTAATCC$'
--o-trimmed-sequences paired-end-demux-trimmed.qza
-bash: --p-front-f: command not found

it looks like qiime stops at the 1 line and then does not recognise the following commands

what I am doing wrong here?
any hint and help is highly appreciated

1 Like

Good morning Ulrike,

This looks like the same underlying issue as this thread.

In linux, each command is run on one line, unless you use the \ backslash \ character to continue the same command to the next line. This should work:

qiime cutadapt trim-paired \
--i-demultiplexed-sequences demux-paired-end.qza \
--p-front-f 'CCTACGGGNGGCWGCAG$' \
--p-front-r 'GACTACNVGGGTWTCTAATCC$' \
--o-trimmed-sequences paired-end-demux-trimmed.qza

I also noticed that your command includes fancy quote and not the normal " quotes.
And it has em-dashes where there should be two normal dashes --.
These are important clues!

:female_detective: :mag_right:

Any chance you were editing this script in Microsoft Word?

Colin

1 Like

Hi Colin,
I am using BBEdit. Which editor should I use on a Mac to see strange symbols?
By copy and pasting your code, that is actually the same as mine just that the - are ok, I finally got an error message -> hurrah cutadapt does something

Plugin error from cutadapt:

Command ‘[‘cutadapt’, ‘–cores’, ‘1’, ‘–error-rate’, ‘0.1’, ‘–times’, ‘1’, ‘–overlap’, ‘3’, ‘–minimum-length’, ‘1’, ‘-o’, ‘/var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/q2-CasavaOneEightSingleLanePerSampleDirFmt-owgyz_rn/1-Pl1-A4_S69_L001_R1_001.fastq.gz’, ‘-p’, ‘/var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/q2-CasavaOneEightSingleLanePerSampleDirFmt-owgyz_rn/1-Pl1-A4_S69_L001_R2_001.fastq.gz’, ‘–front’, ‘CCTACGGGNGGCWGCAG$’, ‘-G’, ‘GACTACNVGGGTWTCTAATCC$’, ‘/var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/qiime2-archive-ae8mf7_f/157fec25-b8c1-456f-9915-cd247d352934/data/1-Pl1-A4_S69_L001_R1_001.fastq.gz’, ‘/var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/qiime2-archive-ae8mf7_f/157fec25-b8c1-456f-9915-cd247d352934/data/1-Pl1-A4_S69_L001_R2_001.fastq.gz’]’ returned non-zero exit status 2.

Debug info has been saved to /var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/qiime2-q2cli-err-l4lbgvt0.log

cutadapt reads the first sample with R1 and R2 and then is stuck.

any suggestion ?

Hello Ulrike,

BBEdit should work great, you just might have to turn off some of its 'fancy' options.

See this post about turning off "Use typographer's quotes" and the "Convert to ASCII" command.

I use vscode, which works well on Mac. :apple: https://code.visualstudio.com/


OK great!

Could you rerun that command and add the --verbose flag? That will give us a more detailed logs so we can look for the error.

Thanks,
Colin

1 Like

qiime cutadapt trim-paired
–i-demultiplexed-sequences demux-paired-end.qza
–p-front-f ‘CCTACGGGNGGCWGCAG$’
–p-front-r ‘GACTACNVGGGTWTCTAATCC$’
–o-trimmed-sequences paired-end-demux-trimmed.qza
–verbose

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 1 --error-rate 0.1 --times 1 --overlap 3 --minimum-length 1 -o /var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/q2-CasavaOneEightSingleLanePerSampleDirFmt-gjrxvmd8/1-Pl1-A4_S69_L001_R1_001.fastq.gz -p /var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/q2-CasavaOneEightSingleLanePerSampleDirFmt-gjrxvmd8/1-Pl1-A4_S69_L001_R2_001.fastq.gz --front CCTACGGGNGGCWGCAG$ -G GACTACNVGGGTWTCTAATCC$ /var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/qiime2-archive-ajlims7g/157fec25-b8c1-456f-9915-cd247d352934/data/1-Pl1-A4_S69_L001_R1_001.fastq.gz /var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/qiime2-archive-ajlims7g/157fec25-b8c1-456f-9915-cd247d352934/data/1-Pl1-A4_S69_L001_R2_001.fastq.gz

This is cutadapt 2.8 with Python 3.6.7
Command line parameters: --cores 1 --error-rate 0.1 --times 1 --overlap 3 --minimum-length 1 -o /var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/q2-CasavaOneEightSingleLanePerSampleDirFmt-gjrxvmd8/1-Pl1-A4_S69_L001_R1_001.fastq.gz -p /var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/q2-CasavaOneEightSingleLanePerSampleDirFmt-gjrxvmd8/1-Pl1-A4_S69_L001_R2_001.fastq.gz --front CCTACGGGNGGCWGCAG$ -G GACTACNVGGGTWTCTAATCC$ /var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/qiime2-archive-ajlims7g/157fec25-b8c1-456f-9915-cd247d352934/data/1-Pl1-A4_S69_L001_R1_001.fastq.gz /var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/qiime2-archive-ajlims7g/157fec25-b8c1-456f-9915-cd247d352934/data/1-Pl1-A4_S69_L001_R2_001.fastq.gz
Run “cutadapt --help” to see command-line options.
See https://cutadapt.readthedocs.io/ for full documentation.

cutadapt: error: Allowed placement restrictions for a 5’ adapter are XADAPTER and ^ADAPTER
Traceback (most recent call last):
File “/Users/uli/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2cli/commands.py”, line 328, in call
results = action(**arguments)
File “</Users/uli/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/decorator.py:decorator-gen-471>”, line 2, in trim_paired
File “/Users/uli/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 245, in bound_callable
output_types, provenance)
File “/Users/uli/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 390, in callable_executor
output_views = self._callable(**view_args)
File “/Users/uli/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2_cutadapt/_trim.py”, line 189, in trim_paired
run_commands(cmds)
File “/Users/uli/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2_cutadapt/_trim.py”, line 30, in run_commands
subprocess.run(cmd, check=True)
File “/Users/uli/miniconda3/envs/qiime2-2020.2/lib/python3.6/subprocess.py”, line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘[‘cutadapt’, ‘–cores’, ‘1’, ‘–error-rate’, ‘0.1’, ‘–times’, ‘1’, ‘–overlap’, ‘3’, ‘–minimum-length’, ‘1’, ‘-o’, ‘/var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/q2-CasavaOneEightSingleLanePerSampleDirFmt-gjrxvmd8/1-Pl1-A4_S69_L001_R1_001.fastq.gz’, ‘-p’, ‘/var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/q2-CasavaOneEightSingleLanePerSampleDirFmt-gjrxvmd8/1-Pl1-A4_S69_L001_R2_001.fastq.gz’, ‘–front’, ‘CCTACGGGNGGCWGCAG$’, ‘-G’, ‘GACTACNVGGGTWTCTAATCC$’, ‘/var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/qiime2-archive-ajlims7g/157fec25-b8c1-456f-9915-cd247d352934/data/1-Pl1-A4_S69_L001_R1_001.fastq.gz’, ‘/var/folders/jz/41p1rmwj7gj7g_lpwwsm5vy40000gn/T/qiime2-archive-ajlims7g/157fec25-b8c1-456f-9915-cd247d352934/data/1-Pl1-A4_S69_L001_R2_001.fastq.gz’]’ returned non-zero exit status 2.

Hello Ulrike,

With some help from Matt, we found the issue:
Allowed placement restrictions for a 5’ adapter are XADAPTER and ^ADAPTER

You can’t use that $ at the end of the flag! Try rerunning without the $ signes, and see how well it works.

Colin

Hi Colin,
hurrah, also this works now, step-by-step I am getting closer …
thank you so much for your kind help!!!
and be prepared for the next question I will have … :grinning:

1 Like

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