alzel/refseq_pipeline
None
Overview
Topics:
Latest release: None, Last update: 2024-08-23
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/alzel/refseq_pipeline . --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
.
Describe how to configure the workflow (using config.yaml and maybe additional files). All of them need to be present with example entries inside of the config folder.
Linting and formatting
Linting results
1Lints for snakefile /tmp/tmpcysasrw2/workflow/Snakefile:
2 * Absolute path "/" + genome + f" in line 21:
3 Do not define absolute paths inside of the workflow, since this renders
4 your workflow irreproducible on other machines. Use path relative to the
5 working directory instead, or make the path configurable via a config
6 file.
7 Also see:
8 https://snakemake.readthedocs.io/en/latest/snakefiles/configuration.html#configuration
9 * Absolute path "/data" in line 109:
10 Do not define absolute paths inside of the workflow, since this renders
11 your workflow irreproducible on other machines. Use path relative to the
12 working directory instead, or make the path configurable via a config
13 file.
14 Also see:
15 https://snakemake.readthedocs.io/en/latest/snakefiles/configuration.html#configuration
16 * Absolute path "/data" in line 129:
17 Do not define absolute paths inside of the workflow, since this renders
18 your workflow irreproducible on other machines. Use path relative to the
19 working directory instead, or make the path configurable via a config
20 file.
21 Also see:
22 https://snakemake.readthedocs.io/en/latest/snakefiles/configuration.html#configuration
23 * Mixed rules and functions in same snakefile.:
24 Small one-liner functions used only once should be defined as lambda
25 expressions. Other functions should be collected in a common module, e.g.
26 'rules/common.smk'. This makes the workflow steps more readable.
27 Also see:
28 https://snakemake.readthedocs.io/en/latest/snakefiles/modularization.html#includes
29 * Path composition with '+' in line 6:
30 This becomes quickly unreadable. Usually, it is better to endure some
31 redundancy against having a more readable workflow. Hence, just repeat
32 common prefixes. If path composition is unavoidable, use pathlib or
33 (python >= 3.6) string formatting with f"...".
34 Also see:
35
36 * Deprecated singularity directive used for container definition in line 110.:
37 Use the container directive instead (it is agnostic of the underlying
38 container runtime).
39 Also see:
40 https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#running-jobs-in-containers
41
42Lints for rule download_genomic (line 78, /tmp/tmpcysasrw2/workflow/Snakefile):
43 * No log directive defined:
44 Without a log directive, all output will be printed to the terminal. In
45 distributed environments, this means that errors are harder to discover.
46 In local environments, output of concurrent jobs will be mixed and become
47 unreadable.
48 Also see:
49 https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#log-files
50 * Specify a conda environment or container for each rule.:
51 This way, the used software for each specific step is documented, and the
52 workflow can be executed on any machine without prerequisites.
53 Also see:
54 https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#integrated-package-management
55 https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#running-jobs-in-containers
56
57Lints for rule download_gff (line 105, /tmp/tmpcysasrw2/workflow/Snakefile):
58 * No log directive defined:
59 Without a log directive, all output will be printed to the terminal. In
60 distributed environments, this means that errors are harder to discover.
61 In local environments, output of concurrent jobs will be mixed and become
62 unreadable.
63 Also see:
64 https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#log-files
65 * Specify a conda environment or container for each rule.:
66 This way, the used software for each specific step is documented, and the
67 workflow can be executed on any machine without prerequisites.
68 Also see:
69 https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#integrated-package-management
70 https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#running-jobs-in-containers
71
72Lints for rule gunzip (line 131, /tmp/tmpcysasrw2/workflow/Snakefile):
73 * No log directive defined:
74 Without a log directive, all output will be printed to the terminal. In
75 distributed environments, this means that errors are harder to discover.
76 In local environments, output of concurrent jobs will be mixed and become
77 unreadable.
78 Also see:
79 https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#log-files
80 * Specify a conda environment or container for each rule.:
81 This way, the used software for each specific step is documented, and the
82 workflow can be executed on any machine without prerequisites.
83 Also see:
84 https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#integrated-package-management
85 https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#running-jobs-in-containers
86
87Lints for rule extract_parts (line 199, /tmp/tmpcysasrw2/workflow/Snakefile):
88 * Migrate long run directives into scripts or notebooks:
89 Long run directives hamper workflow readability. Use the script or
90 notebook directive instead. Note that the script or notebook directive
91 does not involve boilerplate. Similar to run, you will have direct access
92 to params, input, output, and wildcards.Only use the run directive for a
93 handful of lines.
94 Also see:
95 https://snakemake.readthedocs.io/en/latest/snakefiles/rules.html#external-scripts
96 https://snakemake.readthedocs.io/en/latest/snakefiles/rules.html#jupyter-notebook-integration
97
98Lints for rule filter_fasta (line 247, /tmp/tmpcysasrw2/workflow/Snakefile):
99 * No log directive defined:
100 Without a log directive, all output will be printed to the terminal. In
101 distributed environments, this means that errors are harder to discover.
102 In local environments, output of concurrent jobs will be mixed and become
103 unreadable.
104 Also see:
105 https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#log-files
106 * Specify a conda environment or container for each rule.:
107 This way, the used software for each specific step is documented, and the
108 workflow can be executed on any machine without prerequisites.
109 Also see:
110 https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#integrated-package-management
111 https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#running-jobs-in-containers
Formatting results
1[DEBUG]
2[DEBUG] In file "/tmp/tmpcysasrw2/workflow/Snakefile": Formatted content is different from original
3[INFO] 1 file(s) would be changed 😬
4
5snakefmt version: 0.10.2