diff --git a/Data/TAModel/.~lock.Sinha-etal_2021_transcript-data.xlsx# b/Data/TAModel/.~lock.Sinha-etal_2021_transcript-data.xlsx# new file mode 100644 index 0000000..ce47613 --- /dev/null +++ b/Data/TAModel/.~lock.Sinha-etal_2021_transcript-data.xlsx# @@ -0,0 +1 @@ +,samiralvdb,QPE-IAMBPC156,28.02.2024 17:17,file:///home/samiralvdb/.config/libreoffice/4; \ No newline at end of file diff --git a/Data/TAModel/2024-02-27_gene_enzyme_reaction_relation_Ecoli.xlsx b/Data/TAModel/2024-02-27_gene_enzyme_reaction_relation_Ecoli.xlsx new file mode 100644 index 0000000..462fe31 Binary files /dev/null and b/Data/TAModel/2024-02-27_gene_enzyme_reaction_relation_Ecoli.xlsx differ diff --git a/Data/TAModel/GeneList_ecoli.xlsx b/Data/TAModel/GeneList_ecoli.xlsx new file mode 100644 index 0000000..3a660b7 Binary files /dev/null and b/Data/TAModel/GeneList_ecoli.xlsx differ diff --git a/Data/TAModel/Sinha-etal_2021_flux-data.xlsx b/Data/TAModel/Sinha-etal_2021_flux-data.xlsx new file mode 100644 index 0000000..e0a7abc Binary files /dev/null and b/Data/TAModel/Sinha-etal_2021_flux-data.xlsx differ diff --git a/Scripts/.ipynb_checkpoints/create_ecolicore_pam_incl_UE-checkpoint.ipynb b/Scripts/.ipynb_checkpoints/create_ecolicore_pam_incl_UE-checkpoint.ipynb index 6da6cce..6ffe3a1 100644 --- a/Scripts/.ipynb_checkpoints/create_ecolicore_pam_incl_UE-checkpoint.ipynb +++ b/Scripts/.ipynb_checkpoints/create_ecolicore_pam_incl_UE-checkpoint.ipynb @@ -26,24 +26,18 @@ "metadata": {}, "outputs": [ { - "ename": "ImportError", - "evalue": "attempted relative import with no known parent package", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mImportError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m/tmp/ipykernel_10917/4068919364.py\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# load PAMpy modules\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0msys\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'../src/PAModelpy'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0mPAModel\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mPAModel\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 4\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mEnzymeSectors\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mActiveEnzymeSector\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mUnusedEnzymeSector\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTransEnzymeSector\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mPAMValidator\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mPAMValidator\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/Documents/3_Projects/MCA_analysis/PAMpy/Scripts/../src/PAModelpy/PAModel.py\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 14\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 15\u001b[0m \u001b[0;31m# sys.path.append('../')\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 16\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0;34m.\u001b[0m\u001b[0mEnzymeSectors\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mActiveEnzymeSector\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTransEnzymeSector\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mUnusedEnzymeSector\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mCustomSector\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mSector\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 17\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0;34m.\u001b[0m\u001b[0mCatalyticEvent\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mCatalyticEvent\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 18\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0;34m.\u001b[0m\u001b[0mConstraints\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mConstraint\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mImportError\u001b[0m: attempted relative import with no known parent package" + "name": "stdout", + "output_type": "stream", + "text": [ + "Loading PAModelpy modules version 0.0.3.3\n" ] } ], "source": [ "# load PAMpy modules\n", - "sys.path.append('../src/PAModelpy')\n", - "from PAModel import PAModel\n", - "from EnzymeSectors import ActiveEnzymeSector, UnusedEnzymeSector, TransEnzymeSector\n", - "from PAMValidator import PAMValidator" + "from PAModelpy.PAModel import PAModel\n", + "from PAModelpy.EnzymeSectors import ActiveEnzymeSector, UnusedEnzymeSector, TransEnzymeSector\n", + "from PAModelpy.PAMValidator import PAMValidator" ] }, { @@ -63,6 +57,11 @@ "output_type": "stream", "text": [ "Set parameter Username\n", + "\n", + "--------------------------------------------\n", + "Warning: your license will expire in 9 days\n", + "--------------------------------------------\n", + "\n", "Academic license - for non-commercial use only - expires 2024-03-07\n", "Objective\n", "=========\n", @@ -88,16 +87,11 @@ ], "source": [ "# load the model\n", - "model = cobra.io.load_json_model('../models/e_coli_core.json')\n", + "model = cobra.io.load_json_model('../Models/e_coli_core.json')\n", "# test the model\n", "sol_t = model.optimize()\n", - "print(model.summary())" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ + "print(model.summary())\n", + "\n", "# Build E. coli core PAM\n", "## Create Protein Sectors\n", "### Active Enzymes" @@ -291,7 +285,7 @@ ], "source": [ "# load enzyme database from genome-scale E. coli PAM\n", - "enzyme_db = pd.read_excel('../data/proteinAllocationModel_iML1515_EnzymaticData_py.xls',\n", + "enzyme_db = pd.read_excel('../Data/proteinAllocationModel_iML1515_EnzymaticData_py.xls',\n", " sheet_name='ActiveEnzymes', index_col=0)\n", "\n", "# correct reaction IDS\n", @@ -655,7 +649,8 @@ "outputs": [], "source": [ "# total protein constraint (cf. analyze_proteome.ipynb)\n", - "p_tot = 0.16995 # g/gDW -> Standard 0.14 g/gDW " + "# p_tot = 0.16995 # g/gDW -> Standard 0.14 g/gDW \n", + "p_tot = 0.185" ] }, { @@ -674,24 +669,20 @@ "name": "stdout", "output_type": "stream", "text": [ - "Read LP format model from file /tmp/tmpt4uya5mx.lp\n", + "Read LP format model from file /tmp/tmpb6ewyrcx.lp\n", "Reading time = 0.00 seconds\n", ": 72 rows, 190 columns, 720 nonzeros\n", "Setting up the proteome allocation model e_coli_core\n", "\n", "Add total condition-dependent protein constraint\n", - "\tTotal protein concentration: 0.16995 g/gDW\n", + "\tTotal protein concentration: 0.185 g/gDW\n", "\n", "Add active protein sector\n", "\n", "Add the following protein sector: TranslationalProteinSector\n", "\n", - "169.95 TranslationalProteinSector 49.92 120.02999999999999\n", - "-0.002944\n", - "Add the following protein sector: UnusedEnzymeSector\n", + "Add the following protein sector: \n", "\n", - "120.02999999999999 UnusedEnzymeSector 40.7 79.32999999999998\n", - "-0.0214\n", "Done with setting up the proteome allocation model e_coli_core\n", "\n" ] @@ -721,22 +712,163 @@ "cell_type": "code", "execution_count": 11, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "{'EX_ac_e': EX_glc__D_e EX_ac_e\n", + " 0 -3.026940 0.000000\n", + " 1 -3.329634 0.000000\n", + " 2 -3.619167 0.159000\n", + " 3 -4.060529 0.270000\n", + " 4 -5.044900 0.680000\n", + " 5 -5.285133 0.624000\n", + " 6 -6.581834 1.657500\n", + " 7 -6.902899 1.708500\n", + " 8 -7.600000 4.800000\n", + " 9 -0.900000 0.000000\n", + " 10 -1.200000 0.000000\n", + " 11 -1.100000 0.000000\n", + " 12 -1.700000 0.000000\n", + " 13 -1.800000 0.000000\n", + " 14 -2.000000 0.000000\n", + " 15 -2.800000 0.000000\n", + " 16 -4.200000 0.000000\n", + " 17 -4.600000 0.000000\n", + " 18 -5.700000 0.000000\n", + " 19 -5.800000 0.000000\n", + " 29 1.520000 0.000000\n", + " 30 -2.470000 0.000000\n", + " 31 -4.250000 0.000000\n", + " 32 -5.650000 0.000000\n", + " 33 -9.530000 3.490000\n", + " 34 -6.650000 2.950000\n", + " 35 -0.699706 0.000000\n", + " 36 -1.204666 0.000000\n", + " 37 -2.154266 0.000000\n", + " 38 -3.345144 0.000000\n", + " 39 -4.692853 0.155090\n", + " 40 -5.945775 1.841697\n", + " 41 -7.874274 6.109449\n", + " 46 -11.300000 7.100000\n", + " 47 -2.300000 0.000000\n", + " 48 -8.590000 3.910000\n", + " 49 -7.810000 3.260000\n", + " 50 -7.540000 2.720000\n", + " 51 -9.530000 3.490000\n", + " 52 -9.650000 6.830000,\n", + " 'EX_co2_e': EX_glc__D_e EX_co2_e\n", + " 0 -3.026940 6.614400\n", + " 1 -3.329634 7.228800\n", + " 2 -3.619167 8.265000\n", + " 3 -4.060529 8.157000\n", + " 4 -5.044900 10.496000\n", + " 5 -5.285133 9.544000\n", + " 7 -6.902899 10.806900\n", + " 35 -0.699706 1.987149\n", + " 36 -1.204666 2.808187\n", + " 37 -2.154266 4.531176\n", + " 38 -3.345144 6.590909\n", + " 39 -4.692853 8.689910\n", + " 40 -5.945775 10.298667\n", + " 41 -7.874274 8.576868\n", + " 42 -1.520000 4.696800\n", + " 43 -2.470000 6.891300\n", + " 44 -4.250000 13.107000\n", + " 45 -5.650000 17.356800\n", + " 46 -11.300000 19.600000\n", + " 47 -2.300000 9.000000,\n", + " 'EX_o2_e': EX_glc__D_e EX_o2_e\n", + " 35 -0.699706 -2.161836\n", + " 36 -1.204666 -2.886473\n", + " 37 -2.154266 -4.746377\n", + " 38 -3.345144 -10.000000\n", + " 39 -4.692853 -10.640097\n", + " 40 -5.945775 -15.374396\n", + " 41 -7.874274 -13.188406\n", + " 42 -1.520000 -4.750000\n", + " 43 -2.470000 -6.640000\n", + " 44 -4.250000 -12.580000\n", + " 45 -5.650000 -16.820000\n", + " 46 -11.300000 -18.800000\n", + " 47 -2.300000 -8.700000,\n", + " 'BIOMASS_Ecoli_core_w_GAM': EX_glc__D_e BIOMASS_Ecoli_core_w_GAM\n", + " 0 -3.026940 0.240000\n", + " 1 -3.329634 0.240000\n", + " 2 -3.619167 0.300000\n", + " 3 -4.060529 0.300000\n", + " 4 -5.044900 0.400000\n", + " 5 -5.285133 0.400000\n", + " 6 -6.581834 0.510000\n", + " 7 -6.902899 0.510000\n", + " 8 -7.600000 0.650000\n", + " 9 -0.900000 0.040000\n", + " 10 -1.200000 0.050000\n", + " 11 -1.100000 0.060000\n", + " 12 -1.700000 0.090000\n", + " 13 -1.800000 0.090000\n", + " 14 -2.000000 0.110000\n", + " 15 -2.800000 0.190000\n", + " 16 -4.200000 0.290000\n", + " 17 -4.600000 0.310000\n", + " 18 -5.700000 0.400000\n", + " 19 -5.800000 0.410000\n", + " 20 -2.660000 0.210000\n", + " 21 -3.810000 0.310000\n", + " 22 -4.910000 0.410000\n", + " 23 -6.240000 0.510000\n", + " 24 -2.780000 0.220000\n", + " 25 -3.250000 0.260000\n", + " 26 -4.360000 0.360000\n", + " 27 -5.520000 0.460000\n", + " 28 -6.240000 0.510000\n", + " 29 1.520000 0.100000\n", + " 30 -2.470000 0.200000\n", + " 31 -4.250000 0.300000\n", + " 32 -5.650000 0.400000\n", + " 33 -9.530000 0.730000\n", + " 34 -6.650000 0.610000\n", + " 35 -0.699706 -0.053081\n", + " 36 -1.204666 -0.101840\n", + " 37 -2.154266 -0.191799\n", + " 38 -3.345144 -0.298272\n", + " 39 -4.692853 -0.411342\n", + " 40 -5.945775 -0.496032\n", + " 41 -7.874274 -0.602263\n", + " 42 -1.520000 0.100000\n", + " 43 -2.470000 0.200000\n", + " 44 -4.250000 0.300000\n", + " 45 -5.650000 0.400000\n", + " 46 -11.300000 0.850000\n", + " 47 -2.300000 0.120000\n", + " 48 -8.590000 0.690000\n", + " 49 -7.810000 0.590000\n", + " 50 -7.540000 0.610000\n", + " 51 -9.530000 0.730000\n", + " 52 -9.650000 0.650000}" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "# load phenotype data from excel file\n", - "pt_data = pd.read_excel('../data/Ecoli_phenotypes_py_rev.xls', sheet_name='Yields', index_col=None)\n", - "pt_data\n", + "pt_data = pd.read_excel('../Data/Ecoli_phenotypes/Ecoli_phenotypes_py_rev.xls', sheet_name='Yields', index_col=None)\n", "\n", "# extract reaction specific data \n", "rxn_to_pt = {}\n", - "rxn_transform = {\n", - " 'EX_ac_e': 'Acetate_OUT',\n", - " 'EX_co2_e': 'CO2_OUT',\n", - " 'EX_o2_e': 'O2_IN',\n", - " 'BIOMASS_Ecoli_core_w_GAM': 'mu'\n", - "}\n", - "for rxn_id, pt_id in rxn_transform.items():\n", - " rxn_to_pt[rxn_id] = pt_data[['Glucose_IN', pt_id]].dropna().rename(columns={pt_id: rxn_id})\n" + "rxn_transform = {'BIOMASS_Ec_iML1515_core_75p37M':'BIOMASS_Ecoli_core_w_GAM'}\n", + "rxns = ['EX_ac_e','EX_co2_e','EX_o2_e', 'BIOMASS_Ec_iML1515_core_75p37M']\n", + "for rxn_id in rxns:\n", + " if rxn_id in rxn_transform.keys(): \n", + " rxn_to_pt[rxn_transform[rxn_id]] = pt_data[['EX_glc__D_e', rxn_id]].dropna().rename(columns = {rxn_id: rxn_transform[rxn_id]})\n", + " else:\n", + " rxn_to_pt[rxn_id] = pt_data[['EX_glc__D_e', rxn_id]].dropna()\n", + " \n", + "\n", + "rxn_to_pt" ] }, { @@ -754,7 +886,7 @@ { "data": { "text/html": [ - "Optimal solution with objective value 0.653
\n", + "Optimal solution with objective value 0.679
\n", "