FelixKrueger / TrimGalore

A wrapper around Cutadapt and FastQC to consistently apply adapter and quality trimming to FastQ files, with extra functionality for RRBS data
GNU General Public License v3.0
462 stars 150 forks source link

Whenever I run Trim Galore I get cut adapt error "Too many parameters" #14

Closed sxrastogi closed 6 years ago

sxrastogi commented 6 years ago

Whenever I try to run Trim Galore on my fastq files from the terminal, cutadapt terminates with exit signal 512 and throws up the error message "too many parameters." However, when I run cutadapt on my files, the trimming happens just fine. How can I get Trim Galore to actually trim my sequences?

Here is the generic version of what I input into the terminal: trim_galore -o

Here's what was returned:
No quality encoding type selected. Assuming that the data provided uses Sanger encoded Phred scores (default)

Path to Cutadapt set as: 'cutadapt' (default) 1.15 Cutadapt seems to be working fine (tested command 'cutadapt --version')

AUTO-DETECTING ADAPTER TYPE

Attempting to auto-detect adapter type from the first 1 million sequences of the first file (>> /Volumes/Seagate Backup Plus Drive/12-6-17_fastq_expanded/SCGPM_SR100-092817_CBA2F_L1_TAGGCATG-CTCTCTAT_R1.fastq <<)

Found perfect matches for the following adapter sequences: Adapter type Count Sequence Sequences analysed Percentage Nextera 29851 CTGTCTCTTATA 1000000 2.99 smallRNA 6 TGGAATTCTCGG 1000000 0.00 Illumina 0 AGATCGGAAGAGC 1000000 0.00 Using Nextera adapter for trimming (count: 29851). Second best hit was smallRNA (count: 6)

Writing report to '/Volumes/Seagate Backup Plus Drive/12-11-17 trimming examples/NexteraTrimmed/SCGPM_SR100-092817_CBA2F_L1_TAGGCATG-CTCTCTAT_R1.fastq_trimming_report.txt'

SUMMARISING RUN PARAMETERS

Input filename: /Volumes/Seagate Backup Plus Drive/12-6-17_fastq_expanded/SCGPM_SR100-092817_CBA2F_L1_TAGGCATG-CTCTCTAT_R1.fastq Trimming mode: single-end Trim Galore version: 0.4.4_dev Cutadapt version: 1.15 Quality Phred score cutoff: 20 Quality encoding type selected: ASCII+33 Adapter sequence: 'CTGTCTCTTATA' (Nextera Transposase sequence; auto-detected) Maximum trimming error rate: 0.1 (default) Minimum required adapter overlap (stringency): 1 bp Minimum required sequence length before a sequence gets removed: 20 bp

Writing final adapter and quality trimmed output to SCGPM_SR100-092817_CBA2F_L1_TAGGCATG-CTCTCTAT_R1_trimmed.fq

Now performing quality (cutoff 20) and adapter trimming in a single pass for the adapter sequence: 'CTGTCTCTTATA' from file /Volumes/Seagate Backup Plus Drive/12-6-17_fastq_expanded/SCGPM_SR100-092817_CBA2F_L1_TAGGCATG-CTCTCTAT_R1.fastq <<< cutadapt version 1.15 Copyright (C) 2010-2017 Marcel Martin marcel.martin@scilifelab.se

cutadapt removes adapter sequences from high-throughput sequencing reads.

Usage: cutadapt -a ADAPTER [options] [-o output.fastq] input.fastq

For paired-end reads: cutadapt -a ADAPT1 -A ADAPT2 [options] -o out1.fastq -p out2.fastq in1.fastq in2.fastq

Replace "ADAPTER" with the actual sequence of your 3' adapter. IUPAC wildcard characters are supported. The reverse complement is not automatically searched. All reads from input.fastq will be written to output.fastq with the adapter sequence removed. Adapter matching is error-tolerant. Multiple adapter sequences can be given (use further -a options), but only the best-matching adapter will be removed.

Input may also be in FASTA format. Compressed input and output is supported and auto-detected from the file name (.gz, .xz, .bz2). Use the file name '-' for standard input/output. Without the -o option, output is sent to standard output.

Citation:

Marcel Martin. Cutadapt removes adapter sequences from high-throughput sequencing reads. EMBnet.Journal, 17(1):10-12, May 2011. http://dx.doi.org/10.14806/ej.17.1.200

Use "cutadapt --help" to see all command-line options. See http://cutadapt.readthedocs.io/ for full documentation.

cutadapt: error: Too many parameters.

Cutadapt terminated with exit signal: '512'. Terminating Trim Galore run, please check error message(s) to get an idea what went wrong...

FelixKrueger commented 6 years ago

Hi there,

I am pretty sure that this fails because you've got empty spaces in the path name of your output file. Could you try changing the folder name so that it doesn't contain white spaces, like so:

from Seagate Backup Plus Drive/12-11-17 trimming examples to : Seagate_Backup_Plus_Drive/12-11-17_trimming_examples

Or alternatively run Trim Galore in the folder containing the input files without using -o and see report back if this doesn't fix the problem?

sxrastogi commented 6 years ago

Thanks so much, FelixKrueger, that cleared the problem right up!

FelixKrueger commented 6 years ago

Excellent, thanks for the feedback.

orangebromeliad commented 4 years ago

Hi Felix,

I have a similar issue to this, however there is nothing that I can do about the directory name having spaces in it. The gzip stage of the process also threw up an error due to what I believe is the same reason. Is it possible to update the code such that it will automatically 'quote' the pathname when feeding it to gzip or cutadapt such that spaces in the name don't throw up problems? I've used Trim_Galore! for a while (love it!) and basically every issue I've had has been due to this. Best, Tim

FelixKrueger commented 4 years ago

Hi Tim,

If you move to the folder containing the input files, you should be able to run e.g.:

trim_galore --paired file_R1.fastq.gz file_R2.fastq.gz

irrespective of whether the current working directory contains spaces in its directory name, or am I mistaken?

I suppose I could look into quoting file path names, but it seems that moving to the directory with the input files yourself, or chosing -o output_dir_without_spaces seems to be so much easier, wouldn't you agree? If this is not an option could you link the exact details of what you are trying to run?

Cheers, Felix

orangebromeliad commented 4 years ago

Hi Felix, Yes this is what I shall do.

It is up to you, I don't know how difficult it is to implement? I would definitely suggest an error message which flagged up that it is spaces that are causing the problem since the error messages that gzip/cutadapt give are hard to interpret. What do you think?

Best, Felix

FelixKrueger commented 4 years ago

I have now added checks, as well as helpful [FATAL ERROR] messages when input file names, or the output directory name, were supplied with whitespace(s). This is available in the current dev version, and will then be live in the next release. Hope this helps?