{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Simulating at INST State" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "FreeFlux can estimate metabolic fluxes for organisms that uptake one-carbon compounds like autotrophs using carbon dioxide. For this, kinetics of intermediate MDVs are required at the isotopically non-stationary (INST) state. The derived MDVs will be a function of time." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To simulate MDVs at INST state, use the following commands, similar to those used for steady state:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from freeflux import Model\n", "\n", "MODEL_FILE = 'path/to/reactions.tsv'\n", "\n", "model = Model('demo')\n", "model.read_from_file(MODEL_FILE)\n", "\n", "isim = model.simulator('inst')\n", "isim.set_target_EMUs({\n", " 'Glu': [[1,2,3], '12345'], \n", " 'Cit': '2345'\n", "})\n", "isim.set_labeling_strategy(\n", " 'AcCoA', \n", " labeling_pattern = ['01', '11'], \n", " percentage = [0.25, 0.25], \n", " purity = [1, 1]\n", ")\n", "\n", "fluxes = {'v1': 10,\n", " 'v2': 10,\n", " 'v3': 5,\n", " 'v4': 5,\n", " 'v5': 5,\n", " 'v6_f': 12.5, # \"_f\" denotes forward flux\n", " 'v6_b': 7.5, # \"_b\" denotes backward flux\n", " 'v7': 5}\n", "for fluxid, value in fluxes.items():\n", " isim.set_flux(fluxid, value)\n", "\n", "# or read from file \n", "FLUXES_FILE = 'path/to/fluxes.tsv'\n", "isim.set_fluxes_from_file(FLUXES_FILE)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The input files can be found [here](https://github.com/Chaowu88/freeflux/tree/main/models/toy)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In addition to the fluxes, metabolite concentrations are also required for INST state simulation. The concentration of metabolites can be set as follows:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "concs = {'OAA': 0.1,\n", " 'Cit': 5,\n", " 'AKG': 0.3,\n", " 'Suc': 1,\n", " 'Fum': 0.2,\n", " 'Glu': 0.5}\n", "for concid, value in concs.items():\n", " isim.set_concentration(concid, value)\n", "\n", "# or read from file \n", "CONCS_FILE = 'path/to/concentrations.tsv'\n", "isim.set_concentrations_from_file(CONCS_FILE)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Lastly, set the time points when MDVs will be simulated:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "isim.set_timepoints([0, 0.1, 0.2, 0.5, 1, 2])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "