Zilong-Li/lcWGS-imputation-workflow
Imputation workflow for low coverage whole genome sequencing data
Overview
Latest release: None, Last update: 2024-08-12
Linting: linting: passed, Formatting: formatting: failed
Topics: genotype-imputation low-coverage-sequencing snakemake-workflows
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/lcWGS-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.
-
Add samples to
config/samples.tsv. For each sample, the columnssampleid,bamanddepthhave to be defined.sampleidhas to be in the header SM tag of correspondingbam.depthrepresents the sequencing coverage of thebam. Ifdownsampleis defined inconfig/cofing.yaml, thedepthis used to calculate the fraction of downsampling. -
Add reference panel information to
config/refpanel.tsv. For each chromosome, the columnschr,vcf,startandendhave to be defined. Thestartandendrefer to the position of variable SNPs in the reference VCF not for the reference genome, which is used to split the imputation tasks into multiple different chunks givenchunksizein theconfig/config.yaml. One can also use optional columnquilt_chunk,glimpse_chunkto specify the chunks from QUILT and GLIMPSE. When making accuracy plots, columntruthneeds to be defined which is a VCF file with truth genotypes of target samples. Optionally, columnafcan be used to specify the allele frequency of each variable site instead of calculated from the reference panel. Theafrepresents a plain tab separated file of 5 columnschr,pos,ref,alt,afwithout header. Also, optional columnquilt_map,glimpse_maprefers to the genetic map file for QUILT and GLIMPSE respectively. Lastly, optional columnexclude_samplescan be used to remove extra samples in addition to target samples from the reference panel. -
Imputation test on single region. Add
regioncolumn inconfig/refpanel.tsvwhich is ofchrom:start-endform.
Modify the list of downsample in config/config.yaml.
Modify the list of refsize in config/config.yaml. In default refsize=[0], all samples in the reference panel excluding the target samples in config/samples.tsv are used.
Modify the variable scenario in config/config.yaml to decide what analyses to run.
-
all: run all comparisions across all programs and settings. requirestruthto be configured. -
speed: run only speed comparisons across all programs and settings. -
quilt1: run onlyQUILT. -
quilt2: run onlyQUILT2, which is the default. -
glimpse1: run onlyGLIMPSE. -
glimpse2: run onlyGLIMPSE2.
Linting and formatting
Linting results
All tests passed!
Formatting results
1[DEBUG]
2[DEBUG]
3<unknown>:1: SyntaxWarning: invalid escape sequence '\/'
4<unknown>:1: SyntaxWarning: invalid escape sequence '\/'
5<unknown>:1: SyntaxWarning: invalid escape sequence '\/'
6<unknown>:1: SyntaxWarning: invalid escape sequence '\/'
7<unknown>:1: SyntaxWarning: invalid escape sequence '\/'
8[DEBUG]
9[DEBUG] In file "/tmp/tmp180y8yyl/workflow/rules/refpanels.smk": Formatted content is different from original
10[DEBUG]
11[DEBUG]
12[DEBUG]
13[DEBUG]
14[DEBUG]
15[INFO] 1 file(s) would be changed 😬
16[INFO] 7 file(s) would be left unchanged 🎉
17
18snakefmt version: 0.10.2