Zilong-Li/lcWGS-imputation-workflow
Imputation workflow for low coverage whole genome sequencing data
Overview
Topics: genotype-imputation low-coverage-sequencing snakemake-workflows
Latest release: None, Last update: 2024-08-12
Linting: linting: passed, 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/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
,bam
anddepth
have to be defined.sampleid
has to be in the header SM tag of correspondingbam
.depth
represents the sequencing coverage of thebam
. Ifdownsample
is defined inconfig/cofing.yaml
, thedepth
is used to calculate the fraction of downsampling. -
Add reference panel information to
config/refpanel.tsv
. For each chromosome, the columnschr
,vcf
,start
andend
have to be defined. Thestart
andend
refer 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 givenchunksize
in theconfig/config.yaml
. One can also use optional columnquilt_chunk
,glimpse_chunk
to specify the chunks from QUILT and GLIMPSE. When making accuracy plots, columntruth
needs to be defined which is a VCF file with truth genotypes of target samples. Optionally, columnaf
can be used to specify the allele frequency of each variable site instead of calculated from the reference panel. Theaf
represents a plain tab separated file of 5 columnschr,pos,ref,alt,af
without header. Also, optional columnquilt_map
,glimpse_map
refers to the genetic map file for QUILT and GLIMPSE respectively. Lastly, optional columnexclude_samples
can be used to remove extra samples in addition to target samples from the reference panel. -
Imputation test on single region. Add
region
column inconfig/refpanel.tsv
which is ofchrom:start-end
form.
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. requirestruth
to 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
None
Formatting results
[DEBUG]
[DEBUG]
<unknown>:1: SyntaxWarning: invalid escape sequence '\/'
<unknown>:1: SyntaxWarning: invalid escape sequence '\/'
<unknown>:1: SyntaxWarning: invalid escape sequence '\/'
<unknown>:1: SyntaxWarning: invalid escape sequence '\/'
<unknown>:1: SyntaxWarning: invalid escape sequence '\/'
[DEBUG]
[DEBUG] In file "/tmp/tmp180y8yyl/workflow/rules/refpanels.smk": Formatted content is different from original
[DEBUG]
[DEBUG]
[DEBUG]
[DEBUG]
[DEBUG]
[INFO] 1 file(s) would be changed 😬
[INFO] 7 file(s) would be left unchanged 🎉
snakefmt version: 0.10.2