Skip to content

trim.fastq.sh

Simon Crameri edited this page Apr 1, 2022 · 1 revision

Description

Trim and quality-filter raw sequencing reads using trimmomatic, for a batch of samples in parallel.

Usage

trim.fastq.sh -s <sample file> -a <adapter file> -r <directory> -x <string> -t <integer>

Dependencies

java
trimmomatic

Arguments

# Required
-s    sample file containing one field (w/o header) with the sample base names
-a    adapter file in FASTA format containing adapter sequences

# Optional [DEFAULT]
-r  [pwd]     Path to raw reads folder. Will look in this folder for <${sample}${suffix1}> to find raw reads
-x  [details] Comma-separated suffixes for forward (fwd) and reverse (rev) reads.
              E.g. '_R1.fastq.gz,_R2.fastq.gz' if the fwd raw read file is ${sample}_R1.fastq.gz and the
              rev raw reads file is in ${sample}_R2.fastq.gz [DEFAULT:'_R1.fastq.gz,_R2.fastq.gz'].
-o  [pwd]     Path to output directory.
-t  [16]      Number of threads for parallel computations.

Details

The adaptorfile passed via -a needs to contain valid FASTA sequences of adaptors used for library preparation and sequencing.

Value

For each sample (${name}), the following files will be written to the output directory (pwd by default):

- ${name}.trim1.fastq.gz     Trimmed forward reads.
- ${name}.trim2.fastq.gz     Trimmed reverse reads.
- logs/${name}.U1.fastq.gz   Unpaired forward reads.
- logs/${name}.U2.fastq.gz   Unpaired reverse reads.
- logs/${name}.log           Trimming log file.
- logs/${name}.err           Trimming err file.

Examples

trim.fastq.sh -s samples.fabaceae.12.txt -a illumina.truseq.indexing.adaptors -r NovaSeq-run1_raw -x '_R1.fastq.gz,_R2.fastq.gz' -t 20

Clone this wiki locally