Skip to content

Commit

Permalink
removed debugging print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
freiburgermsu committed Jul 30, 2024
1 parent 1387388 commit 80098e4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions examples/Community Modeling/smetana/BiGG_to_MSID.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@
"alltt": "cpd00388",
"biliverd": "cpd00389",
"cdpglc": "cpd00390",
"meso_Erythritol": "cpd00392",
"fol": "cpd00393",
"Lcyst": "cpd00395",
"rmn": "cpd00396",
Expand Down Expand Up @@ -461,6 +462,7 @@
"dcdp": "cpd00533",
"i": "cpd00534",
"ocdcea": "cpd00536",
"cis_Oleic acid": "cpd00536",
"glyb": "cpd00540",
"lipoate": "cpd00541",
"crtsl": "cpd00546",
Expand Down Expand Up @@ -731,6 +733,7 @@
"dca": "cpd01107",
"hxa": "cpd01113",
"bgly": "cpd01114",
"lnlcACP": "cpd01122",
"malm": "cpd01123",
"melatn": "cpd01124",
"nona": "cpd01126",
Expand Down Expand Up @@ -994,10 +997,12 @@
"B_ara1p": "cpd02428",
"1pyr5c": "cpd02431",
"5adtststerone": "cpd02435",
"dchac": "cpd02733",
"mcom": "cpd02438",
"3ddgc": "cpd02441",
"d5kg": "cpd02446",
"thdp": "cpd02465",
"HC02191": "cpd02475",
"b124tc": "cpd02483",
"hacon_C": "cpd02483",
"hacon_T": "cpd02483",
Expand Down Expand Up @@ -1469,6 +1474,7 @@
"2425dhvitd3": "cpd04848",
"gmhep7p": "cpd04918",
"gmhep1p": "cpd04920",
"HC02194": "cpd04945",
"3mb": "cpd05178",
"djenk": "cpd05190",
"mtpp": "cpd05191",
Expand All @@ -1491,6 +1497,7 @@
"thfglu": "cpd06227",
"bzsucc": "cpd06708",
"bzsuccoa": "cpd06709",
"C10164": "cpd07053",
"phitcoa": "cpd06710",
"hmpscoa": "cpd06711",
"6occhcoa": "cpd06713",
Expand Down Expand Up @@ -2543,5 +2550,6 @@
"2dmmq7": "cpd29732",
"fmnRD": "cpd29733",
"cu": "cpd30760",
"12_Ketolithocholic acid": "cpd35610",
"hemeC": "cpd37301"
}
6 changes: 3 additions & 3 deletions modelseedpy/community/mscommunity.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class CommunityMember:
def __init__(self, community, biomass_cpd, ID=None, index=None, abundance=0):
print(biomass_cpd)
print("biomass compound:", biomass_cpd)
self.community, self.biomass_cpd = community, biomass_cpd
try: self.index = int(self.biomass_cpd.compartment[1:])
except: self.index = index
Expand Down Expand Up @@ -101,7 +101,7 @@ def __init__(self, model=None, member_models: list = None, abundances=None, kine
if "c0" in self.biomass_cpd.id:
for rxn in self.util.model.reactions:
if self.biomass_cpd not in rxn.metabolites: continue
print(self.biomass_cpd, rxn, end=";\t")
# print(self.biomass_cpd, rxn, end=";\t")
if rxn.metabolites[self.biomass_cpd] == 1 and len(rxn.metabolites) > 1:
if self.primary_biomass: raise ObjectAlreadyDefinedError(
f"The primary biomass {self.primary_biomass} is already defined,"
Expand All @@ -112,7 +112,7 @@ def __init__(self, model=None, member_models: list = None, abundances=None, kine
elif 'c' in self.biomass_cpd.compartment: other_biomass_cpds.append(self.biomass_cpd)
abundances = abundances or {f"Species{memIndex}": {"biomass_compound": bioCpd, "abundance": 1/len(other_biomass_cpds)}
for memIndex, bioCpd in enumerate(other_biomass_cpds)}
print() # this returns the carriage after the tab-ends in the biomass compound printing
# print() # this returns the carriage after the tab-ends in the biomass compound printing
self.members = DictList(CommunityMember(self, info["biomass_compound"], ID, index, info["abundance"])
for index, (ID, info) in enumerate(abundances.items()))
# assign the MSCommunity constraints and objective
Expand Down
2 changes: 1 addition & 1 deletion modelseedpy/core/msminimalmedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def bioFlux_check(model, sol=None, sol_dict=None, min_growth=0.1):
sol_dict = sol_dict or FBAHelper.solution_to_variables_dict(sol, model)
# print({k:v for k,v in sol_dict.items() if v > 1E-8})
simulated_growth = max(sum([flux for var, flux in sol_dict.items() if re.search(r"(^bio\d+$)", var.name)]), sol.objective_value)
if simulated_growth < min_growth*0.9999:
if simulated_growth < min_growth*0.9999 and simulated_growth+min_growth > 1e-8:
raise ObjectiveError(f"The assigned minimal_growth of {min_growth} was not maintained during the simulation,"
f" where the observed growth value was {simulated_growth}.")
if sol.status != "optimal":
Expand Down

0 comments on commit 80098e4

Please sign in to comment.