xin-huang/selscape

Snakemake Workflow for Investigating Genomic Landscapes of Natural Selection

Overview

Latest release: v1.0.0, Last update: 2026-05-16

Share link: https://snakemake.github.io/snakemake-workflow-catalog?wf=xin-huang/selscape

Quality control: linting: failed formatting: failed

Topics: balancing-selection distribution-of-fitness-effects natural-selection population-genomics positive-selection

Deployment

Step 1: Install Snakemake and Snakedeploy

Snakemake and Snakedeploy are best installed via the Conda package manager. 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/xin-huang/selscape . --tag v1.0.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 using apptainer/singularity, use

snakemake --cores all --sdm apptainer

To run the workflow using a combination of conda and apptainer/singularity for software deployment, use

snakemake --cores all --sdm conda apptainer

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.

Configuration

Please use the template main.yaml, selscan.yaml, scikit-allel.yaml, betascan.yaml, and dadi-cli.yaml to customize the workflow to your dataset. Configuration instructions can be found in the Configuration section of the manual.

Workflow parameters

The following table is automatically parsed from the workflow’s config.schema.y(a)ml file.

Parameter

Type

Description

Required

Default

species

string

Species name

yes

tax_id

integer

NCBI taxonomy ID

yes

ref_genome

string

Reference genome build (e.g., hg38)

yes

anc_alleles

[‘object’, ‘null’]

Ancestral allele information for polarization

. path

string

Base folder for ancestral allele information

. prefix

string

Ancestral allele information filename prefix

genome_annotation

string

Path to genome annotation GTF file

gene2go

string

Path to gene2go mapping file

hwe_pvalue

number

Hardy-Weinberg equilibrium p-value threshold

yes

0.001

rmsk

[‘string’, ‘null’]

Path to repeat masker BED file

seg_dup

[‘string’, ‘null’]

Path to segmental duplications BED file

sim_rep

[‘string’, ‘null’]

Path to simple repeats BED file

ploidy

integer

Organism ploidy

yes

populations

array

List of population IDs to analyze

yes

data_folder

string

Base folder for input VCF files

yes

vcf_prefix

string

VCF filename prefix

yes

vcf_suffix

string

VCF filename suffix

yes

metadata

string

Path to sample metadata file

yes

chromosomes

array

List of chromosomes to analyze

yes

betascan_config

string

Path to BetaScan configuration file

yes

selscan_config

string

Path to selscan configuration file

yes

dadi_config

string

Path to dadi-cli configuration file

yes

scikit_allel_config

string

Path to scikit-allel configuration file

yes

Linting and formatting

Linting results
1KeyError in file "/tmp/tmp6r6w02sz/xin-huang-selscape-129efc2/workflow/rules/common.smk", line 33:
2'selscan_config'
3  File "/tmp/tmp6r6w02sz/xin-huang-selscape-129efc2/workflow/rules/common.smk", line 33, in <module>
Formatting results
 1[DEBUG] 
 2[DEBUG] In file "/tmp/tmp6r6w02sz/xin-huang-selscape-129efc2/workflow/rules/5.2_balancing_selection_scikit-allel.smk":  Formatted content is different from original
 3[DEBUG] 
 4[DEBUG] In file "/tmp/tmp6r6w02sz/xin-huang-selscape-129efc2/workflow/rules/4.1_positive_selection_selscan.smk":  Formatted content is different from original
 5[DEBUG] 
 6[DEBUG] In file "/tmp/tmp6r6w02sz/xin-huang-selscape-129efc2/workflow/rules/2_preprocess.smk":  Formatted content is different from original
 7[DEBUG] 
 8[DEBUG] In file "/tmp/tmp6r6w02sz/xin-huang-selscape-129efc2/workflow/rules/4.4_positive_selection_scikit-allel_xp.smk":  Formatted content is different from original
 9[DEBUG] 
10[DEBUG] In file "/tmp/tmp6r6w02sz/xin-huang-selscape-129efc2/workflow/rules/5.1_balancing_selection_betascan.smk":  Formatted content is different from original
11[DEBUG] 
12[DEBUG] 
13[DEBUG] In file "/tmp/tmp6r6w02sz/xin-huang-selscape-129efc2/workflow/rules/4.3_positive_selection_scikit-allel.smk":  Formatted content is different from original
14[DEBUG] 
15[DEBUG] In file "/tmp/tmp6r6w02sz/xin-huang-selscape-129efc2/workflow/rules/3_polarization.smk":  Formatted content is different from original
16[DEBUG] 
17[DEBUG] In file "/tmp/tmp6r6w02sz/xin-huang-selscape-129efc2/workflow/rules/common.smk":  Formatted content is different from original
18[DEBUG] 
19<unknown>:2: SyntaxWarning: invalid escape sequence '\('
20[DEBUG] In file "/tmp/tmp6r6w02sz/xin-huang-selscape-129efc2/workflow/rules/6_deleterious_dfe_dadi.smk":  Formatted content is different from original
21[DEBUG] 
22[DEBUG] In file "/tmp/tmp6r6w02sz/xin-huang-selscape-129efc2/workflow/Snakefile":  Formatted content is different from original
23[DEBUG] 
24[DEBUG] In file "/tmp/tmp6r6w02sz/xin-huang-selscape-129efc2/workflow/rules/4.2_positive_selection_selscan_xp.smk":  Formatted content is different from original
25[INFO] 11 file(s) would be changed 😬
26[INFO] 1 file(s) would be left unchanged 🎉
27
28snakefmt version: 0.11.5