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
461 stars 150 forks source link

Cutadapt version error #124

Closed Jacob-Ferrier closed 2 years ago

Jacob-Ferrier commented 2 years ago

Hello,

I am trying to run TrimGalore on some fastq data. I have successfully installed cutadapt version 3.5 as you can see below, yet I am still encountering an error where TrimGalore seems to think that my cutadapt major version is less than 1.

Here is my output, note that I have changed some of the directory paths to \<dir> for privacy:

Multicore support not enabled. Proceeding with single-core trimming.
Path to Cutadapt set as: 'cutadapt' (default)
Cutadapt seems to be working fine (tested command 'cutadapt --version')
Cutadapt version: 3.5
single-core operation.
No quality encoding type selected. Assuming that the data provided uses Sanger encoded Phred scores (default)

Output will be written into the directory: <dir>

AUTO-DETECTING ADAPTER TYPE
===========================
Attempting to auto-detect adapter type from the first 1 million sequences of the first file (>> <dir>/A1FAMBrush2-24.IonXpressRNA_004.fastq <<)

Found perfect matches for the following adapter sequences:
Adapter type    Count   Sequence        Sequences analysed      Percentage
Illumina        0       AGATCGGAAGAGC   1000000 0.00
smallRNA        0       TGGAATTCTCGG    1000000 0.00
Nextera 0       CTGTCTCTTATA    1000000 0.00
Unable to auto-detect most prominent adapter from the first specified file (count Illumina: 0, count smallRNA: 0, count Nextera: 0)
Defaulting to Illumina universal adapter ( AGATCGGAAGAGC ). Specify -a SEQUENCE to avoid this behavior).

Writing report to '<dir>/A1FAMBrush2-24.IonXpressRNA_004.fastq_trimming_report.txt'

SUMMARISING RUN PARAMETERS
==========================
Input filename: <dir>/A1FAMBrush2-24.IonXpressRNA_004.fastq
Trimming mode: single-end
Trim Galore version: 0.6.7
Cutadapt version: 3.5
Number of cores used for trimming: 1
Quality Phred score cutoff: 20
Quality encoding type selected: ASCII+33
Adapter sequence: 'AGATCGGAAGAGC' (Illumina TruSeq, Sanger iPCR; default (inconclusive auto-detection))
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
Running FastQC on the data once trimming has completed

Use of uninitialized value $major_version in numeric eq (==) at /c/Users/jferri09/Documents/TrimGalore-0.6.7/trim_galore line 794.
Use of uninitialized value $major_version in numeric gt (>) at /c/Users/jferri09/Documents/TrimGalore-0.6.7/trim_galore line 811.
Cutadapt major version was not 1 or higher. Simply too old...`

Following the advice of the issues thread here, I have changed line 791 of trim_galore to my ($major_version,$sub_version) = (3,5);

This seems to have worked as a quick and dirty solution, but I thought that I should still report this issue.

Thank you in advance!

FelixKrueger commented 2 years ago

Hi @Jacob-Ferrier

This is odd, I just installed Cutadapt v3.5, and it all completes just fine without any error message. I tried this with Trim Galore v0.6.2, 0.6.5, 0.6.6, 0.6.7, they all work fine (on Linux)...

SUMMARISING RUN PARAMETERS
==========================
Input filename: /<dir>/test_data.fastq
Trimming mode: single-end
Trim Galore version: 0.6.7
Cutadapt version: 3.5
Number of cores used for trimming: 1
Quality Phred score cutoff: 20
Quality encoding type selected: ASCII+33
Adapter sequence: 'AGATCGGAAGAGC' (Illumina TruSeq, Sanger iPCR; 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
Running FastQC on the data once trimming has completed

Cutadapt seems to be fairly up-to-date (version 3.5). Setting -j 1
Writing final adapter and quality trimmed output to test_data_trimmed.fq

  >>> Now performing quality (cutoff '-q 20') and adapter trimming in a single pass for the adapter sequence: 'AGATCGGAAGAGC' from file /<dir>/test_data.fastq <<< 
This is cutadapt 3.5 with Python 3.9.7
Command line parameters: -j 1 -e 0.1 -q 20 -O 1 -a AGATCGGAAGAGC /<dir>/test_data.fastq
Processing reads on 1 core in single-end mode ...
Finished in 0.13 s (13 µs/read; 4.61 M reads/minute).

I wonder what the issue is on your side?

FelixKrueger commented 2 years ago

Having said that, I just changed the regex that tries to extract the Cutadapt version. Maybe the regex works on our system, but not on yours?

Can you clone the current dev version and see if that fixes it?

FelixKrueger commented 2 years ago

Haven't heard back in a while, assuming it works now.