Question: Trim_galore error: quality_trim_index()
gravatar for bekahlee54
4.1 years ago by
bekahlee540 wrote:

I am running trim-galore on a computing cluster and would like to remove adapters from my sequences. I downloaded and installed the cutadapt package for this task.

The following is the line of code I'm using for trimming:

./trim_galore -q 30 --illumina -o /work/bekhorn/Trimmed/ --gzip --paired --path_to_cutadapt /work/bekhorn/bin/cutadapt SRR1518485_1.fastq SRR1518485_2.fastq

Cutadapt appears to start working, however, I get error messages and the program terminates with no written output.

Here are the lines printed to the screen:

"No quality encoding type selected. Assuming that the data provided uses Sanger encoded Phred scores (default)

Path to Cutadapt set as: '/work/bekhorn/bin/cutadapt' (user defined)
Cutadapt seems to be working fine (tested command '/work/bekhorn/bin/cutadapt --version')
Writing report to '/global/a/work/bekhorn/Trimmed/SRR1518485_1.fastq_trimming_report.txt'


Input filename: SRR1518485_1.fastq
Trimming mode: paired-end
Trim Galore version: 0.4.2
Cutadapt version: 1.11
Quality Phred score cutoff: 30
Quality encoding type selected: ASCII+33
Adapter sequence: 'AGATCGGAAGAGC' (Illumina TruSeq, Sanger iPCR; user defined)
Maximum trimming error rate: 0.1 (default)
Minimum required adapter overlap (stringency): 1 bp
Minimum required sequence length for both reads before a sequence pair gets removed: 20 bp
Output file(s) will be GZIP compressed

Writing final adapter and quality trimmed output to SRR1518485_1_trimmed.fq.gz

 Now performing quality (cutoff 30) and adapter trimming in a single pass for the adapter sequence: 'AGATCGGAAGArom file SRR1518485_1.fastq.
This is cutadapt 1.11 with Python 2.6.6
Command line parameters: -f fastq -e 0.1 -q 30 -O 1 -a AGATCGGAAGAGC SRR1518485_1.fastq
Trimming 1 adapter with at most 10.0% errors in single-end mode ...
Traceback (most recent call last):
  File "/work/bekhorn/bin/cutadapt", line 5, in <module>
    pkg_resources.run_script('cutadapt==1.11', u'cutadapt')
  File "/usr/lib/python2.6/site-packages/", line 461, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.6/site-packages/", line 1194, in run_script
    execfile(script_filename, namespace, namespace)
  File "/gwork/bekhorn/lib64/python2.6/site-packages/cutadapt-1.11-py2.6-linux-x86_64.egg/EGG-INFO/scripts/cutadapt", 10, in <module>
  File "/work/bekhorn/lib64/python2.6/site-packages/cutadapt-1.11-py2.6-linux-x86_64.egg/cutadapt/scripts/cutadapt.pyne 702, in main
    stats = process_single_reads(reader, modifiers, filters)
  File "/work/bekhorn/lib64/python2.6/site-packages/cutadapt-1.11-py2.6-linux-x86_64.egg/cutadapt/scripts/cutadapt.pyne 115, in process_single_reads
    read = modifier(read)
  File "/work/bekhorn/lib64/python2.6/site-packages/cutadapt-1.11-py2.6-linux-x86_64.egg/cutadapt/", line in __call__
    start, stop = quality_trim_index(read.qualities, self.cutoff_front, self.cutoff_back, self.base)
TypeError: quality_trim_index() takes at most 3 arguments (4 given)

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

Has anyone else experienced this same problem or know what I am doing wrong?

ADD COMMENTlink modified 4.1 years ago by genomax92k • written 4.1 years ago by bekahlee540

My guess is that cutadapt doesn't work in python 2.6 (that's incredibly outdated anyway). Use python 2.7.

ADD REPLYlink written 4.1 years ago by Devon Ryan97k

Cutadapt's doc indicates it supports 2.6. I just tested with Python 2.6.9 and everything worked. OP used 2.6.6. Unsure if that's the culprit.

ADD REPLYlink written 4.1 years ago by Eric Lim1.7k

Perhaps it's cython then. This function exists twice in the cutadapt code, once with 4 arguments and once with 3, so it's picking up the wrong one for some reason. A likely simpler solution would be for cutadapt to only define the function once.

ADD REPLYlink written 4.1 years ago by Devon Ryan97k

OP should just install cutadapt via miniconda/bioconda and be done with it.

ADD REPLYlink written 4.1 years ago by Eric Lim1.7k

Thanks, I’ve removed the 3-argument version now. This would not fix the problem the OP has, though since the underlying problem is that the extension module (which contains the 4-argument version of the function) could not be loaded. This points to a version mismatch or some other installation problem.

ADD REPLYlink written 3.9 years ago by Marcel M100

Updating the python version solved the problem.

ADD REPLYlink modified 2.7 years ago • written 2.7 years ago by bekahlee540
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1705 users visited in the last hour