cutadapt icon indicating copy to clipboard operation
cutadapt copied to clipboard

cutadapt not recognizing second input file

Open izabelstohel opened this issue 1 year ago • 1 comments

Hello,

I am running cutadapt 4.9 with Python 3.12.5, installed with conda.

I keep getting this error: You used an option that enables paired-end mode (such as -p, -A, -G, -B, -U), but only provided one input file. Please either provide two input files or use --interleaved as appropriate.

My code is as follows:

cutadapt -m 20 -a CCTACGGRRBGCASCAGKVRVGAAT -a GTGYCAGCMGCCGCGGTAA
-A GGATTAGAWACCCBNGTAGTCC -A GAATTGRCGGGGGMCCGCACAAG
-o 20240731/30-985647325/16S_trimmed_fastq/${line}_R1_001.fastq.gz -p 20240731/30-985647235/16S_trimmed_fastq/${line}_R2_001.fastq.gz
20240731/30-985647235/00_fastq/${line}_R1_001.fastq.gz 20240731/30-985647235/00_fastq/${line}_R2_001.fastq.gz done<samples.txt

I can only assume I have an issue with syntax, but as far as I can tell this error shouldn't happen.

izabelstohel avatar Aug 17 '24 01:08 izabelstohel

I’m sure this is just an issue in your script. Some ideas for debugging:

  • Add echo before cutadapt in your command. This will print out the commands that would be run. Check the output carefully.
  • You are maybe missing a space before the final \.

Here is what you wrote above:

cutadapt -m 20 -a CCTACGGRRBGCASCAGKVRVGAAT -a GTGYCAGCMGCCGCGGTAA \
-A GGATTAGAWACCCBNGTAGTCC -A GAATTGRCGGGGGMCCGCACAAG \
-o 20240731/30-985647325/16S_trimmed_fastq/${line}_R1_001.fastq.gz -p 20240731/30-985647235/16S_trimmed_fastq/${line}_R2_001.fastq.gz\
20240731/30-985647235/00_fastq/${line}_R1_001.fastq.gz 20240731/30-985647235/00_fastq/${line}_R2_001.fastq.gz
done<samples.txt

The backslash at the end of the third line is not visible in what you wrote (because it is treated by GitHub as Markdown, where it means that a linebreak should be inserted). If you actually wrote it like that on the command line, then the third and fourth line will be joined without a space in between. That is, the file name after the -p option would be 20240731/30-985647235/16S_trimmed_fastq/${line}_R2_001.fastq.gz20240731/30-985647235/00_fastq/${line}_R1_001.fastq.gz, which explains the error message.

marcelm avatar Aug 17 '24 21:08 marcelm