Commit 0ab3c9c0 authored by Valentina Galata's avatar Valentina Galata
Browse files

added snakemake file to run tests (issue #33)

parent 6e16ecf2
# Test workflow: complete PathoFact pipeline + result checks
##################################################
# Configuration
# Config file
CONFIG = "test/test_config.yaml"
configfile: CONFIG
# Libs
import os
import sys
import pandas
##################################################
# Sub-workflows
# PathoFact
subworkflow pathofact:
workdir:
"../"
snakefile:
"../Snakefile"
configfile:
CONFIG
##################################################
# Targets
# PathoFact
PF = pathofact(
expand(
[
"{OUTDIR}/{project}/AMR_MGE_prediction_{input_file}_report.tsv",
"{OUTDIR}/{project}/Toxin_gene_library_{input_file}_report.tsv",
"{OUTDIR}/{project}/Toxin_prediction_{input_file}_report.csv",
"{OUTDIR}/{project}/Virulence_prediction_{input_file}_report.csv",
"{OUTDIR}/{project}/PathoFact_{input_file}_predictions.csv"
],
OUTDIR=config["OUTDIR"],
project=config["project"],
input_file=config["input_file"]
)
)
# Checks
CHECKS = expand(
[
"{OUTDIR}/{project}/AMR_MGE_prediction_{input_file}_report.tsv.checked",
"{OUTDIR}/{project}/Toxin_gene_library_{input_file}_report.tsv.checked",
"{OUTDIR}/{project}/Toxin_prediction_{input_file}_report.csv.checked",
"{OUTDIR}/{project}/Virulence_prediction_{input_file}_report.csv.checked",
"{OUTDIR}/{project}/PathoFact_{input_file}_predictions.csv.checked"
],
OUTDIR=config["OUTDIR"],
project=config["project"],
input_file=config["input_file"]
)
##################################################
# Rules
# All
rule all:
input:
# PathoFact
PF,
# Result checks
CHECKS
# Compare files
rule:
input:
exp="{OUTDIR}/{project}/{{bname}}".format(
OUTDIR=config["OUTDIR_test"], project=config["project_test"]
),
res="{OUTDIR}/{project}/{{bname}}".format(
OUTDIR=config["OUTDIR"], project=config["project"]
)
output:
"{OUTDIR}/{project}/{{bname}}.checked".format(
OUTDIR=config["OUTDIR"], project=config["project"]
)
log:
"{OUTDIR}/{project}/{{bname}}.diff".format(
OUTDIR=config["OUTDIR"], project=config["project"]
)
shell:
"diff {input.exp} {input.res} > {log} && [ -s {log} ] || touch {output}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment