Skip to content

Commit

Permalink
finished conflict resolution and dependency updates
Browse files Browse the repository at this point in the history
  • Loading branch information
freiburgermsu committed Jul 19, 2023
1 parent 332672b commit 525c245
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 44 deletions.
13 changes: 1 addition & 12 deletions modelseedpy/core/msatpcorrection.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,21 +344,15 @@ def determine_growth_media(self, max_gapfilling=None):
self.selected_media = []
best_score = inf
for media in self.media_gapfill_stats:
<<<<<<< HEAD
=======
atp_att["core_atp_gapfilling"][media.id] = {
"score": 0,
"new": {},
"reversed": {},
}
>>>>>>> b08f8f38362c3a9140571f5ade10f8d00ab10ae6
if self.media_gapfill_stats[media]:
atp_att["core_atp_gapfilling"][media.id]["score"] = len(
self.media_gapfill_stats[media]["new"].keys()
) + 0.5 * len(self.media_gapfill_stats[media]["reversed"].keys())
<<<<<<< HEAD
best_score = min(best_score, gfscore)
=======
atp_att["core_atp_gapfilling"][media.id][
"new"
] = self.media_gapfill_stats[media]["new"]
Expand All @@ -370,13 +364,8 @@ def determine_growth_media(self, max_gapfilling=None):
"score": 1000,
"failed": True,
}
if (
best_score is None
or atp_att["core_atp_gapfilling"][media.id]["score"] < best_score
):
best_score = atp_att["core_atp_gapfilling"][media.id]["score"]
best_score = min(best_score, atp_att["core_atp_gapfilling"][media.id]["score"])

>>>>>>> b08f8f38362c3a9140571f5ade10f8d00ab10ae6
if self.max_gapfilling is None:
self.max_gapfilling = best_score

Expand Down
32 changes: 1 addition & 31 deletions modelseedpy/core/mstemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,17 +802,6 @@ def build_biomass(self, model, index="0", classic=False, GC=0.5, add_to_model=Tr
coef = comp.coefficient
elif comp.coefficient_type == "AT":
coef = (
<<<<<<< HEAD
comp.coefficient
* (1 - GC)
* (type_abundances[type] / bio_type_hash[type]["total_mw"])
)
elif comp.coefficient_type == "GC":
coef = (
comp.coefficient
* GC
* (type_abundances[type] / bio_type_hash[type]["total_mw"])
=======
2
* comp.coefficient
* (1 - GC)
Expand All @@ -824,7 +813,6 @@ def build_biomass(self, model, index="0", classic=False, GC=0.5, add_to_model=Tr
* comp.coefficient
* GC
* (type_abundances[type] / bio_type_hash[type]["total_mw"])
>>>>>>> b08f8f38362c3a9140571f5ade10f8d00ab10ae6
)
if coef:
met = model.metabolites.get_by_id(comp.metabolite.id + index)
Expand All @@ -848,20 +836,9 @@ def build_biomass(self, model, index="0", classic=False, GC=0.5, add_to_model=Tr
else:
metabolites[met] = coef * comp.linked_metabolites[l_met]
elif not classic:
<<<<<<< HEAD
if met in metabolites:
specific_reactions[type].metabolites[met] += (
coef * comp.linked_metabolites[l_met]
)
else:
specific_reactions[type].metabolites[met] = (
coef * comp.linked_metabolites[l_met]
)
=======
specific_reactions[type].add_metabolites(
{met: coef * comp.linked_metabolites[l_met]}
)
>>>>>>> b08f8f38362c3a9140571f5ade10f8d00ab10ae6
biorxn.annotation[SBO_ANNOTATION] = "SBO:0000629"
biorxn.add_metabolites(metabolites)
if add_to_model:
Expand Down Expand Up @@ -1282,16 +1259,9 @@ def add_reactions(self, reaction_list: list):
if cpx.id not in self.complexes:
self.add_complexes([cpx])
complex_replace.add(self.complexes.get_by_id(cpx.id))
<<<<<<< HEAD
rxn._metabolites = metabolites_replace
rxn._update_awareness()
rxn.complexes = complex_replace
=======

x._metabolites = metabolites_replace
x._update_awareness()
x.complexes = complex_replace

>>>>>>> b08f8f38362c3a9140571f5ade10f8d00ab10ae6
self.reactions += reaction_list

def get_role_sources(self):
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
"deepdiff",
"openpyxl",
"jinja2",
"multiprocess"
"multiprocess",
"h5py",
"graphviz"
],
tests_require=[
"pytest",
Expand Down

0 comments on commit 525c245

Please sign in to comment.