We 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:
Fastp
Prinseq++
BBtools for Round A/B viral metagenomics
Filtlong + Rasusa for longreads
Install
Trimnami is still in development but can be easily installed with pip:
Easy install
pip install trimnami
Developer install
git clone https://github.com/beardymcjohnface/Trimnami.git
cd Trimnami/
pip install -e .
Test
Trimnami comes with inbuilt tests which you can run to check everything works fine.
# test fastp only (default method)
trimnami test
# test all SR methods
trimnami test fastp prinseq roundAB
# test all SR methods with host removal
trimnami testhost fastp prinseq roundAB
# test nanopore method (with host removal)
trimnami testnp
Usage
Trim reads with Fastp or Prinseq++
# Fastp (default)
trimnami run --reads reads/
# Prinseq++
trimnami run --reads reads/ prinseq
# Why not both!
trimnami run --reads reads/ fastp prinseq
Include host removal
trimnami run --reads reads/ --host host_genome.fasta
Longreads with host removal.
Specify ‘nanopore’ for targets and use the appropriate minimap preset.
You can customise the trimming parameters via the config file.
Copy the default config file.
trimnami config
Then edit the config file trimnami.out/trimnami.config.yaml in your favourite text editor.
Run trimnami like normal, or point to your custom config file if you’ve moved it.
trimnami run ... --configfile /my/awesome/config.yaml
Outputs
Trimmed reads will be saved in various subfolders in the output directory.
e.g. if trimming with Fastp or Prinseq++,
trimmed reads will be in trimnami.out/fastp/ or trimnami.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 in trimnami.out/reports/
Trim lots of metagenomics samples all at once.
Motivation
We 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:
Install
Trimnami is still in development but can be easily installed with pip:
Easy install
Developer install
Test
Trimnami comes with inbuilt tests which you can run to check everything works fine.
Usage
Trim reads with Fastp or Prinseq++
Include host removal
Longreads with host removal. Specify ‘nanopore’ for targets and use the appropriate minimap preset.
Parsing samples with
--readsYou can pass either a directory of reads or a TSV file to
--reads.More information and examples here
Configure trimming parameters
You can customise the trimming parameters via the config file. Copy the default config file.
Then edit the config file
trimnami.out/trimnami.config.yamlin your favourite text editor. Run trimnami like normal, or point to your custom config file if you’ve moved it.Outputs
Trimmed reads will be saved in various subfolders in the output directory. e.g. if trimming with Fastp or Prinseq++, trimmed reads will be in
trimnami.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 outputs
Click to expand
prinseq
prinseq with fastqc reports
prinseq with host removal
prinseq with host removal and subsampling