Skip to content

Commit

Permalink
Updating cobrakbase to fix gene support problem, and updating release…
Browse files Browse the repository at this point in the history
… number and release notes
  • Loading branch information
cshenry committed Apr 1, 2024
1 parent 0c6f503 commit 061b8d2
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ RUN pip install chemw==0.3.2
RUN pip install deepdiff
RUN pip install h5py

RUN echo '30' >/dev/null && pip install --use-deprecated=legacy-resolver git+https://github.com/cshenry/ModelSEEDpy.git
RUN echo '9' >/dev/null && pip install git+https://github.com/cshenry/cobrakbase.git@5c0bfefb569a2540df878fdf995889590412f232
RUN echo '31' >/dev/null && pip install --use-deprecated=legacy-resolver git+https://github.com/cshenry/ModelSEEDpy.git
RUN echo '10' >/dev/null && pip install git+https://github.com/cshenry/cobrakbase.git@525409070d11fc1efd8fe5daf9069fd519d563c2

RUN echo '28' >/dev/null && mkdir deps && cd deps && \
RUN echo '29' >/dev/null && mkdir deps && cd deps && \
git clone --branch main https://github.com/cshenry/KBBaseModules.git
RUN mkdir test

Expand Down
6 changes: 6 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
###Release Notes

**2.0.0**
Added support for OMEGGA algorithm including use of expression data
Improved gapfilling to use alternative annotations
Fixed bugs in multi-gapfill and sensitivity analysis
Added support for sequential and independent gapfilling

**1.0.0**
Initial full release of module with Model Reconstruction and Gapfilling apps

Expand Down
2 changes: 1 addition & 1 deletion kbase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ service-language:
python

module-version:
1.0.0
2.0.0

owners:
[chenry]
Expand Down
33 changes: 31 additions & 2 deletions lib/ModelSEEDReconstruction/modelseedrecon.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,17 +434,23 @@ def run_community_fba(self,params):
media = self.get_media(params["media_id"],None)
mdlutl.pkgmgr.getpkg("KBaseMediaPkg").build_package(media)
#Setting elemental uptake constraint
exchange_string = "None"
elemental_hash = {}
if params["max_c_uptake"]:
elemental_hash["C"] = params["max_c_uptake"]
exchange_string += "C: "+str(params["max_c_uptake"])+"; "
if params["max_n_uptake"]:
elemental_hash["N"] = params["max_n_uptake"]
exchange_string += "N: "+str(params["max_n_uptake"])+"; "
if params["max_p_uptake"]:
elemental_hash["P"] = params["max_p_uptake"]
exchange_string += "P: "+str(params["max_p_uptake"])+"; "
if params["max_s_uptake"]:
elemental_hash["S"] = params["max_s_uptake"]
exchange_string += "S: "+str(params["max_s_uptake"])+"; "
if params["max_o_uptake"]:
elemental_hash["O"] = params["max_o_uptake"]
exchange_string += "O: "+str(params["max_o_uptake"])+"; "
if len(elemental_hash) > 0:
mdlutl.pkgmgr.getpkg("ElementUptakePkg").build_package(elemental_hash)
#Adding commkinetic constraints
Expand Down Expand Up @@ -488,7 +494,7 @@ def run_community_fba(self,params):
coef.update({currrxn.forward_variable: 1})
coef.update({currrxn.reverse_variable: 1})
elif "EX_" == rxn.id[0:3]:
currrxn = current_comm_model.model.reactions.get_by_id(rxn.id)
currrxn = comm_model.model.reactions.get_by_id(rxn.id)
coef.update({currrxn.forward_variable: float(params["exchange_coef"])})
coef.update({currrxn.reverse_variable: float(params["exchange_coef"])})
#Adding expression data to minimum probability objective
Expand Down Expand Up @@ -525,7 +531,30 @@ def run_community_fba(self,params):
#Solving the LP
solution = mdlutl.model.optimize()
fba_obj = self.save_solution_as_fba(solution,mdlutl,media,params["fba_output_id"],workspace=params["workspace"],fbamodel_ref=params("fbamodel_id"))

context = {
"overview": {
'Model ID':mdlutl.wsid,
'Media ID':media.id,
'Target reaction':params["target_reaction"],
'Gene knockouts':"; ".join(params["feature_ko_list"]),
'Reaction knockouts':"; ".join(params["reaction_ko_list"]),
'Exchange limits':exchange_string,
'Kinetics coefficient':params["kinetics_coef"],
'Objective fraction':params["objective_fraction"],
'prFBA':params["prfba"],
'Max growth':fba_obj.objective_value
},
"reactions": [],
"exchange": [],
"interaction": []
}
env = jinja2.Environment(
loader=jinja2.FileSystemLoader(self.module_dir+"/data/"),
autoescape=jinja2.select_autoescape(['html', 'xml']))
html = env.get_template("FBAReportTemplate.html").render(context)
os.makedirs(self.working_dir+"/html", exist_ok=True)
with open(self.working_dir+"/html/index.html", 'w') as f:
f.write(html)
#Saving the output
if params["save_report_to_kbase"]:
output = self.save_report_to_kbase()
Expand Down

0 comments on commit 061b8d2

Please sign in to comment.