Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
freiburgermsu committed Dec 6, 2023
2 parents 445d5ae + 82bb9ea commit b055bda
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 476 deletions.
28 changes: 11 additions & 17 deletions examples/Community Modeling/MSSteadyCom/MSCommunity_thermo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,32 +103,26 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 5,
"metadata": {
"scrolled": true,
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"cobrakbase 0.3.1\n"
]
}
],
"outputs": [],
"source": [
"# import kbase\n",
"import os\n",
"local_cobrakbase_path = os.path.join('C:', 'Users', 'Andrew Freiburger','Documents','Argonne','cobrakbase')\n",
"# local_cobrakbase_path = os.path.join('C:', 'Users', 'Andrew Freiburger','Documents','Argonne','cobrakbase')\n",
"local_cobrakbase_path = os.path.join('..', '..', '..', '..', 'cobrakbase')\n",
"os.environ[\"HOME\"] = local_cobrakbase_path\n",
"\n",
"import cobrakbase\n",
"with open(\"C:/Users/Andrew Freiburger/Documents/Argonne/kbase_token.txt\") as token_file:\n",
"# with open(\"C:/Users/Andrew Freiburger/Documents/Argonne/kbase_token.txt\") as token_file:\n",
"os.system(\"pwd\")\n",
"with open(\"../../../../kbase_token.txt\") as token_file:\n",
" kbase = cobrakbase.KBaseAPI(token_file.readline())\n",
"\n",
"model = kbase.get_from_ws(\"CMM_iAH991V2_iML1515.kb\",40576)\n",
"media = kbase.get_from_ws(\"Btheta_Ecoli_minimal_media\",40576)\n",
"# media = kbase.get_from_ws(\"Btheta_Ecoli_minimal_media\",40576)\n",
"\n",
"%matplotlib inline"
]
Expand Down Expand Up @@ -178,7 +172,7 @@
],
"source": [
"model = kbase.get_from_ws(\"CMM_iAH991V2_iML1515.kb\",40576)\n",
"media = kbase.get_from_ws(\"Btheta_Ecoli_minimal_media\",40576)\n",
"# media = kbase.get_from_ws(\"Btheta_Ecoli_minimal_media\",40576)\n",
"\n",
"# simulate and visualize the model\n",
"from modelseedpy import MSCommunity\n",
Expand Down Expand Up @@ -623,7 +617,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -637,7 +631,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down
36 changes: 18 additions & 18 deletions examples/HTML_report.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "3370e326-9146-43c4-9004-dd229bad1123",
"id": "loaded-dakota",
"metadata": {},
"source": [
"# Load a model"
Expand All @@ -11,7 +11,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "7e8d874e-4c45-43ad-a4e1-ec5a83f2c942",
"id": "induced-button",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -42,7 +42,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "04a852cc-d5ac-4efa-813e-f83694c90aa6",
"id": "verified-drove",
"metadata": {
"tags": []
},
Expand All @@ -55,7 +55,7 @@
{
"cell_type": "code",
"execution_count": 24,
"id": "e9a4b845-bb73-459c-9b0e-3b9e9dd3d83f",
"id": "continuous-animal",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -144,7 +144,7 @@
{
"cell_type": "code",
"execution_count": 25,
"id": "349697ee-04ec-4e46-ac96-8264deecbf5e",
"id": "entitled-belle",
"metadata": {},
"outputs": [
{
Expand All @@ -163,7 +163,7 @@
},
{
"cell_type": "markdown",
"id": "503d83c7-f056-4bdd-8dc4-5af7c0f8450b",
"id": "lyric-donna",
"metadata": {},
"source": [
"# Run SteadyCom"
Expand All @@ -172,7 +172,7 @@
{
"cell_type": "code",
"execution_count": 26,
"id": "8b554016-2f00-4294-878b-2b1d3dc9cf58",
"id": "monthly-majority",
"metadata": {
"scrolled": true,
"tags": []
Expand Down Expand Up @@ -331,7 +331,7 @@
},
{
"cell_type": "markdown",
"id": "e6be5b9d-3d6b-498a-ad02-2b9fcb7ffa5d",
"id": "rotary-listing",
"metadata": {},
"source": [
"# Construct the HTML report"
Expand All @@ -340,7 +340,7 @@
{
"cell_type": "code",
"execution_count": 29,
"id": "d049c63f-03c4-4345-a120-1f8c236c84ba",
"id": "annoying-physiology",
"metadata": {},
"outputs": [
{
Expand All @@ -362,7 +362,7 @@
},
{
"cell_type": "markdown",
"id": "46b790aa-280e-43cc-b43f-a709a5e1c7e7",
"id": "instructional-thriller",
"metadata": {},
"source": [
"### Combine pandas Series into a single DataFrame"
Expand All @@ -371,7 +371,7 @@
{
"cell_type": "code",
"execution_count": 17,
"id": "c2502a8b-34b3-4cec-95da-7f8f4b254069",
"id": "adjacent-boost",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -432,7 +432,7 @@
},
{
"cell_type": "markdown",
"id": "899e1302-287f-4fae-a697-ed69eff8cf0e",
"id": "genuine-forest",
"metadata": {},
"source": [
"# Construct a SMETANA report"
Expand All @@ -441,7 +441,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "3c202015-42d0-46c9-a577-2c3b0e6bff78",
"id": "assigned-teach",
"metadata": {
"scrolled": true,
"tags": []
Expand Down Expand Up @@ -1039,7 +1039,7 @@
{
"cell_type": "code",
"execution_count": 11,
"id": "1bdbd095-9a05-4b1a-ae0d-b95ec1ed8db0",
"id": "nonprofit-macro",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1070,7 +1070,7 @@
{
"cell_type": "code",
"execution_count": 16,
"id": "e8406924-ce43-4aa6-8a9d-726c91130349",
"id": "accurate-filename",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1134,7 +1134,7 @@
{
"cell_type": "code",
"execution_count": 21,
"id": "40f0f0fe-ea52-4eb2-9909-f85237c43674",
"id": "mysterious-speed",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -1149,7 +1149,7 @@
{
"cell_type": "code",
"execution_count": 50,
"id": "c9edc46c-b53a-4e7d-8e93-1e5a90500290",
"id": "royal-ranch",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1317,7 +1317,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand Down
1 change: 1 addition & 0 deletions genesearch
Submodule genesearch added at 7039b7
2 changes: 1 addition & 1 deletion modelseedpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from modelseedpy.core.exceptions import *

from modelseedpy.community import (
MSCommunity, CommunityMember, MSCompatibility, MSKineticsFBA, CommScores, CommPhitting,
MSCommunity, CommunityMember, MSKineticsFBA, CommScores, CommPhitting,
MSSteadyCom, build_from_species_models, phenotypes)

from modelseedpy.biochem import ModelSEEDBiochem
Expand Down
1 change: 0 additions & 1 deletion modelseedpy/community/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from modelseedpy.community.datastandardization import *
from modelseedpy.community.mssteadycom import MSSteadyCom
from modelseedpy.community.commphitting import CommPhitting
from modelseedpy.community.mscompatibility import MSCompatibility
from modelseedpy.community.commhelper import build_from_species_models, phenotypes
from modelseedpy.community.mskineticsfba import MSKineticsFBA

4 changes: 2 additions & 2 deletions modelseedpy/community/commhelper.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from modelseedpy.core.msminimalmedia import minimizeFlux_withGrowth, bioFlux_check
from modelseedpy.core.exceptions import NoFluxError, ObjectiveError
from modelseedpy.community.mscompatibility import MSCompatibility
from modelseedpy.core.msmodelutl import MSModelUtil
from modelseedpy.core.fbahelper import FBAHelper
from cobra import Model, Reaction, Metabolite
from cobra.medium import minimal_medium
from commscores import GEMCompatibility
from cobra.flux_analysis import pfba
from collections import OrderedDict
from optlang.symbolics import Zero
Expand Down Expand Up @@ -55,7 +55,7 @@ def build_from_species_models(org_models, model_id=None, name=None, abundances=N
------
"""
# construct the new model
models = org_models if not standardize else MSCompatibility.standardize(
models = org_models if not standardize else GEMCompatibility.standardize(
org_models, exchanges=True, conflicts_file_name='exchanges_conflicts.json')
biomass_indices = []
biomass_index = minimal_biomass_index = 2
Expand Down
Loading

0 comments on commit b055bda

Please sign in to comment.