Skip to content

Configuration

Pavel V. Dimens edited this page Feb 25, 2022 · 16 revisions

In Snakemake, the most rational way to augment rules/runs is through a config file. This prevents hard-coding rules, and making direct changes to them that may break something. That would be a problem because with Snakemake, breaking something breaks everything.

The config.yml 📝

LepWrap provides an aggressively annotated config.yml for you to replace parameters in as necessary. There are just a handful of parameters to specify, with an explanation for each. In fact, most of the file is annotations/explanations. Only change the parameter values, do not change the parameter names. The snakefiles handle reading all these parameters in accordingly.

Generate a new config file

If you call LepWrap and it doesn't detect the config file in your working directory, it will create one with that name using the defaults as seen in this repository. Easy peasy!

Let's look at the first few lines of the file as an example:

# Configuration file for LepWrap
#########################################################
#                       Lep-Map 3                       #
#########################################################
# change this to false if you want to skip Lep-Map3
run_lepmap: true

    #---- ParentCall2 ----#
# the filtered VCF file with your genotype likelihoods:
vcf: "mydata.vcf"

There's a lot of text, and most of it is annotations (# denote comments in yaml). Since everything happens out of the working directory, you need only to specify a relative path to the files. Personally, I keep the VCF and pedigree files in the working directory, so as to minimize the possibility of typos in path names, but to each their own. If you want to symlink the files instead, you need to use ln -sr, not just ln -s

The remainder of the file reads similarly, so it shouldn't be too difficult to figure out what is what. In the most recent version, you can name this config file whatever you want, just make sure to specify it as the second positional argument like so:

LepWrap 15 haldane.nodistortion.yml