KasperSkytte/snakemake_usearch

None

Overview

Latest release: v1.1.0, Last update: 2025-08-28

Linting: linting: passed, Formatting: formatting: passed

Deployment

Step 1: Install Snakemake and Snakedeploy

Snakemake and Snakedeploy are best installed via the Mamba package manager (a drop-in replacement for conda). If you have neither Conda nor Mamba, it is recommended to install Miniforge. More details regarding Mamba can be found here.

When using Mamba, run

mamba create -c conda-forge -c bioconda --name snakemake snakemake snakedeploy

to install both Snakemake and Snakedeploy in an isolated environment. For all following commands ensure that this environment is activated via

conda activate snakemake

Step 2: Deploy workflow

With Snakemake and Snakedeploy installed, the workflow can be deployed as follows. First, create an appropriate project working directory on your system and enter it:

mkdir -p path/to/project-workdir
cd path/to/project-workdir

In all following steps, we will assume that you are inside of that directory. Then run

snakedeploy deploy-workflow https://github.com/KasperSkytte/snakemake_usearch . --tag v1.1.0

Snakedeploy will create two folders, workflow and config. The former contains the deployment of the chosen workflow as a Snakemake module, the latter contains configuration files which will be modified in the next step in order to configure the workflow to your needs.

Step 3: Configure workflow

To configure the workflow, adapt config/config.yml to your needs following the instructions below.

Step 4: Run workflow

The deployment method is controlled using the --software-deployment-method (short --sdm) argument.

To run the workflow with automatic deployment of all required software via conda/mamba, use

snakemake --cores all --sdm conda

To run the workflow using apptainer/singularity, use

snakemake --cores all --sdm apptainer

To run the workflow using a combination of conda and apptainer/singularity for software deployment, use

snakemake --cores all --sdm conda apptainer

Snakemake will automatically detect the main Snakefile in the workflow subfolder and execute the workflow module that has been defined by the deployment in step 2.

For further options such as cluster and cloud execution, see the docs.

Step 5: Generate report

After finalizing your data analysis, you can automatically generate an interactive visual HTML report for inspection of results together with parameters and code inside of the browser using

snakemake --report report.zip

Configuration

The following section is imported from the workflow’s config/README.md.

Configuration

The configuration file config.yaml is used to set various options used throughout the workflow.

Option

Default value

Description

input_dir

"data/"

The input folder is expected to contain a subfolder for each sampleID/barcode, in which all fastq files will be concatenated, and the subfolder names used as sample IDs downstream. For nanopore this is usually the “fastq_pass” folder with demultiplexed reads.

output_dir

"output"

Folder for the results.

tmp_dir

"tmp"

Folder for temporary files, which are deleted by default after a succesful run.

log_dir

"logs"

Folder for logs for each rule.

db_sintax

"/databases/midas/MiDAS5.3_20240320/FLASVs_w_sintax.fa"

Path to the taxonomic reference database used to classify the ASVs/zOTUs in SINTAX format.

filtlong_args

"--min_length 200 --min_mean_q 90"

Arguments for the filtlong command used for pre-filtering. To skip filtering altogether set to "--min_length 1".

max_threads

32

Max number of threads to use for any individual rule.

sample_sep

"_"

Separator used for the usearch -otutab and fastx_relabel commands.

primers

AGRGTTYGATYMTGGCTCAG...GTTTGGCACCTCGATGTCG"

Primer pair used. Passed on as-is to the cutadapt command. This is required for trimming and orienting reads correctly.

derep_minsize

2

Minimum abundance of each read. This is only to speed up ASV/zOTU generation, it will not impact abundance estimation.

unoise_minsize

8

Increase this proportionally with platform error-rate to avoid false-positive de-novo ASVs/zOTUs. Never set to anything lower than 2 (or derep_minsize) to ensure that singletons are removed.

rarefy_abund_table

False

Whether to also produce a rarefied abundance table or not.

rarefy_sample_size

2000

Rarefy abundance table to an equal sample size. Both a rarefied and an unrarefied abundance table will be generated.

Have a look in the .test directory for minimal example files.

Linting and formatting

Linting results

All tests passed!

Formatting results

All tests passed!