cmc-aau/nanopore_16Samp
Snakemake workflow to process 16S nanopore amplicon sequences (of any length) and produce an abundance table including taxonomy
Overview
Topics:
Latest release: v2.0.5, Last update: 2024-08-26
Linting: linting: failed, Formatting:formatting: failed
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/cmc-aau/nanopore_16Samp . --tag v2.0.5
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
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
.
-
input_dir
: The input folder is expected to contain a subfolder for each sampleID/barcode, then all fastq files in each subfolder are concatenated and the folder name is used as sample ID downstream. This is usually the "fastq_pass" folder from nanopore sequencing and basecalling output -
output_dir
: Output directory with the final results -
tmp_dir
: Directory for temporary files -
log_dir
: Directory for log files for all rules -
db_fasta
: Database for minimap2 in fasta file format. Each sequence header must only contain an ID matching the taxonomy file below, nothing else. -
db_tax
: 2-column TSV file with corresponding taxonomy for each sequence in the above fasta file. The first column is for the sequence IDs, the second a semi-colon separated taxonomy string. -
minalignlen
: Minimum alignment length for the mapping. Any alignments shorter than this threshold will be filtered -
minIDfrac
: Minimum identity threshold of each mapping (value must be between0.0-1.0
). Any alignments with an identity lower than this threshold will be filtered. -
filtlong_args
: Arguments passed on to thefiltlong
command for pre-filtering reads -
max_threads
: Max number of threads for any rule
Have a look in the .test
directory for example files.
If you want to use the SILVA database, you can use this R script to create the two requires database files. For the MiDAS database the files can be downloaded directly from download section on the website.
Linting and formatting
Linting results
Traceback (most recent call last):
File "/home/runner/micromamba-root/envs/snakemake-workflow-catalog/lib/python3.12/site-packages/snakemake/cli.py", line 2024, in args_to_api
any_lint = workflow_api.lint()
^^^^^^^^^^^^^^^^^^^
File "/home/runner/micromamba-root/envs/snakemake-workflow-catalog/lib/python3.12/site-packages/snakemake/api.py", line 337, in _handle_no_dag
return method(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/micromamba-root/envs/snakemake-workflow-catalog/lib/python3.12/site-packages/snakemake/api.py", line 354, in lint
workflow.include(
File "/home/runner/micromamba-root/envs/snakemake-workflow-catalog/lib/python3.12/site-packages/snakemake/workflow.py", line 1412, in include
exec(compile(code, snakefile.get_path_or_uri(), "exec"), self.globals)
File "/tmp/tmp16k5p49e/cmc-aau-nanopore_16Samp-9978980/workflow/Snakefile", line 17, in <module>
]
... (truncated)
Formatting results
[DEBUG]
[DEBUG] In file "/tmp/tmp16k5p49e/cmc-aau-nanopore_16Samp-9978980/workflow/rules/05-mapping_overview.smk": Formatted content is different from original
[DEBUG]
[DEBUG] In file "/tmp/tmp16k5p49e/cmc-aau-nanopore_16Samp-9978980/workflow/rules/04-map2db.smk": Formatted content is different from original
[DEBUG]
[DEBUG] In file "/tmp/tmp16k5p49e/cmc-aau-nanopore_16Samp-9978980/workflow/rules/03-checksum_fq_headers.smk": Formatted content is different from original
[DEBUG]
[DEBUG] In file "/tmp/tmp16k5p49e/cmc-aau-nanopore_16Samp-9978980/workflow/rules/02-qfilter.smk": Formatted content is different from original
[DEBUG]
[DEBUG] In file "/tmp/tmp16k5p49e/cmc-aau-nanopore_16Samp-9978980/workflow/rules/01-cat_fastq.smk": Formatted content is different from original
[DEBUG]
[DEBUG] In file "/tmp/tmp16k5p49e/cmc-aau-nanopore_16Samp-9978980/workflow/rules/06-abund_table.smk": Formatted content is different from original
[DEBUG]
[DEBUG] In file "/tmp/tmp16k5p49e/cmc-aau-nanopore_16Samp-9978980/workflow/Snakefile": Formatted content is different from original
[INFO] 7 file(s) would be changed 😬
snakefmt version: 0.10.2