Skip to content

Commit

Permalink
Fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
cshenry committed Mar 19, 2024
1 parent 5003789 commit 4898d5d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions modelseedpy/community/mscommunity.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,15 @@ def __init__(
lp_filename=None, # specify a filename to create an lp file
):
# Setting model and package manager
self.model, self.lp_filename, self.pfba = model, lp_filename, pfba
self.pkgmgr = MSPackageManager.get_pkg_mgr(model)
if isinstance(model, MSModelUtil):
self.model = model.model
self.mdlutl = model
else:
self.model = model
self.mdlutl = MSModelUtil.get(model)
self.pkgmgr = MSPackageManager.get_pkg_mgr(self.model)
self.lp_filename = lp_filename
self.pfba = pfba
self.gapfillings = {}
# Define Data attributes as None
self.solution = (
Expand All @@ -151,7 +158,7 @@ def __init__(
) = self.kinetic_coeff = self.modelseed_db_path = None
self.species = DictList()
# Computing data from model
msid_cobraid_hash = FBAHelper.msid_hash(model)
msid_cobraid_hash = self.mdlutl.msid_hash()
if "cpd11416" not in msid_cobraid_hash:
logger.critical("Could not find biomass compound")
raise KeyError("Could not find biomass compound for the model.")
Expand Down Expand Up @@ -314,7 +321,7 @@ def build_from_species_models(
newutl = MSModelUtil(newmodel)
newutl.add_exchanges_for_metabolites([comm_biomass], 0, 100, "SK_")
return (
MSCommunity(model=newmodel, names=names, abundances=abundances),
MSCommunity(model=newutl, names=names, abundances=abundances),
biomass_indices_dict,
)

Expand Down

0 comments on commit 4898d5d

Please sign in to comment.