{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Context-specific metabolic model from transcriptomics data" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [], "text/plain": [] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", "
\n", " \n", " \n", " \n", " \n", "
Installed version:v1.0.0.dev0 (up to date)
Available backends:CVXPY v1.4.3, PICOS v2.4.17
Default backend (corneto.K):CVXPY
Installed solvers:CLARABEL, CVXOPT, ECOS, ECOS_BB, GLPK, GLPK_MI, OSQP, SCIP, SCIPY, SCS
Graphviz version:v0.20.3
Repository:https://github.com/saezlab/corneto
\n", "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "import pandas as pd\n", "\n", "import corneto as cn\n", "\n", "cn.info()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Model does not contain SBML fbc package information.\n", "SBML package 'layout' not supported by cobrapy, information is not parsed\n", "SBML package 'render' not supported by cobrapy, information is not parsed\n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Use of the species charge attribute is discouraged, use fbc:charge instead: \n", "Adding exchange reaction EX_ac_b with default bounds for boundary metabolite: ac_b.\n", "Adding exchange reaction EX_akg_b with default bounds for boundary metabolite: akg_b.\n", "Adding exchange reaction EX_co2_b with default bounds for boundary metabolite: co2_b.\n", "Adding exchange reaction EX_etoh_b with default bounds for boundary metabolite: etoh_b.\n", "Adding exchange reaction EX_for_b with default bounds for boundary metabolite: for_b.\n", "Adding exchange reaction EX_fum_b with default bounds for boundary metabolite: fum_b.\n", "Adding exchange reaction EX_glc_D_b with default bounds for boundary metabolite: glc_D_b.\n", "Adding exchange reaction EX_h2o_b with default bounds for boundary metabolite: h2o_b.\n", "Adding exchange reaction EX_h_b with default bounds for boundary metabolite: h_b.\n", "Adding exchange reaction EX_lac_D_b with default bounds for boundary metabolite: lac_D_b.\n", "Adding exchange reaction EX_o2_b with default bounds for boundary metabolite: o2_b.\n", "Adding exchange reaction EX_pi_b with default bounds for boundary metabolite: pi_b.\n", "Adding exchange reaction EX_pyr_b with default bounds for boundary metabolite: pyr_b.\n", "Adding exchange reaction EX_succ_b with default bounds for boundary metabolite: succ_b.\n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: \n", "Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n", "Encoding OBJECTIVE_COEFFICIENT in KineticLaw is discouraged, use fbc:fluxObjective instead: \n" ] }, { "data": { "text/plain": [ "(77, 91)" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from cobra.io import read_sbml_model\n", "\n", "model = read_sbml_model(\"../../tests/gem/ecoli_core.zip\")\n", "G = cn.Graph.from_cobra_model(model)\n", "G.shape" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
generaw_value_1raw_value_2raw_value_3raw_value_4value
0b000811.21126512.03098412.01737111.67417911.733450
1b011411.76711811.58164911.88583311.57104511.701411
2b011511.02053110.81358911.14457311.36213811.085208
3b011610.29906810.56296310.78809410.42545910.518896
4b01186.1161226.4375546.9566866.2294196.434945
.....................
131b41539.64725510.0891108.6858518.9023729.331147
132b41549.1767399.3875458.8418188.5106118.979178
133b42329.4902109.2010199.3211759.2355119.311979
134b43012.3355972.3383722.3179672.2701612.315524
135b43952.4310052.8277512.8228222.8251722.726687
\n", "

136 rows × 6 columns

\n", "
" ], "text/plain": [ " gene raw_value_1 raw_value_2 raw_value_3 raw_value_4 value\n", "0 b0008 11.211265 12.030984 12.017371 11.674179 11.733450\n", "1 b0114 11.767118 11.581649 11.885833 11.571045 11.701411\n", "2 b0115 11.020531 10.813589 11.144573 11.362138 11.085208\n", "3 b0116 10.299068 10.562963 10.788094 10.425459 10.518896\n", "4 b0118 6.116122 6.437554 6.956686 6.229419 6.434945\n", ".. ... ... ... ... ... ...\n", "131 b4153 9.647255 10.089110 8.685851 8.902372 9.331147\n", "132 b4154 9.176739 9.387545 8.841818 8.510611 8.979178\n", "133 b4232 9.490210 9.201019 9.321175 9.235511 9.311979\n", "134 b4301 2.335597 2.338372 2.317967 2.270161 2.315524\n", "135 b4395 2.431005 2.827751 2.822822 2.825172 2.726687\n", "\n", "[136 rows x 6 columns]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_expr = pd.read_csv(\"../../tests/gem/ecoli_example_data.zip\")\n", "df_expr" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "101" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from corneto.methods.metabolism import evaluate_gpr_expression, get_unique_genes\n", "\n", "genes = get_unique_genes(G, startswith=\"b\")\n", "len(genes)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[]], dtype=object)" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAGzCAYAAACPa3XZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8fJSN1AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAj20l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36NBBp06dqjX23Xff6auvvqo11q1bN505c0YZGRktezAAwgKf+QDQoIyMDCUmJmr58uVavny5+vfvr/T0dEmq+RCqZVm17tPYb59069atzuc1li5dWufMx8iRI7V161atW7euzhynTp3Sf//738Y+HABhgDMfABrkdrt19913a9myZaqoqNBvfvObmtvi4+N1yy23aP78+fL7/brooov04YcfqrS0tFFz/+IXv9Cjjz6qn//858rMzNTHH3+sdevWqVOnTrW2mzJlilatWqU77rhDDz30kK655hpVVFTo008/1YoVK3To0KE69wEQvggfAIIaNWqU/vCHP8jlcmnkyJG1bisoKNCTTz6pRYsWybIsDR48WGvWrFFKSkrQeR9++GGVlpbqj3/8o9auXaubb75ZRUVFNR9urRYbG6vi4mLNnj1b7777rt58803Fx8frsssuU15enhISEmx9vABCy2X9+HwpAABACPGZDwAAYBThAwAAGEX4AAAARhE+AACAUYQPAABgFOEDAAAYFXb/z0cgENCxY8cUFxcnl8vldDkAAKARLMvS6dOnlZKSojZtGj63EXbh49ixY0pNTXW6DAAA0AxHjhzRxRdf3OA2YRc+4uLiJH1ffHx8vG3z+v1+ffjhhxo8eLDcbrdt87Ym9Khh9Cc4etQw+hMcPQouXHvk9XqVmppa83e8IWEXPqrfaomPj7c9fMTGxio+Pj6snqxwQo8aRn+Co0cNoz/B0aPgwr1HjfnIBB84BQAARhE+AACAUYQPAABgFOEDAAAYRfgAAABGET4AAIBRhA8AAGAU4QMAABhF+AAAAEYRPgAAgFGEDwAAYBThAwAAGEX4AAAARhE+AACAUdFOFxBJuk77oNn3PTR3mI2VAAAQuTjzAQAAjCJ8AAAAowgfAADAKMIHAAAwivABAACMInwAAACjCB8AAMAowgcAADCK8AEAAIwifAAAAKMIHwAAwCjCBwAAMIrwAQAAjCJ8AAAAowgfAADAKMIHAAAwivABAACMInwAAACjCB8AAMAowgcAADCK8AEAAIwifAAAAKMIHwAAwKgmh49NmzZp+PDhSklJkcvl0sqVK2tu8/v9mjp1qnr37q327dsrJSVFDz74oI4dO2ZnzQAAIII1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bYmjt3rlwul7Kzs50uJawcPXpUDzzwgDp27KiYmBj17t1bu3btcrqssFBVVaWcnBylp6crJiZG3bp108yZMxv341Kt1KZNmzR8+HClpKTI5XJp5cqVtW63LEszZsxQcnKyYmJilJGRoQMHDjhTrEMa6pHf79fUqVPVu3dvtW/fXikpKXrwwQd17Ngx5wo2LNg+9EOPPvqoXC6X8vPzjdXXUq0+fBQXFysrK0vbtm1TUVGR/H6/Bg8erIqK1verqy21c+dOvfLKK7ryyiudLiWsfPvttxowYIDcbrfWrFmjf/7zn3rxxRfVoUMHp0sLC/PmzdPixYv18ssv6/PPP9e8efM0f/58vfTSS06X5piKigr16dNHixYtqvf2+fPna+HChVqyZIm2b9+u9u3ba8iQITp79qzhSp3TUI8qKytVUlKinJwclZSU6L333tO+fft05513OlCpM4LtQ9UKCwu1bdu2Rv2eSlix45dsI0lZWZklySouLna6lLBy+vRpq3v37lZRUZF16623WpMmTXK6pLAxdepU66abbnK6jLA1bNgwa8KECbXG7r77bmvMmDEOVRReJFmFhYU11wOBgJWUlGS98MILNWOnTp2yPB6P9fbbbztQofN+3KP67Nixw5JkHT582ExRYeRc/fn3v/9tXXTRRdbevXutSy65xPrtb39rvLbmavVnPn6svLxckpSYmOhwJeElKytLw4YNU0ZGhtOlhJ1Vq1apX79+uvfee9W5c2ddddVVevXVV50uK2zceOONWr9+vfbv3y9J+vjjj7V582YNHTrU4crCU2lpqY4fP17rtZaQkKDrrrtOW7dudbCy8FZeXi6XyxXSHx6NJIFAQGPHjtWUKVPUs2dPp8tpspD89+rhKhAIKDs7WwMGDFCvXr2cLidsLFu2TCUlJdq5c6fTpYSlL774QosXL9bkyZP17LPPaufOnZo4caLatm2rcePGOV2e46ZNmyav16sePXooKipKVVVVmjVrlsaMGeN0aWHp+PHjklTn5ya6dOlScxtqO3v2rKZOnar7778/7H7F1Snz5s1TdHS0Jk6c6HQpzXJehY+srCzt3btXmzdvdrqUsHHkyBFNmjRJRUVFateundPlhKVAIKB+/fpp9uzZ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uklhvdjWQAAAAASUVORK5CYII=", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df_expr[[\"value\"]].hist(bins=30)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
generaw_value_1raw_value_2raw_value_3raw_value_4valuehighlowscore
0b000811.21126512.03098412.01737111.67417911.733450101
1b011411.76711811.58164911.88583311.57104511.701411101
2b011511.02053110.81358911.14457311.36213811.085208101
3b011610.29906810.56296310.78809410.42545910.518896101
4b01186.1161226.4375546.9566866.2294196.434945000
..............................
131b41539.64725510.0891108.6858518.9023729.331147101
132b41549.1767399.3875458.8418188.5106118.979178101
133b42329.4902109.2010199.3211759.2355119.311979101
134b43012.3355972.3383722.3179672.2701612.31552401-1
135b43952.4310052.8277512.8228222.8251722.72668701-1
\n", "

136 rows × 9 columns

\n", "
" ], "text/plain": [ " gene raw_value_1 raw_value_2 raw_value_3 raw_value_4 value \\\n", "0 b0008 11.211265 12.030984 12.017371 11.674179 11.733450 \n", "1 b0114 11.767118 11.581649 11.885833 11.571045 11.701411 \n", "2 b0115 11.020531 10.813589 11.144573 11.362138 11.085208 \n", "3 b0116 10.299068 10.562963 10.788094 10.425459 10.518896 \n", "4 b0118 6.116122 6.437554 6.956686 6.229419 6.434945 \n", ".. ... ... ... ... ... ... \n", "131 b4153 9.647255 10.089110 8.685851 8.902372 9.331147 \n", "132 b4154 9.176739 9.387545 8.841818 8.510611 8.979178 \n", "133 b4232 9.490210 9.201019 9.321175 9.235511 9.311979 \n", "134 b4301 2.335597 2.338372 2.317967 2.270161 2.315524 \n", "135 b4395 2.431005 2.827751 2.822822 2.825172 2.726687 \n", "\n", " high low score \n", "0 1 0 1 \n", "1 1 0 1 \n", "2 1 0 1 \n", "3 1 0 1 \n", "4 0 0 0 \n", ".. ... ... ... \n", "131 1 0 1 \n", "132 1 0 1 \n", "133 1 0 1 \n", "134 0 1 -1 \n", "135 0 1 -1 \n", "\n", "[136 rows x 9 columns]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_expr[\"high\"] = (df_expr[\"value\"] >= 8).astype(int)\n", "df_expr[\"low\"] = (df_expr[\"value\"] <= 4).astype(int)\n", "df_expr[\"score\"] = df_expr[\"high\"] - df_expr[\"low\"]\n", "df_expr" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "values = df_expr[[\"gene\", \"score\"]].set_index(\"gene\").to_dict()[\"score\"]\n", "e = evaluate_gpr_expression(G.get_attr_from_edges(\"GPR\"), values)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Problem(Minimize(Expression(AFFINE, UNKNOWN, ())), [Inequality(Constant(CONSTANT, UNKNOWN, (91,))), Inequality(Variable((91,), _flow)), Equality(Expression(AFFINE, UNKNOWN, (77,)), Constant(CONSTANT, ZERO, ())), Inequality(Expression(AFFINE, NONNEGATIVE, (91,))), Equality(Expression(AFFINE, NONNEGATIVE, (36,)), Constant(CONSTANT, ZERO, ())), Inequality(Expression(AFFINE, UNKNOWN, (91,))), Inequality(Variable((91,), _flow)), Inequality(Expression(AFFINE, NONNEGATIVE, (91,))), Inequality(Variable((91,), _or, boolean=True))])" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from corneto.methods.metabolism.fba import multicondition_imat\n", "\n", "P = multicondition_imat(G, np.array(e))\n", "P.solve(solver=\"SCIP\")" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
flux
EX_ac_b7.899518
EX_akg_b0.000000
EX_co2_b0.000000
EX_etoh_b8.361255
EX_for_b17.265258
......
TALA0.043150
THD23.593395
TKT10.043150
TKT2-0.043150
TPI9.676293
\n", "

91 rows × 1 columns

\n", "
" ], "text/plain": [ " flux\n", "EX_ac_b 7.899518\n", "EX_akg_b 0.000000\n", "EX_co2_b 0.000000\n", "EX_etoh_b 8.361255\n", "EX_for_b 17.265258\n", "... ...\n", "TALA 0.043150\n", "THD2 3.593395\n", "TKT1 0.043150\n", "TKT2 -0.043150\n", "TPI 9.676293\n", "\n", "[91 rows x 1 columns]" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_sol = pd.DataFrame(\n", " P.expr.flow.value, index=G.get_attr_from_edges(\"id\"), columns=[\"flux\"]\n", ")\n", "df_sol" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "60" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "selected_reactions = df_sol[df_sol.flux.abs() >= 1e-6].index.values.tolist()\n", "len(selected_reactions)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "60.0" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sum(P.expr._flow_ipos.value + P.expr._flow_ineg.value)" ] } ], "metadata": { "kernelspec": { "display_name": "corneto-N5Qo8YGQ-py3.9", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.13" } }, "nbformat": 4, "nbformat_minor": 2 }