Zilong-Li/array-imputation-workflow
imputation workflow for array data using shapeit2 and impute2
Overview
Latest release: None, Last update: 2024-02-18
Linting: linting: failed, Formatting: formatting: failed
Topics: genotype-imputation snakemake-workflows snp-array
Deployment
Step 1: Install Snakemake and Snakedeploy
Snakemake and Snakedeploy are best installed via the Conda. It is recommended to install conda via Miniforge. Run
conda create -c conda-forge -c bioconda -c nodefaults --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
For other installation methods, refer to the Snakemake and Snakedeploy documentation.
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/Zilong-Li/array-imputation-workflow . --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.
To configure this workflow, modify config/config.yaml according to your needs, following the explanations provided in the file.
There are 5 mandatory columns chr,vcf,phased,trios andgeneticmap needed to be defined in the reference panel sheet. The phased column only validates yes and no string. The trios column defines a path of plink fam file or na. The geneticmapdefines a path of genetic map used by shapeite2 and impute2.
-
refpanel1.tsvis mandatory. Thevcfcan be phased or unphased. This is primarily used as panel for prephasing the chip array data. -
refpanel2.tsvis optional. Thevcfcan be phased or unphased. If this is defined in config.yaml, thenimpute2will use bothrefpanel1andrefpanel2as reference panels.
The chip array genotype data must be in plink formats required by shapeite2. Therefore you must define bed, bim and fam in config.yaml.
Several scenarios are defined in config.yaml. One can choose to run each scenario individually or all.
snakemake -j60 --config scenario=phasing -nLinting and formatting
Linting results
1Traceback (most recent call last):
2 File "/home/runner/micromamba-root/envs/snakemake-workflow-catalog/lib/python3.12/site-packages/snakemake/cli.py", line 1922, in args_to_api
3 any_lint = workflow_api.lint()
4 ^^^^^^^^^^^^^^^^^^^
5 File "/home/runner/micromamba-root/envs/snakemake-workflow-catalog/lib/python3.12/site-packages/snakemake/api.py", line 337, in _handle_no_dag
6 return method(self, *args, **kwargs)
7 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 File "/home/runner/micromamba-root/envs/snakemake-workflow-catalog/lib/python3.12/site-packages/snakemake/api.py", line 354, in lint
9 workflow.include(
10 File "/home/runner/micromamba-root/envs/snakemake-workflow-catalog/lib/python3.12/site-packages/snakemake/workflow.py", line 1391, in include
11 exec(compile(code, snakefile.get_path_or_uri(), "exec"), self.globals)
12 File "/tmp/tmp9ibmeosk/workflow/Snakefile", line 27, in <module>
13 include: "rules/imputation.smk"
14 File "/home/runner/micromamba-root/envs/snakemake-workflow-catalog/lib/python3.12/site-packages/snakemake/workflow.py", line 1391, in include
15 exec(compile(code, snakefile.get_path_or_uri(), "exec"), self.globals)
16 File "/tmp/tmp9ibmeosk/workflow/rules/common.smk", line 25, in <module>
17 vcfDupPos = config["vcf_dupPos"]
18 ~~~~~~^^^^^^^^^^^^^^^
19KeyError: 'vcf_dupPos'
Formatting results
1[DEBUG]
2<unknown>:1: SyntaxWarning: invalid escape sequence '\#'
3<unknown>:1: SyntaxWarning: invalid escape sequence '\#'
4[DEBUG]
5[DEBUG] In file "/tmp/tmp9ibmeosk/workflow/Snakefile": Formatted content is different from original
6[DEBUG]
7[DEBUG] In file "/tmp/tmp9ibmeosk/workflow/rules/merge.smk": Formatted content is different from original
8[DEBUG]
9[DEBUG] In file "/tmp/tmp9ibmeosk/workflow/rules/imputation.smk": Formatted content is different from original
10[DEBUG]
11[INFO] 3 file(s) would be changed 😬
12[INFO] 2 file(s) would be left unchanged 🎉
13
14snakefmt version: 0.10.0