-
Notifications
You must be signed in to change notification settings - Fork 2
/
Snakefile_different_thresholds
124 lines (113 loc) · 3.7 KB
/
Snakefile_different_thresholds
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
from signal import NSIG
thresholds = [0.05,0.1,0.2,0.25,0.3,0.35,0.4]
RAW_INPUT_PATH = "data/raw"
N_SIM=10
PICKLE_FILE_NAME = "data/interim_{thr}/pcc.pickle"
SAVE_FIGURES = True
#REPORT_FOLDER = f"reports/reports_{thr}"
#rule clean:
# shell: "rm -rf data/interim/"
rule all:
input:
expand("data/interim_{thr}/sensors_df.csv", thr = thresholds),
"reports/06-Figs3s4.html",
expand(f"data/interim_{{thr}}/pcc_df_random_{N_SIM}.csv", thr = [0.1,0.2,0.3,0.4]),
"reports/07-Figs1.html"
rule read_costanzo_data:
input:
f"{RAW_INPUT_PATH}/Data File S3. Genetic interaction profile similarity matrices/cc_ALL.txt",
f"{RAW_INPUT_PATH}/ontology/SGD_features.tab"
params:
output_path = "data/interim_{thr}",
threshold = lambda wildcards: wildcards.thr
conda:
"enm_snakemake.yml"
output:
"data/interim_{thr}/costanzo_pcc_ALL" ,
"data/interim_{thr}/strain_ids.csv" ,
"data/interim_{thr}/go_background_list"
script: "scripts/read_costanzo_data.py"
rule create_enm_object:
input:
network_file = "data/interim_{thr}/costanzo_pcc_ALL" ,
strain_ids_file = "data/interim_{thr}/strain_ids.csv"
params:
output_path = "data/interim_{thr}",
cluster_matrix = False
conda:
"enm_snakemake.yml"
output:
pickle_file= "data/interim_{thr}/pcc.pickle",
df_filename= "data/interim_{thr}/pcc_df.csv"
script: "scripts/pcc.py"
rule effector_sensor_go:
input:
pickle_file_name= PICKLE_FILE_NAME,
gaf= f"{RAW_INPUT_PATH}/ontology/sgd.gaf",
obo= f"{RAW_INPUT_PATH}/ontology/go-basic.obo",
background_file = "data/interim_{thr}/go_background_list",
sgd_info = f"{RAW_INPUT_PATH}/ontology/SGD_features.tab"
params:
thr = "{thr}"
conda:
"enm_snakemake.yml"
output:
sensors_df_fname = "data/interim_{thr}/sensors_df.csv",
effectors_df_fname = "data/interim_{thr}/effectors_df.csv",
effector_sensor_combined_go_df = "data/interim_{thr}/effector_sensor_combined_go_df.csv"
script: "scripts/effector_sensor_go.py"
rule rewire_network:
input: PICKLE_FILE_NAME
params:
n_sim = N_SIM,
conda:
"enm_snakemake.yml"
output:
pcc_df_random = "data/interim_{thr}/pcc_df_random_{N_SIM}.csv"
script: "scripts/rewiring.py"
rule figs3s4:
input:
inp = [f"data/interim_{thr}/sensors_df.csv" for thr in thresholds]
params:
thr_list = thresholds,
folder_prefix = 'data/interim',
save = SAVE_FIGURES
conda:
"enm_snakemake.yml"
log:
notebook="reports/06-Figs3s4.ipynb"
output:
notebook="reports/06-Figs3s4.ipynb"
notebook:
"notebooks/06-Figs3s4.ipynb"
rule figures3s4_html:
input:
"reports/06-Figs3s4.ipynb"
conda:
"enm_snakemake.yml"
output: "reports/06-Figs3s4.html"
shell: "jupyter nbconvert {input} --to html"
rule figs1:
input:
expand("data/interim_{thr}/pcc_df.csv", thr = [0.1,0.2,0.3,0.4]),
expand(f"data/interim_{{thr}}/pcc_df_random_{N_SIM}.csv", thr=[0.1,0.2,0.3,0.4])
output:
notebook="reports/07-Figs1.html"
params:
thr_list = [0.1,0.2,0.3,0.4],
folder_prefix = 'data/interim',
save = SAVE_FIGURES
script:
"notebooks/07-Figs1.Rmd"
# rule figs2:
# input:
# expand("data/interim_{thr}/sensors_df.csv", thr = thresholds)
# output:
# notebook="reports/06-Figs3s4.ipynb"
# params:
# thr_list = thresholds,
# folder_prefix = 'data/interim'
# conda:
# "enm_snakemake.yml"
# notebook:
# "notebooks/06-Figs3s4.ipynb"