Skip to content

Commit

Permalink
Export metabolism util methods to clean up notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pablormier committed May 8, 2024
1 parent 4ac6c63 commit 8f50d0b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
14 changes: 13 additions & 1 deletion corneto/methods/metabolism/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
from corneto.methods.metabolism._utils import evaluate_gpr_rules
from corneto.methods.metabolism._utils import (
evaluate_gpr_expression,
evaluate_gpr_rules,
get_genes_from_gpr,
get_unique_genes,
)

__all__ = [
"evaluate_gpr_rules",
"get_unique_genes",
"get_genes_from_gpr",
"evaluate_gpr_expression",
]
7 changes: 2 additions & 5 deletions docs/tutorials/context-specific-metabolic-omics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
}
],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"\n",
"import corneto as cn\n",
Expand Down Expand Up @@ -560,7 +561,7 @@
}
],
"source": [
"from corneto.methods.metabolism._utils import get_unique_genes\n",
"from corneto.methods.metabolism import evaluate_gpr_expression, get_unique_genes\n",
"\n",
"genes = get_unique_genes(G, startswith=\"b\")\n",
"len(genes)"
Expand Down Expand Up @@ -819,8 +820,6 @@
"metadata": {},
"outputs": [],
"source": [
"from corneto.methods.metabolism._utils import evaluate_gpr_expression\n",
"\n",
"values = df_expr[[\"gene\", \"score\"]].set_index(\"gene\").to_dict()[\"score\"]\n",
"e = evaluate_gpr_expression(G.get_attr_from_edges(\"GPR\"), values)"
]
Expand All @@ -842,8 +841,6 @@
}
],
"source": [
"import numpy as np\n",
"\n",
"from corneto.methods.metabolism.fba import multicondition_imat\n",
"\n",
"P = multicondition_imat(G, np.array(e))\n",
Expand Down

0 comments on commit 8f50d0b

Please sign in to comment.