forked from kcajj/recombinant_population_analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSnakefile
62 lines (45 loc) · 1.2 KB
/
Snakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import yaml
import pathlib
import numpy as np
import json
import sys
# check that config file is provided
def check_configfile():
try:
msg = f"""
----------- loading config file -----------
--- run config:
{config["run_config"]}
--- alignments:
{config["alignments"]}
--- HMM_parameters:
{config["HMM_parameters"]}
--- plots
{config["plots"]}
-------------------------------------------
"""
print(msg)
except:
raise Exception(
"config file not specified. Please specify with --configfile flag."
)
check_configfile()
# make create log folder, required for cluster execution
pathlib.Path("log").mkdir(exist_ok=True)
# extract pileup config options
run_config = config["run_config"]
in_fld = run_config["input"].removesuffix("/")
out_fld = run_config["output"].removesuffix("/")
HMM = run_config["HMM"]
# print run options
print("----------- run configuration ------------")
print("input folder:", in_fld)
print("\noutput folder:", out_fld)
print("\nHMM:", json.dumps(HMM, indent=2))
print("------------------------------------------")
include: "rules/HMM.smk"
include: "rules/plots.smk"
rule all:
input:
rules.HMM_all.input,
rules.plot_all.input