richardstoeckl/QCforSeqCode
Snakemake Pipeline to check the requirements for a prokaryotic assembly to be included in the SeqCode initiative
Overview
Topics:
Latest release: v1.0.2, Last update: 2024-12-05
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/richardstoeckl/QCforSeqCode . --tag v1.0.2
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
.
Here is a rough overview:
- Install conda (mamba or miniconda is fine).
- Install snakemake with:
conda install -c conda-forge -c bioconda snakemake
- Download checkm2 database (via
wget https://zenodo.org/api/files/fd3bc532-cd84-4907-b078-2e05a1e46803/checkm2_database.tar.gz
) - Download GTDB-Tk database (via
wget https://data.gtdb.ecogenomic.org/releases/release220/220.0/auxillary_files/gtdbtk_package/full_package/gtdbtk_r220_data.tar.gz
) - Download the latest release from this repo and cd into it
- Edit the
config/config.yaml
to provide the paths to your results/logs directories, and the paths to the databases you downloaded, as well as any parameters you might want to change. - Edit the
config/sampleData.csv
file with the specific details for each assembly you want to check. Depending on what you enter here, the pipeline will automatically adjust what will be done.
To configure this workflow, modify config/config.yaml
according to your needs, following the explanations provided in the file.
Here you should provide the paths to your intermediary/results/logs directories. The interim
directory will contain larger intermediary files. The results
directory will contain the final output of the pipeline. The log
directory will be used to store the log files for each step.
Here you should also write the name of your sample data file (see relevant section below).
Here you should give the paths to the databases needed for some of the tools.
The setup of the samples is specified via comma-separated values files (.csv
).
You can use the config/sampleData.csv
file as a template.
Linting and formatting
Linting results
Lints for snakefile /tmp/tmp5esooj2s/richardstoeckl-QCforSeqCode-68d7f93/workflow/Snakefile:
* Mixed rules and functions in same snakefile.:
Small one-liner functions used only once should be defined as lambda
expressions. Other functions should be collected in a common module, e.g.
'rules/common.smk'. This makes the workflow steps more readable.
Also see:
https://snakemake.readthedocs.io/en/latest/snakefiles/modularization.html#includes
Lints for rule seqkit_stats (line 40, /tmp/tmp5esooj2s/richardstoeckl-QCforSeqCode-68d7f93/workflow/Snakefile):
* No log directive defined:
Without a log directive, all output will be printed to the terminal. In
distributed environments, this means that errors are harder to discover.
In local environments, output of concurrent jobs will be mixed and become
unreadable.
Also see:
https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#log-files
Lints for rule collectAssemblies (line 57, /tmp/tmp5esooj2s/richardstoeckl-QCforSeqCode-68d7f93/workflow/Snakefile):
* No log directive defined:
Without a log directive, all output will be printed to the terminal. In
... (truncated)
Formatting results
[DEBUG]
[DEBUG] In file "/tmp/tmp5esooj2s/richardstoeckl-QCforSeqCode-68d7f93/workflow/Snakefile": Formatted content is different from original
[INFO] 1 file(s) would be changed 😬
snakefmt version: 0.10.2