forked from popsim-consortium/analysis2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snakefile
98 lines (71 loc) · 1.85 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
"""
Snakefile for running analysis 2 on stdpopsim.
Simply running snakemake -c all within this directory will run all analysis
defined by the modules below.
To run a single module (e.g. n_t workflow) one can do
snakemake -c 1 --snakefile workflows/n_t.snake --dry-run
Parameters are defined by the config.yaml file in
workflows/config/snakemake/
"""
configfile: "workflows/config/snakemake/tiny_config.yaml"
module simulation_workflow:
snakefile:
"workflows/simulation.snake"
config:
config
use rule * from simulation_workflow as simulation_*
module dfe_workflow:
snakefile:
"workflows/dfe.snake"
config:
config
use rule * from dfe_workflow as dfe_*
module n_t_workflow:
snakefile:
"workflows/n_t.snake"
config:
config
use rule * from n_t_workflow as n_t_*
localrules:
n_t_download_genetic_map,
n_t_download_msmc,
n_t_sp_download,
n_t_clone_smcpp,
n_t_gone_clone,
n_t_gone_copy,
n_t_gone_params,
output_dir = os.path.abspath(config["output_dir"])
# Define a new default target that collects all the targets from the modules.
rule all:
input:
rules.simulation_all.input,
rules.dfe_all.input,
rules.n_t_all.input,
# rules
default_target: True
rule clean_ext:
shell:
"""
rm -rf ext/GONE/ ext/grapes/ ext/stairwayplot/ ext/msmc/
rm -rf ext/stairwayplot
rm -rf ext/polyDFE
"""
rule clean_output:
shell:
"""
rm -rf {output_dir}
"""
rule clean_all:
input:
rules.clean_ext.input,
rules.clean_output.input,
#rules
message:
"Cleaning all"
shell:
"""
rm -rf ext/GONE/ ext/grapes/ ext/stairwayplot/ ext/msmc/
rm -rf ext/stairwayplot
rm -rf ext/polyDFE
rm -rf {output_dir}
"""