@@ -498,7 +498,7 @@ def get_atp_tests(self,core_template=None,atp_media_filename=None,recompute=Fals
498498 return self .atp_tests
499499 #Attempting to pull ATP tests from attributes
500500 if not recompute :
501- print ("Getting tests from attributes" )
501+ logger . debug ("Getting tests from attributes" )
502502 atp_analysis = self .get_attributes ("ATP_analysis" ,None )
503503 if atp_analysis :
504504 if "tests" in atp_analysis :
@@ -948,7 +948,7 @@ def is_core(self,rxn):
948948 if not isinstance (rxn , str ):
949949 rxn = rxn .id
950950 if "core_reactions" in self .get_attributes ():
951- print ("Using core reactions attribute!" )
951+ logger . debug ("Using core reactions attribute!" )
952952 if rxn in self .get_attributes ("core_reactions" ):
953953 return True
954954 return False
@@ -1291,7 +1291,7 @@ def test_solution(self,solution,targets,medias,thresholds=[0.1],remove_unneeded_
12911291 return unneeded
12921292
12931293 def add_gapfilling (self , solution ):
1294- print ("Adding gapfilling" , str (solution ))
1294+ logger . debug ("Adding gapfilling:" + str (solution ))
12951295 self .integrated_gapfillings .append (solution )
12961296
12971297 def create_kb_gapfilling_data (self , kbmodel , atpmedia_ws = "94026" ):
@@ -1439,7 +1439,7 @@ def test_single_condition(self, condition, apply_condition=True, model=None,repo
14391439 self .model .reactions .get_by_id (condition ["objective" ]).lower_bound = 0
14401440 return False
14411441 elif value <= condition ["threshold" ] and not condition ["is_max_threshold" ]:
1442- print ("Failed low:" + condition ["media" ].id + ":" + str (new_objective )+ ";" + str (condition ["threshold" ]))
1442+ logger . debug ("Failed low:" + condition ["media" ].id + ":" + str (new_objective )+ ";" + str (condition ["threshold" ]))
14431443 return False
14441444 self .test_objective = new_objective
14451445 logger .debug ("Passed:" + condition ["media" ].id + ":" + str (new_objective )+ ";" + str (condition ["threshold" ]))
@@ -1544,11 +1544,11 @@ def binary_expansion_test(self, reaction_list, condition, currmodel, depth=0,pos
15441544 filtered_list = []
15451545 # First run the full test
15461546 if self .test_single_condition (condition ,apply_condition = False ,model = currmodel ,rxn_list = reaction_list ):
1547- #print ("Reaction set passed"," ".join(map(str, reaction_list)))
1547+ #logger.debug ("Reaction set passed"," ".join(map(str, reaction_list)))
15481548 return []
15491549 # Check if input list contains only one reaction:
15501550 if len (reaction_list ) == 1 :
1551- #print ("Failed:"+reaction_list[0][1]+reaction_list[0][0].id)
1551+ #logger.debug ("Failed:"+reaction_list[0][1]+reaction_list[0][0].id)
15521552 if reaction_list [0 ][1 ] == ">" :
15531553 reaction_list [0 ].append (reaction_list [0 ][0 ].upper_bound )
15541554 reaction_list [0 ][0 ].upper_bound = 0
@@ -1561,7 +1561,7 @@ def binary_expansion_test(self, reaction_list, condition, currmodel, depth=0,pos
15611561 #Testing positive growth conditions
15621562 for pos_condition in positive_growth :
15631563 if not self .test_single_condition (pos_condition ,apply_condition = True ,model = currmodel ):
1564- print ("Does not pass positive growth tests:" + reaction_list [0 ][1 ]+ reaction_list [0 ][0 ].id )
1564+ logger . debug ("Does not pass positive growth tests:" + reaction_list [0 ][1 ]+ reaction_list [0 ][0 ].id )
15651565 success = False
15661566 break
15671567 #Restoring current test condition
@@ -1601,7 +1601,7 @@ def binary_expansion_test(self, reaction_list, condition, currmodel, depth=0,pos
16011601 for item in new_filter :
16021602 filtered_list .append (item )
16031603 if self .breaking_reaction != None :
1604- print ("Ending early due to breaking reaction:" + self .breaking_reaction .id )
1604+ logger . debug ("Ending early due to breaking reaction:" + self .breaking_reaction .id )
16051605 return filtered_list
16061606 # Submitting second half of reactions for testing - now only breaking reactions are removed from the first list
16071607 for i , item in enumerate (reaction_list ):
@@ -1667,14 +1667,14 @@ def reaction_expansion_test(
16671667 scores = self .assign_reliability_scores_to_reactions ()
16681668 reaction_list = sorted (reaction_list , key = lambda x : scores [x [0 ].id ][x [1 ]])
16691669 for item in reaction_list :
1670- print (item [0 ].id + ":" + item [1 ]+ ":" + str (scores [item [0 ].id ][item [1 ]]))
1670+ logger . debug (item [0 ].id + ":" + item [1 ]+ ":" + str (scores [item [0 ].id ][item [1 ]]))
16711671 for condition in condition_list :
16721672 logger .debug (f"testing condition { condition } " )
16731673 currmodel = self .model
16741674 tic = time .perf_counter ()
16751675 new_filtered = []
16761676 if not self .check_if_solution_exists (reaction_list , condition , currmodel ):
1677- print ("No solution exists that passes tests for condition " + condition ["media" ].id )
1677+ logger . debug ("No solution exists that passes tests for condition " + condition ["media" ].id )
16781678 return None
16791679 with currmodel :
16801680 self .apply_test_condition (condition )
@@ -1691,13 +1691,13 @@ def reaction_expansion_test(
16911691 done = True
16921692 else :
16931693 #Remove breaking reaction from reaction_list
1694- print ("Keeping breaking reaction:" + self .breaking_reaction .id )
1694+ logger . debug ("Keeping breaking reaction:" + self .breaking_reaction .id )
16951695 for i in range (len (reaction_list )):
16961696 if reaction_list [i ][0 ] == self .breaking_reaction :
16971697 del reaction_list [i ]
16981698 break
16991699 if not self .check_if_solution_exists (reaction_list , condition , currmodel ):
1700- print ("No solution exists after retaining breaking reaction:" + self .breaking_reaction .id )
1700+ logger . debug ("No solution exists after retaining breaking reaction:" + self .breaking_reaction .id )
17011701 return None
17021702 self .breaking_reaction = None
17031703 else :
0 commit comments