Package: trimnami
Trim lots of metagenomics samples all at once.MotivationWe keep writing pipelines that start with read trimming.
Rather than copy-pasting code each time,
this standalone Snaketool handles our trimming needs.
The tool will collect sample names and files from a directory or TSV file,
optionally remove host reads, and trim with your favourite read trimmer.
Read trimming methods supported so far:FastpPrinseq++BBtools for Round A/B viral metagenomicsFiltlong + Rasusa for longreadsInstallTrimnami is still in development but can be easily installed with pip:Easy installpipinstalltrimnamiDeveloper installgitclonehttps://github.com/beardymcjohnface/Trimnami.gitcdTrimnami/
pipinstall-e.TestTrimnami comes with inbuilt tests which you can run to check everything works fine.# test fastp only (default method)trimnamitest# test all SR methodstrimnamitestfastpprinseqroundAB# test all SR methods with host removaltrimnamitesthostfastpprinseqroundAB# test nanopore method (with host removal)trimnamitestnpUsageTrim reads with Fastp or Prinseq++# Fastp (default)trimnamirun--readsreads/# Prinseq++trimnamirun--readsreads/prinseq# Why not both!trimnamirun--readsreads/fastpprinseqInclude host removaltrimnamirun--readsreads/--hosthost_genome.fastaLongreads with host removal.
Specify 'nanopore' for targets and use the appropriate minimap preset.trimnamirun\--readsreads/\--hosthost_genome.fasta\--minimapmap-ont\nanoporeParsing samples with--readsYou can pass either a directory of reads or a TSV file to--reads.Directory:Trimnami will infer sample names and _R1/_R2 pairs from the filenames.TSV file:Trimnami expects 2 or 3 columns, with column 1 being the sample name and columns 2 and 3 the reads files.More information and examples hereConfigure trimming parametersYou can customise the trimming parameters via the config file.
Copy the default config file.trimnamiconfigThen edit the config filetrimnami.out/trimnami.config.yamlin your favourite text editor.
Run trimnami like normal, or point to your custom config file if you've moved it.trimnamirun...--configfile/my/awesome/config.yamlOutputsTrimmed reads will be saved in various subfolders in the output directory.
e.g. if trimming with Fastp or Prinseq++,
trimmed reads will be intrimnami.out/fastp/ortrimnami.out/prinseq/.
Paired reads will yield three files:
The R1 and R2 paired reads, and any singletons from trimming or host removal.
Subsampling will produce extra files of subsampled trimmed reads.
Multiqc-fastqc reports for any runs will be available intrimnami.out/reports/Example outputsClick to expandprinseqtrimnami.out/
└── prinseq
    ├── A13-04-182-06_TAGCTT.paired.R1.fastq.gz
    ├── A13-04-182-06_TAGCTT.paired.R2.fastq.gz
    ├── A13-04-182-06_TAGCTT.paired.S.fastq.gz
    ├── A13-12-250-06_GGCTAC.paired.R1.fastq.gz
    ├── A13-12-250-06_GGCTAC.paired.R2.fastq.gz
    ├── A13-12-250-06_GGCTAC.paired.S.fastq.gz
    └── A13-135-177-06_AGTTCC.single.fastq.gzprinseq with fastqc reportstrimnami.out/
├── prinseq
│   ├── A13-04-182-06_TAGCTT.paired.R1.fastq.gz
│   ├── A13-04-182-06_TAGCTT.paired.R2.fastq.gz
│   ├── A13-04-182-06_TAGCTT.paired.S.fastq.gz
│   ├── A13-12-250-06_GGCTAC.paired.R1.fastq.gz
│   ├── A13-12-250-06_GGCTAC.paired.R2.fastq.gz
│   ├── A13-12-250-06_GGCTAC.paired.S.fastq.gz
│   └── A13-135-177-06_AGTTCC.single.fastq.gz
└── reports
    ├── prinseq.fastqc.html
    └── untrimmed.fastqc.htmlprinseq with host removaltrimnami.out/
└── prinseq
    ├── A13-04-182-06_TAGCTT.host_rm.paired.R1.fastq.gz
    ├── A13-04-182-06_TAGCTT.host_rm.paired.R2.fastq.gz
    ├── A13-04-182-06_TAGCTT.host_rm.paired.S.fastq.gz
    ├── A13-12-250-06_GGCTAC.host_rm.paired.R1.fastq.gz
    ├── A13-12-250-06_GGCTAC.host_rm.paired.R2.fastq.gz
    ├── A13-12-250-06_GGCTAC.host_rm.paired.S.fastq.gz
    └── A13-135-177-06_AGTTCC.host_rm.single.fastq.gzprinseq with host removal and subsamplingtrimnami.out/
└── prinseq
    ├── A13-04-182-06_TAGCTT.host_rm.paired.R1.fastq.gz
    ├── A13-04-182-06_TAGCTT.host_rm.paired.R1.subsampled.fastq.gz
    ├── A13-04-182-06_TAGCTT.host_rm.paired.R2.fastq.gz
    ├── A13-04-182-06_TAGCTT.host_rm.paired.R2.subsampled.fastq.gz
    ├── A13-04-182-06_TAGCTT.host_rm.paired.S.fastq.gz
    ├── A13-04-182-06_TAGCTT.host_rm.paired.S.subsampled.fastq.gz
    ├── A13-12-250-06_GGCTAC.host_rm.paired.R1.fastq.gz
    ├── A13-12-250-06_GGCTAC.host_rm.paired.R1.subsampled.fastq.gz
    ├── A13-12-250-06_GGCTAC.host_rm.paired.R2.fastq.gz
    ├── A13-12-250-06_GGCTAC.host_rm.paired.R2.subsampled.fastq.gz
    ├── A13-12-250-06_GGCTAC.host_rm.paired.S.fastq.gz
    ├── A13-12-250-06_GGCTAC.host_rm.paired.S.subsampled.fastq.gz
    ├── A13-135-177-06_AGTTCC.host_rm.single.fastq.gz
    └── A13-135-177-06_AGTTCC.host_rm.single.subsampled.fastq.gz