niekwit/cut_and_run
Snakemake workflow for Cut & Run
Overview
Topics: bioinformatics ngs-analysis snakemake snakemake-workflow
Latest release: v0.5.0, Last update: 2024-06-17
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/niekwit/cut_and_run . --tag v0.5.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
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
1/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/scripts/general_functions.smk:139: SyntaxWarning: invalid escape sequence '\d'
2 if not re.match(".*_[\d]$", sample):
3/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/scripts/general_functions.smk:210: SyntaxWarning: invalid escape sequence '\d'
4 conditions = list(set(re.sub("_[\d]$", "", x) for x in csv["sample"].tolist()))
5Traceback (most recent call last):
6
7 File "/home/runner/micromamba-root/envs/snakemake-workflow-catalog/lib/python3.12/site-packages/snakemake/cli.py", line 1986, in args_to_api
8 any_lint = workflow_api.lint()
9 ^^^^^^^^^^^^^^^^^^^
10
11 File "/home/runner/micromamba-root/envs/snakemake-workflow-catalog/lib/python3.12/site-packages/snakemake/api.py", line 337, in _handle_no_dag
12 return method(self, *args, **kwargs)
13 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
15 File "/home/runner/micromamba-root/envs/snakemake-workflow-catalog/lib/python3.12/site-packages/snakemake/api.py", line 354, in lint
16 workflow.include(
17
18 File "/home/runner/micromamba-root/envs/snakemake-workflow-catalog/lib/python3.12/site-packages/snakemake/workflow.py", line 1398, in include
19 exec(compile(code, snakefile.get_path_or_uri(), "exec"), self.globals)
20
21 File "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/Snakefile", line 32, in <module>
22 PEAK_MODE = peak_mode()
23 ^^^^^^^^^^^
24
25 File "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/scripts/general_functions.smk", line 156, in samples
26 raise ValueError(f"Following files not found:\n{not_found}")
27
28ValueError: Following files not found:
29reads/WT_1_R1_001.fastq.gz
30reads/WT_1_R2_001.fastq.gz
31reads/WT_2_R1_001.fastq.gz
32reads/WT_2_R2_001.fastq.gz
Formatting results
1[DEBUG]
2[WARNING] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/Snakefile": Keyword "input" at line 48 has comments under a value.
3 PEP8 recommends block comments appear before what they describe
4(see https://www.python.org/dev/peps/pep-0008/#id30)
5[DEBUG] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/Snakefile": Formatted content is different from original
6[DEBUG]
7[DEBUG] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/trimming.smk": Formatted content is different from original
8[DEBUG]
9[DEBUG] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/plotting.smk": Formatted content is different from original
10[DEBUG]
11[DEBUG] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/deduplication.smk": Formatted content is different from original
12[DEBUG]
13[WARNING] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/peaks.smk": Keyword "output" at line 15 has comments under a value.
14 PEP8 recommends block comments appear before what they describe
15(see https://www.python.org/dev/peps/pep-0008/#id30)
16[WARNING] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/peaks.smk": Keyword "output" at line 72 has comments under a value.
17 PEP8 recommends block comments appear before what they describe
18(see https://www.python.org/dev/peps/pep-0008/#id30)
19[WARNING] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/peaks.smk": Keyword "output" at line 133 has comments under a value.
20 PEP8 recommends block comments appear before what they describe
21(see https://www.python.org/dev/peps/pep-0008/#id30)
22[WARNING] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/peaks.smk": Keyword "output" at line 190 has comments under a value.
23 PEP8 recommends block comments appear before what they describe
24(see https://www.python.org/dev/peps/pep-0008/#id30)
25[WARNING] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/peaks.smk": Keyword "output" at line 247 has comments under a value.
26 PEP8 recommends block comments appear before what they describe
27(see https://www.python.org/dev/peps/pep-0008/#id30)
28[WARNING] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/peaks.smk": Keyword "output" at line 299 has comments under a value.
29 PEP8 recommends block comments appear before what they describe
30(see https://www.python.org/dev/peps/pep-0008/#id30)
31[WARNING] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/peaks.smk": Keyword "shell" at line 314 has comments under a value.
32 PEP8 recommends block comments appear before what they describe
33(see https://www.python.org/dev/peps/pep-0008/#id30)
34[DEBUG] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/peaks.smk": Formatted content is different from original
35[DEBUG]
36[WARNING] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/mapping.smk": Keyword "shell" at line 34 has comments under a value.
37 PEP8 recommends block comments appear before what they describe
38(see https://www.python.org/dev/peps/pep-0008/#id30)
39[WARNING] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/mapping.smk": Keyword "shell" at line 108 has comments under a value.
40 PEP8 recommends block comments appear before what they describe
41(see https://www.python.org/dev/peps/pep-0008/#id30)
42[DEBUG] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/mapping.smk": Formatted content is different from original
43[DEBUG]
44[DEBUG] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/bigwig.smk": Formatted content is different from original
45[DEBUG]
46[WARNING] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/resources.smk": Keyword "shell" at line 51 has comments under a value.
47 PEP8 recommends block comments appear before what they describe
48(see https://www.python.org/dev/peps/pep-0008/#id30)
49[DEBUG] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/resources.smk": Formatted content is different from original
50[DEBUG]
51[DEBUG] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/deeptools.smk": Formatted content is different from original
52[DEBUG]
53[DEBUG] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/fastqc.smk": Formatted content is different from original
54[DEBUG]
55[DEBUG] In file "/tmp/tmpyuafcsbn/niekwit-cut_and_run-dd734ee/workflow/rules/scale_factors.smk": Formatted content is different from original
56[INFO] 11 file(s) would be changed 😬
57
58snakefmt version: 0.10.2