Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Laura Denies
PathoFact
Commits
0ab3c9c0
Commit
0ab3c9c0
authored
Apr 29, 2020
by
Valentina Galata
Browse files
added snakemake file to run tests (issue
#33
)
parent
6e16ecf2
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/Snakefile
0 → 100644
View file @
0ab3c9c0
# 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}"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment