-
Notifications
You must be signed in to change notification settings - Fork 1
/
Snakefile
executable file
·58 lines (45 loc) · 1.98 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
configfile: "config.yaml"
import os
# Network Parameters
NETWORK=config["parameters"]["network_file"]
OUTPATH=config["parameters"]["outpath"]
GENESET=config["parameters"]["geneset_file"]
GENESETB = config["association"]["geneset_B"]
TOPOLOGY = config["topology"]["analyse"]
ASSOCIATION = config["association"]["analyse"]
COMPARISON = config["within_comparison"]["analyse"]
EXTENSIONS=config['figures']['extension']
OUTFIGURES=OUTPATH + config['figures']['outpath']
# The diagnostic folder needs to be made manually because it's not an output
# This is not very snakemake friendly, we apologise
if not os.path.exists(config["parameters"]["diagnostic_folder"]):
os.mkdir(config["parameters"]["diagnostic_folder"])
# If the matrices for the full analysis are not specified, they are generated by the rule
if len(config["parameters"]["sp_matrix"])>0:
SP_MATRIX=config["parameters"]["sp_matrix"]
else:
SP_MATRIX=OUTPATH+"_sp_matrix.hdf5"
if len(config["parameters"]["rwr_matrix"])>0:
RWR_MATRIX=config["parameters"]["rwr_matrix"]
else:
RWR_MATRIX=OUTPATH+"_rwr_matrix.hdf5"
include: "rules/pygna.smk"
include: "rules/pygna_visualise.smk"
rule all:
input:
expand(OUTPATH+"table_topology_{t}.csv", t=TOPOLOGY),
expand(OUTPATH+"table_association_{t}.csv", t=ASSOCIATION),
expand(OUTPATH+"table_within_comparison_{t}.csv", t=COMPARISON),
expand(OUTFIGURES+"barplot_{t}.{e}", t=TOPOLOGY, e=EXTENSIONS),
expand(OUTFIGURES+"heatmap_within_comparison_{t}.{e}", t=COMPARISON, e=EXTENSIONS,),
rule GNT_all:
input:
expand(OUTPATH+"table_topology_{t}.csv", t=TOPOLOGY),
expand(OUTFIGURES+"barplot_{t}.{e}", t=TOPOLOGY, e=EXTENSIONS),
rule GNA_association_all:
input:
expand(OUTPATH+"table_association_{t}.csv", t=ASSOCIATION),
rule GNA_comparison_all:
input:
expand(OUTPATH+"table_within_comparison_{t}.csv", t=ASSOCIATION,n=GENESET),
expand(OUTFIGURES+"heatmap_association_{t}.{e}", t=ASSOCIATION, e=EXTENSIONS)