DILS means Demographic Inferences with Linked Selection.
DILS is a workflow for demographic inference from multilocus DNA sequence data. It uses Approximate Bayesian Computation (ABC) for model comparison, parameter estimation, and goodness-of-fit analyses.
- User manual:
docs/user_manual.md - Cluster/admin deployment guide:
docs/cluster_deployment.md - Streamlit configuration example:
streamlit/settings.example.yaml
DILS can currently be used in two main ways:
- Streamlit web interface: upload a FASTA file, configure an analysis, submit it through Slurm, download the results archive, and inspect outputs in the Results viewer.
- Command-line Snakemake workflow: run the DILS Snakefiles directly with a YAML configuration file.
The repository may still contain the older R/Shiny web interface under webinterface/. It is kept as legacy code and is not the recommended interface for new deployments.
The Streamlit interface lets users:
- submit a DILS analysis;
- monitor Slurm job status;
- download the final
.tar.gzresults archive; - inspect results in the Results viewer;
- read the integrated Help page.
Local launch example:
streamlit run streamlit/app.pyFor configuration, copy and edit:
cp streamlit/settings.example.yaml streamlit/settings.yamlstreamlit/settings.yaml is local configuration and is ignored by Git. Cluster deployment is documented in docs/cluster_deployment.md.
Clone the repository:
git clone https://github.com/popgenomics/DILS.git
cd DILSCreate and activate a Python environment, then install the Streamlit requirements:
python3 -m venv .venv_streamlit
source .venv_streamlit/bin/activate
python -m pip install --upgrade pip
python -m pip install -r streamlit/requirements.txtCreate a local Streamlit settings file:
cp streamlit/settings.example.yaml streamlit/settings.yamlFor local testing, set the runs directory to streamlit_runs:
sed -i 's|runs_root: /path/to/dils_runs|runs_root: streamlit_runs|' streamlit/settings.yamlCheck the configured DILS paths:
grep -n "dils_bin_dir\|snakefile_1pop\|snakefile_2pop" streamlit/settings.yamlExpected output:
dils_bin_dir: bin
snakefile_1pop: bin/Snakefile_1pop
snakefile_2pop: bin/Snakefile_2pop
Check the Streamlit upload limit:
cat .streamlit/config.tomlExpected output:
[server]
maxUploadSize = 10240Launch the interface:
streamlit run streamlit/app.pyNotes:
streamlit/settings.yamlis local and ignored by Git.runs_root: streamlit_runsis for local testing only.- For cluster deployment, use
docs/cluster_deployment.md. - If no bundled example archive is found under
example/, use “Upload .tar.gz” in the Results viewer.
DILS can also be run directly with Snakemake and a YAML configuration file.
1-population analysis:
snakemake --snakefile bin/Snakefile_1pop -p -j 10 --configfile config_1pop.yaml2-population analysis:
snakemake --snakefile bin/Snakefile_2pop -p -j 10 --configfile config_2pop.yamlThe Streamlit interface generates YAML internally. Command-line users should provide their own YAML file.
mail_address: user@example.org
infile: /path/to/input.fas
region: coding
nspecies: 1
nameA: PopulationA
nameOutgroup: NA
lightMode: TRUE
config_yaml: /path/to/config_1pop.yaml
timeStamp: my_1pop_run
max_N_tolerated: 0.2
Lmin: 100
nMin: 6
mu: 0.00000002763
rho_over_theta: 0.5
N_min: 1000
N_max: 500000
Tchanges_min: 100
Tchanges_max: 1000000mail_address: user@example.org
infile: /path/to/input.fas
region: coding
nspecies: 2
nameA: PopulationA
nameB: PopulationB
nameOutgroup: NA
lightMode: TRUE
useSFS: 0
config_yaml: /path/to/config_2pop.yaml
timeStamp: my_2pop_run
population_growth: constant
modeBarrier: bimodal
max_N_tolerated: 0.2
Lmin: 100
nMin: 6
mu: 0.00000002763
rho_over_theta: 0.5
N_min: 1000
N_max: 500000
Tsplit_min: 10000
Tsplit_max: 1750000
M_min: 1
M_max: 40Runtime dependencies depend on whether DILS is used through the Streamlit interface or directly with Snakemake. In general, DILS requires:
- Python;
- PyPy where required by legacy scripts;
- R and required R packages;
- Snakemake;
- Slurm for cluster submission;
- Streamlit dependencies from
streamlit/requirements.txt; - C helper binaries such as
msnsamandRNAseqFGT.
Cluster administrators should use docs/cluster_deployment.md for deployment-specific details.
bin/: DILS Snakemake workflows and analysis scripts.streamlit/: current Streamlit web interface.docs/: user and administrator documentation.example/: example input and results files.webinterface/: legacy R/Shiny interface.msnsam/,RNAseqFGT_src/: C sources and helper binaries.
For scientific background, usage details, and references, see the user manual: