[meta]
name = "trim_galore"
category = "qc"
description = "Wrapper around Cutadapt and FastQC for quality and adapter trimming with automatic quality control"
tags = ["trimming", "adapter", "quality-control", "illumina", "bisulfite", "rrbs", "fastqc"]
author = "oxo-call built-in"
source_url = "https://github.com/FelixKrueger/TrimGalore"

[context]
concepts = [
    "Trim Galore wraps Cutadapt for adapter trimming and FastQC for QC; good for routine Illumina and RRBS data.",
    "Use --paired for paired-end data; input files are positional arguments (both files for PE).",
    "Trim Galore auto-detects adapter sequences by default; use --adapter to specify manually.",
    "Use --quality N (default: 20) for quality trimming threshold; --length N for minimum length.",
    "For RRBS data, use --rrbs flag (trims 2 extra bp to compensate for MspI filling reaction).",
    "For bisulfite sequencing: use --bisulfite for non-RRBS WGBS data.",
    "Use --cores N for multi-threading; --gzip for gzipped output.",
    "Output goes to current directory by default; use -o for custom output directory.",
]

pitfalls = [
    "Trim Galore requires both Cutadapt and FastQC to be installed and in PATH.",
    "For paired-end, both files must be specified and --paired flag must be present.",
    "Without --paired, each file in a PE pair is trimmed independently, losing pairing information.",
    "The --rrbs flag should ONLY be used for MspI-digested RRBS data, not for WGBS.",
    "Trim Galore's auto-adapter detection reads the first 1M reads — it may miss adapters in low-complexity data.",
    "Default minimum length is 20 bp — increase with --length for tools with higher minimum requirements.",
]

[[examples]]
task = "trim adapters and quality-filter paired-end Illumina reads"
args = "--paired --quality 20 --length 36 --cores 4 --gzip -o trimmed_output/ R1.fastq.gz R2.fastq.gz"
explanation = "--paired PE mode; --quality 20 Q20 threshold; --length 36 minimum; --gzip compressed output; -o output dir"

[[examples]]
task = "trim RRBS bisulfite sequencing data"
args = "--paired --rrbs --quality 20 --length 20 --cores 4 --gzip -o rrbs_trimmed/ R1.fastq.gz R2.fastq.gz"
explanation = "--rrbs for MspI-digested RRBS; trims 2 bp from 3' end after adapter removal to remove MspI bias"

[[examples]]
task = "trim single-end reads with automatic adapter detection"
args = "--quality 20 --length 36 --cores 4 --gzip -o se_trimmed/ reads.fastq.gz"
explanation = "single-end mode (no --paired); auto-detects Illumina adapters; quality trim at Q20"

[[examples]]
task = "trim with specific adapter sequence for non-standard libraries"
args = "--paired --adapter AGATCGGAAGAGCACACGTCT --adapter2 AGATCGGAAGAGCGTCGTGTA --quality 20 --cores 4 --gzip -o custom_trimmed/ R1.fastq.gz R2.fastq.gz"
explanation = "--adapter and --adapter2 for explicit adapter specification for R1 and R2 respectively"
