Skip to content

Commit 6a04361

Browse files
committed
added ratio as parameter
1 parent 872f829 commit 6a04361

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

main.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def main():
8383
namespace = ["molecular_function", "biological_process", "cellular_component"]
8484
sample_size = 1000
8585
repeats = 1
86+
ratio = 100
8687
new_random_lists = True
8788
print_graphs = True
8889
no_inferred_edges = False
@@ -180,12 +181,17 @@ def main():
180181
# "HypergeometricDistributionV2": HypergeometricDistributionV2,
181182
"HypergeometricDistributionV3": HypergeometricDistributionV3,
182183
# "RandomWalk": RandomWalk,
183-
"RandomWalkV2": RandomWalkV2,
184+
# "RandomWalkV2": RandomWalkV2,
184185
# "RandomWalkV3": RandomWalkV3,
185186
# "RandomWalkV4": RandomWalkV4, #need protein-only network
186187
# "RandomWalkV5": RandomWalkV5, #need protein-goterm only network
187188
}
188189

190+
# for PW paper, we used OneHopGODegree, ProteinDegreeV3, HypergeometricDistributionV3, and RandomWalkV2
191+
# with inferred and non inferred GO terms
192+
# with complete network and ProGo only network
193+
# using ratio of 1:1000
194+
189195
run_workflow(
190196
algorithm_classes,
191197
go_protein_pairs,
@@ -199,6 +205,7 @@ def main():
199205
new_random_lists,
200206
short_name,
201207
print_graphs,
208+
ratio
202209
)
203210

204211
sys.exit()

tools/workflow.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def run_workflow(
3535
new_random_lists,
3636
name,
3737
figure,
38+
ratio
3839
):
3940
"""
4041
With a given set of algorithms, test the algorithms ability to prediction protein function on a given number of
@@ -88,6 +89,7 @@ def run_workflow(
8889
dataset_directory_path,
8990
i,
9091
name,
92+
ratio
9193
)
9294

9395
for i in range(
@@ -712,7 +714,7 @@ def sample_data_neighbor_degree(
712714
return positive_dataset, negative_dataset
713715

714716
def sample_data_neighbor_degree_ratio(
715-
go_protein_pairs, sample_size, protein_list, G, input_directory_path, num, name
717+
go_protein_pairs, sample_size, protein_list, G, input_directory_path, num, name, ratio
716718
):
717719
"""
718720
Given a sample size, generate positive nad negative datasets. positive dataset it generated by finding positive protein-goterm edges and for
@@ -735,7 +737,6 @@ def sample_data_neighbor_degree_ratio(
735737
positive_dataset = {"protein": [], "go": []}
736738
temp_positive_dataset = {"protein": [], "go": []}
737739
negative_dataset = {"protein": [], "go": []}
738-
ratio = 100
739740

740741
# sample the data
741742
for edge in sample(list(go_protein_pairs), sample_size):

0 commit comments

Comments
 (0)