nh13 / snakemake-pytest

Snakemake with pytest example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Language Actions Status Code Style Type Checked PEP8 License


Snakemake with Pytest example

This demonstrates how to test your Snakefile with pytest. Snakemake will be run in --dryrun mode to verify that the inputs in the all rule can be generated. It will also make sure there are no syntax errors and run linting (--lint). This is done all programatically (no "shelling out")

Caveats

This does not support the checkpoint directive.

This does not support testing on real data and having the rules actually run. This is something you should do. Set the dryrun parameter to False in the call to snakemake.snakemake. Make sure that your input files "make sense" given the workflow you are running. Also make sure any required software is installed or accessible. For example, a small set of reads in a FASTQ as input over a single exon to test variant calling. And then make sure bwa, samtools, and gatk4 are installed.

Installation

conda env create --file src/environment.yml
  • Activate the snakemake-pytest conda environment
conda activate snakemake-pytest
  • Run the integration tests
bash ci/check.sh

About

Snakemake with pytest example


Languages

Language:Python 71.2%Language:Shell 28.8%