Kneaddata trf error

Hi,

I am having an issue with trf when running kneaddata. It only happens with this one sample (a negative sequencing control, the true samples all run without any issues).
The error in the log file isn’t particularly informative so I’m mostly hoping that somebody else has a trf issues and knows a fix.
The error and command used are below (with the command, the input is a tsv file with one sample per row where I’m pulling the sample name and paths to fwd and rev reads).

Thanks in advance,
Calum

while read sample read1 read2
do
    kneaddata \
        -i $read1 \
        -i $read2 \
        -o Kneaddata_Out/ \
        --output-prefix $sample \
        -db /home/cwwalsh/Databases/Kneaddata_HostRemoval/hg37dec_v0.1 \
        --trimmomatic /home/cwwalsh/miniconda3/envs/kneaddata/share/trimmomatic \
        -p 1 \
        -t 50 \
done < paths.tsv

05/19/2022 03:37:35 PM - kneaddata.utilities - CRITICAL: Error executing: kneaddata_trf_parallel --input /home/mdu/damg/analyses/CSF_Illumina_20220519/Kneaddata_Out/NTC-M2022-01733-M2022-01842.trimmed.single.1.fasta --output /home/mdu/damg/analyses/CSF_Illumina_20220519/Kneaddata_Out/NTC-M2022-01733-M2022-01842.trimmed.single.1.fasta.trf.parameters.2.7.7.80.10.50.500.dat --trf-path /home/cwwalsh/miniconda3/envs/kneaddata/bin/trf --trf-options ‘2 7 7 80 10 50 500 -h -ngs’ --nproc 50

1 Like

I’ve also had a similar error with an extremely small sample in the past, here is the log :

Error executing: kneaddata_trf_parallel --input /localscratch/ronj2303.7200303.0/S-21-POLPIL-G/S-21-POLPIL-G.trimmed.single.1.fasta --output /localscratch/ronj2303.7200303.0/S-21-POLPIL-G/S-21-POLPIL-G.trimmed.single.1.fasta.trf.parameters.2.7.7.80.10.50.500.dat --trf-path /cvmfs/soft.mugqic/CentOS6/software/TRF/TRF-4.09/trf --trf-options '2 7 7 80 10 50 500 -h -ngs' --nproc 23

I suspect it happens when no trf is found but I have not tested that.

1 Like

Thanks @jorondo1 - good to know I’m not the only one running into this. Will continue without trf for the moment and come back to it.

1 Like

Hi,

I had the same error on my data as well. Did you manage to fix this issue? I got some additional hints while debugging:

I am using kneaddata v0.10.0 and I checked the log file and identified the error is coming from this line:

06/14/2023 11:05:13 AM - kneaddata.utilities - CRITICAL: Error executing: kneaddata_trf_parallel --input <my_sample_id>.trimmed.single.2.fasta --output <my_sample_id>.trimmed.single.2.fasta.trf.parameters.2.7.7.80.10.50.500.dat --trf-path <my_path>/.snakemake/conda/91e1e7d18d20166c9187ea5ce7c6c468_/bin/trf --trf-options '2 7 7 80 10 50 500 -h -ngs' --nproc 8

And when I run this on the same conda environment, I got the following error message:

usage: kneaddata_trf_parallel [-h] --input INPUT --output OUTPUT --trf-path TRF_PATH --trf-options TRF_OPTIONS [--nproc NPROC]
kneaddata_trf_parallel: error: the following arguments are required: --trf-options

Seems that the –trf-options is missing. Hope that the developers can help with fixing this.

Best wishes,
Shen

Hi all,
Could you please upgrade the Kneaddata to v0.12.0 please. Missing –trf-options should be resolved in latest version.

Regards,
Sagun

I encountered the same error.
I was able to solve it by replacing my trf executable with the “trf409.legacylinux64” executable from trf’s github page, renaming this executable to trf, and referencing to this executable in kneaddata with the optional --trf argument.

I hope this helps.

[kneaddata v0.12.0]

I have also experienced this problem with trf when the number of reads in file kneaddata.trimmed.1.fasta is small.

[ kneaddata.log ]
09/24/2023 05:14:18 AM - kneaddata.utilities - CRITICAL: Error executing: kneaddata_trf_parallel --input kneaddata.trimmed.2.fasta --output kneaddata.trimmed.2.fasta.trf.parameters.2.7.7.80.10.50.500.dat --trf-path /opt/conda/bin/trf --trf-options ‘2 7 7 80 10 50 500 -h -ngs’ --nproc 32

Running this step manually,
$ kneaddata_trf_parallel --input /scratch/edens/nextflow/humann3/work/34/7766b3ba524e2dd7d8a542d8eac2ad/kneaddata.trimmed.2.fasta --output kneaddata.trimmed.2.fasta.trf.parameters.2.7.7.80.10.50.500.dat --trf-path /opt/conda/bin/trf --trf-options ‘2 7 7 80 10 50 500 -h -ngs’ --nproc 4

Error: Error while loading sequenceError executing: /opt/conda/bin/trf kneaddata.trimmed.2.fasta.trf.parameters.2.7.7.80.10.50.500.dat_3_temp_trf_outputn4x_ms24 2 7 7 80 10 50 500 -h -ngs

Running trf1 …

/opt/conda/bin/trf kneaddata.trimmed.2.fasta.trf.parameters.2.7.7.80.10.50.500.dat_1_temp_trf_output2zkk73o7 2 7 7 80 10 50 500 -h -ngs

Running trf3 …

/opt/conda/bin/trf kneaddata.trimmed.2.fasta.trf.parameters.2.7.7.80.10.50.500.dat_3_temp_trf_outputn4x_ms24 2 7 7 80 10 50 500 -h -ngs

Error executing: /opt/conda/bin/trf kneaddata.trimmed.2.fasta.trf.parameters.2.7.7.80.10.50.500.dat_3_temp_trf_outputn4x_ms24 2 7 7 80 10 50 500 -h -ngs

Running trf0 …

/opt/conda/bin/trf kneaddata.trimmed.2.fasta.trf.parameters.2.7.7.80.10.50.500.dat_0_temp_trf_output26adko_x 2 7 7 80 10 50 500 -h -ngs

Running trf2 …

/opt/conda/bin/trf kneaddata.trimmed.2.fasta.trf.parameters.2.7.7.80.10.50.500.dat_2_temp_trf_outputap27s_dg 2 7 7 80 10 50 500 -h -ngs

Subprocess reported error. Please see log file for more details.

When I pass ‘–nproc 1’, I get,

kneaddata_trf_parallel --input kneaddata.trimmed.2.fasta --output kneaddata.trimmed.2.fasta.trf.parameters.2.7.7.80.10.50.500.dat --trf-path /opt/conda/bin/trf --trf-options ‘2 7 7 80 10 50 500 -h -ngs’ --nproc 1

Running trf …

/opt/conda/bin/trf kneaddata.trimmed.2.fasta 2 7 7 80 10 50 500 -h -ngs

No error occurs.