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

How to properly specify a basename? #126

Closed jolespin closed 2 years ago

jolespin commented 2 years ago
(trim-galore_env) -bash-4.2$ trim_galore  -j 8 --basename Fastq/trimmed/${ID}/trimmed Fastq/raw/${ID}_R1_001.fastq.gz Fastq/raw/${ID}_R2_001.fastq.gz
Using an excessive number of cores has a diminishing return! It is recommended not to exceed 8 cores per trimming process (you asked for 8 cores). Please consider re-specifying
Path to Cutadapt set as: 'cutadapt' (default)
Cutadapt seems to be working fine (tested command 'cutadapt --version')
Cutadapt version: 1.18
Could not detect version of Python used by Cutadapt from the first line of Cutadapt (but found this: >>>#!/bin/sh<<<)
Letting the (modified) Cutadapt deal with the Python version instead
pigz 2.6
Parallel gzip (pigz) detected. Proceeding with multicore (de)compression using 8 cores

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

Using user-specified basename (>>Fastq/trimmed/0978C02A_AE_CSF_CD3PCD4P_Bch2_PLT4_1Cell_A10_S82/trimmed<<) instead of deriving the filename from the input file(s)
Please make sure the name specified with --basename does not contain file path information! (Fastq/trimmed/0978C02A_AE_CSF_CD3PCD4P_Bch2_PLT4_1Cell_A10_S82/trimmed) at /usr/local/devel/ANNOTATION/jespinoz/anaconda3/envs/trim-galore_env/bin/trim_galore line 2944.

I'm trying to get the following directory structure:

Fastq/trimmed/${ID}/trimmed_1.fastq.gz Fastq/trimmed/${ID}/trimmed_2.fastq.gz

or similar.

How can I specify a basename properly?

FelixKrueger commented 2 years ago

The parameter --basename allows you to specify a basename for the output files instead of deriving the name from the input files, for example --basename my_favouriteID. You could specify the output directory separately with -o:

-o/--output_dir <DIR>   If specified all output will be written to this directory instead of the current
                        directory. If the directory doesn't exist it will be created for you.

So for example: --basename my_favouriteID -o Fastq/trimmed/my_favouriteID/.

The output files within that directory will still get renamed according to standard Trim Galore naming conventions (i.e. my_favouriteID_R1_trimming_report.txt,...,my_favouriteID_R1_val_1.fq.gz,my_favouriteID_R2_val_2.fq.gz etc., but you can of you course rename the files once the run has finished.

jolespin commented 2 years ago

Thanks, that solved the issue.