Run the Trim Galore! tool

trim_fastq(fastq1, fastq2 = NULL, adapter1 = NULL, adapter2 = NULL,
  illumina = FALSE, nextera = FALSE, small_rna = FALSE,
  minlength = 20, minqual = 20, trimN = TRUE,
  retainUnpaired = TRUE, retain1length = 35, retain2length = 35,
  clipR1 = NULL, clipR2 = NULL, clip3primeR1 = NULL,
  clip3primeR2 = NULL, robust_check = FALSE, dest.dir = NULL,
  threads = NULL, trimgalore = "trim_galore")

Arguments

fastq1

a character vector indicating the read files to be trimmed.

fastq2

(optional) a character vector indicating read files to be trimmmed. If specified, it is assumed the reads are paired, and this vector MUST be in the same order as those listed in fastq1. If NULL then it is assumed the reads are single-end.

adapter1

a character string specifying the adapter sequence to be trimmed. If not specified explicitly, Trim Galore will try to auto-detect whether the Illumina universal, Nextera transposase or Illumina small RNA adapter sequence was used. Also see illumina, nextera and small_rna options. If no adapter can be detected within the first 1 million sequences of the first file specified Trim Galore defaults to illumina.

adapter2

a character string specifying an optional adapter sequence to be trimmed off read 2 of paired-end files. This option requires paired-end reads.

illumina

a logical specifying that the adapter sequence to be trimmed is the first 13bp of the Illumina universal adapter AGATCGGAAGAGC instead of the default auto-detection of adapter sequence. Default: FALSE

nextera

adapter sequence to be trimmed is the first 12bp of the Nextera adapter CTGTCTCTTATA instead of the default auto-detection of adapter sequence.

small_rna

a logical specifying that the adapter sequence to be trimmed is the first 12bp of the Illumina Small RNA 3' Adapter TGGAATTCTCGG instead of the default auto-detection of adapter sequence. Selecting to trim smallRNA adapters will also lower the length value to 18bp. If the smallRNA libraries are paired-end then adapter2 will be set to the Illumina small RNA 5' adapter automatically (GATCGTCGGACT) unless adapter2 had been defined explicitly.

minlength

an integer value; reads that become shorter than this length as a result of either quality or adapter trimming are discarded. A value of 0 effectively disables this behaviour. Default: 20 bp. For paired-end files, both reads of a read-pair need to be longer than bp to be printed out to validated paired-end files. If only one read became too short there is the possibility of keeping such unpaired single-end reads (see retain_unpaired). Default pair-cutoff: 20 bp.

minqual

an integer value specifying the quality threshold below which to trim low-quality ends from reads in addition to adapter removal. Default Phred score: 20.

trimN

a logical specifying whether to remove Ns from the end of reads.

retainUnpaired

a logical. If only one of the two paired-end reads become too short, the longer read will be written to either .unpaired_1.fq or .unpaired_2.fq output files. The length cutoff for unpaired single-end reads is governed by the parameters retain1length and retain2length. Default: ON.

retain1length

an integer. Unpaired single-end read length cutoff needed for read 1 to be written to .unpaired_1.fq output file. These reads may then be mapped in single-end mode. Default: 35 bp.

retain2length

an integer. Unpaired single-end read length cutoff needed for read 2 to be written to .unpaired_1.fq output file. These reads may then be mapped in single-end mode. Default: 35 bp

clipR1

an integer instructing Trim Galore to remove the specified number of bp from the 5' end of read 1 (or single-end reads). This may be useful if the qualities were very poor, or if there is some sort of unwanted bias at the 5' end. Default: 0

clipR2

an integer instructing Trim Galore to remove the specified number of bp from the 5' end of read 2 (paired-end reads only). This may be useful if the qualities were very poor, or if there is some sort of unwanted bias at the 5' end. Default: 0

clip3primeR1

an integer instructing Trim Galore to remove the specified number of bp from the 3' end of read 1 (or single-end reads) AFTER adapter/quality trimming has been performed. This may remove some unwanted bias from the 3' end that is not directly related to adapter sequence or basecall quality. Default: 0.

clip3primeR2

an integer instructing Trim Galore to remove the specified number of bp from the 3' end of read 1 (or single-end reads) AFTER adapter/quality trimming has been performed. This may remove some unwanted bias from the 3' end that is not directly related to adapter sequence or basecall quality. Default: 0.

robust_check

a logical indicating whether to check that the paired files specified are matching and have equal numbers of reads. Default: FALSE

dest.dir

a character string specifying the output directory. If NULL a directory named "TRIMMED_FASTQC" is created in the current working directory [DEFAULT = NULL].

threads

an integer value indicating the number of parallel threads to be used by FastQC. [DEFAULT = maximum number of available threads - 1].

trimgalore

a character string specifying the path to the trimgalore executable. On Unix systems, if the executable is in $PATH, then it may be left as the default. If it is not in $PATH, then the absolute path should be given. unless the system has been set up as described in the vignette.

Details

This script runs the Trim Galore! tool and requires installation of both Cutadapt and Trim Galore! It is essential that Cutadapt is in the executable path otherwise this tool will not work.