@@ -38,7 +38,8 @@ def find_connected_sources_targets(sources: list[str], targets: list[str], graph
3838def attempt_sample (
3939 pathway_name : str ,
4040 pathway_df : pandas .DataFrame ,
41- percentage : float ,
41+ percentage_to_sample : float ,
42+ percentage_to_require : float ,
4243 weight_mapping : OrderedDict [int , int ],
4344 interactome_df : pandas .DataFrame ,
4445 sources : list [str ],
@@ -54,7 +55,7 @@ def attempt_sample(
5455 returning the connections between {sources} and {targets},
5556 or None if the target percentage failed.
5657 """
57- interactome_df = sample_interactome (interactome_df , weight_mapping , percentage )
58+ interactome_df = sample_interactome (interactome_df , weight_mapping , percentage_to_sample )
5859
5960 print (f"Merging { pathway_name } with interactome..." )
6061 # While we are merging this graph, we are preparing to compare the connectedness of the prev[ious] and curr[ent] (merged) graph
@@ -71,12 +72,12 @@ def attempt_sample(
7172 # We ask that at least `percentage` of the sources and targets are connected with one another.
7273 connection_percentage = float (len (curr_connections )) / float (len (prev_connections )) if len (prev_connections ) != 0 else 0
7374
74- if percentage <= connection_percentage :
75- print (f"Got { connection_percentage * 100 :.1f} % connections above the { percentage * 100 :.1f} % threshold." )
75+ if percentage_to_require <= connection_percentage :
76+ print (f"Got { connection_percentage * 100 :.1f} % connections above the { percentage_to_require * 100 :.1f} % required percentage threshold." )
7677 pathway_df .to_csv (output_gold_standard , sep = "\t " , index = False , header = False )
7778 interactome_df .to_csv (output_interactome , sep = "\t " , index = False , header = False )
7879 return curr_connections
79- print (f"Failed { connection_percentage * 100 :.1f} % connections below the { percentage * 100 :.1f} % threshold." )
80+ print (f"Failed { connection_percentage * 100 :.1f} % connections below the { percentage_to_require * 100 :.1f} % required percentage threshold." )
8081 return None
8182
8283
0 commit comments