diff --git a/examples/Community Modeling/smetana/BiGG_to_MSID.json b/examples/Community Modeling/smetana/BiGG_to_MSID.json index a4fc7ffc..6244dac5 100644 --- a/examples/Community Modeling/smetana/BiGG_to_MSID.json +++ b/examples/Community Modeling/smetana/BiGG_to_MSID.json @@ -353,6 +353,7 @@ "alltt": "cpd00388", "biliverd": "cpd00389", "cdpglc": "cpd00390", + "meso_Erythritol": "cpd00392", "fol": "cpd00393", "Lcyst": "cpd00395", "rmn": "cpd00396", @@ -461,6 +462,7 @@ "dcdp": "cpd00533", "i": "cpd00534", "ocdcea": "cpd00536", + "cis_Oleic acid": "cpd00536", "glyb": "cpd00540", "lipoate": "cpd00541", "crtsl": "cpd00546", @@ -731,6 +733,7 @@ "dca": "cpd01107", "hxa": "cpd01113", "bgly": "cpd01114", + "lnlcACP": "cpd01122", "malm": "cpd01123", "melatn": "cpd01124", "nona": "cpd01126", @@ -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", @@ -1469,6 +1474,7 @@ "2425dhvitd3": "cpd04848", "gmhep7p": "cpd04918", "gmhep1p": "cpd04920", + "HC02194": "cpd04945", "3mb": "cpd05178", "djenk": "cpd05190", "mtpp": "cpd05191", @@ -1491,6 +1497,7 @@ "thfglu": "cpd06227", "bzsucc": "cpd06708", "bzsuccoa": "cpd06709", + "C10164": "cpd07053", "phitcoa": "cpd06710", "hmpscoa": "cpd06711", "6occhcoa": "cpd06713", @@ -2543,5 +2550,6 @@ "2dmmq7": "cpd29732", "fmnRD": "cpd29733", "cu": "cpd30760", + "12_Ketolithocholic acid": "cpd35610", "hemeC": "cpd37301" } \ No newline at end of file diff --git a/modelseedpy/community/mscommunity.py b/modelseedpy/community/mscommunity.py index 1f01797e..dc955266 100644 --- a/modelseedpy/community/mscommunity.py +++ b/modelseedpy/community/mscommunity.py @@ -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 @@ -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," @@ -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 diff --git a/modelseedpy/core/msminimalmedia.py b/modelseedpy/core/msminimalmedia.py index a494fa40..afa54004 100644 --- a/modelseedpy/core/msminimalmedia.py +++ b/modelseedpy/core/msminimalmedia.py @@ -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":