young5454/ABComp
ABComp : Assembly Polishing and Bacterial Whole-genome Comparison Pipeline for Multi-group Clinical Isolates
Overview
Topics:
Latest release: None, Last update: 2024-12-07
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/young5454/ABComp . --tag None
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
.
ABComp requires two configuration files for running the pipeline. These yaml files can be found in the config/
directory.
config.yml
is a default configuration setting for the overall Snakemake run. Make sure you specify the correct parameters and directory names of your preference.
groups_original.yml
is a configuration file for the complete group-strain information of your clinical isolates. Below is an example yaml file of a 2-group, 5-strain setting :
NONMDR:
- B0112
- C0234
- C3455
MDR:
- B0232
- D0991
Linting and formatting
Linting results
Lints for snakefile /tmp/tmpf06e0zdf/workflow/Snakefile:
* Path composition with '+' in line 82:
This becomes quickly unreadable. Usually, it is better to endure some
redundancy against having a more readable workflow. Hence, just repeat
common prefixes. If path composition is unavoidable, use pathlib or
(python >= 3.6) string formatting with f"...".
Lints for rule polypolish (line 366, /tmp/tmpf06e0zdf/workflow/Snakefile):
* Param path is a prefix of input or output file but hardcoded:
If this is meant to represent a file path prefix, it will fail when
running workflow in environments without a shared filesystem. Instead,
provide a function that infers the appropriate prefix from the input or
output file, e.g.: lambda w, input: os.path.splitext(input[0])[0]
Also see:
https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#non-file-parameters-for-rules
https://snakemake.readthedocs.io/en/stable/tutorial/advanced.html#tutorial-input-functions
Lints for rule busco (line 412, /tmp/tmpf06e0zdf/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/tmpf06e0zdf/workflow/Snakefile": Formatted content is different from original
[INFO] 1 file(s) would be changed 😬
snakefmt version: 0.10.2