-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSnakefile
82 lines (67 loc) · 2.18 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
## configuration
# define jar file containing engine programs, by default look
# under the lib/ folder.
LOADER_VER, = glob_wildcards("lib/genemania-{version}-jar-with-dependencies.jar")
if LOADER_VER:
JAR_FILE = "/home/gmbuild/pipeline/lib/genemania-%s-jar-with-dependencies.jar" % (LOADER_VER[0])
else:
print("WARNING: genemania jar not found")
JAR_FILE = "/home/gmbuild/pipeline/lib/genemania.jar"
# we could set a path in the snakefile by:
#
# workdir: "path/to/workdir"
#
# to control data location, but it seems to also
# affect paths to included snakefiles and configs.
# so try configuring by command line options:
#
# e.g. for test run as
#
# snakemake --config test=1
#
if 'test' in config and config['test']:
DATA = 'test/data'
WORK = 'test/work'
RESULT = 'test/result'
else:
DATA = 'data'
WORK = 'work'
RESULT = 'result'
print("DATA folder:", DATA)
print("WORK folder:", WORK)
print("RESULT folder:", RESULT)
## pipeline rules
# set a default rule
rule ALL:
message: "build everything"
input: WORK+"/flags/all.flag"
# connect the last thing currnently in the pipeline to the 'all' flag file
rule ALL_ENGINE_DATA:
input: WORK+"/flags/engine.precombine_networks.flag"
output: WORK+"/flags/all.flag"
shell: "touch {output}"
# generic cleaning rules
rule CLEAN:
shell: "rm -rf {WORK}"
rule VERY_CLEAN:
shell: """rm -rf {WORK}
rm -rf {RESULT}
"""
# load all the snakefiles. when doing merges,
# want to disconnect rules preceeding generic_db
# so include those conditionally, depending on
# argument --config merge=1
include: 'snakefiles/common.snakefile'
if 'merge' in config and config['merge']:
include: 'snakefiles/merge.snakefile'
else:
include: 'snakefiles/identifiers.snakefile'
include: 'snakefiles/generic_db.snakefile'
include: 'snakefiles/functions.snakefile'
include: 'snakefiles/direct_networks.snakefile'
include: 'snakefiles/sharedneighbour_networks.snakefile'
include: 'snakefiles/profiles.snakefile'
include: 'snakefiles/attributes.snakefile'
include: 'snakefiles/network_metadata.snakefile'
include: 'snakefiles/lucene_index.snakefile'
include: 'snakefiles/engine_data.snakefile'