{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# MDV" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The Mass Isotopomer Distribution Vector (MDV) is a representation of the molar fraction of isotopomers of a metabolite fragment. It is the fundamental computational unit for 13C metabolic flux analysis. FreeFlux provides an `MDV` class for the manipulation of MDVs." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Creating a MDV" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A MDV object can be created using the MDV class constructor:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "MDV([0.112, 0.425, 0.315, 0.125, 0.022])\n", "[0.1121 0.4252 0.3153 0.1254 0.022 ]\n" ] } ], "source": [ "from freeflux import MDV\n", "\n", "mdv_oaa = MDV([0.1121, 0.4252, 0.3153, 0.1254, 0.0220])\n", "print(mdv_oaa)\n", "print(mdv_oaa.value) # value attribute returns a NumPy array" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The constructor keeps the elements of an MDV nonnegtive, and they will be normalized to ensure that the sum equals 1.\n", "\n", "The isotopic enrichment (or fractional lableing) of this MDV can be accessed by `fl` (or `fractional_labeling`) attribute:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.38" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mdv_oaa.fl" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## MDV Convolution" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1-D discrete convolution can be performed on MDVs, which yields the product MDV of a condensation reaction, such as OAA + AcCoA $\\rightarrow$ Cit. MDV convolution can be achieved using the `conv` function:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "MDV([0.026, 0.182, 0.391, 0.274, 0.107, 0.02, 0.001])\n" ] } ], "source": [ "from freeflux import conv\n", "\n", "mdv_accoa = MDV([0.2312, 0.7423, 0.0265])\n", "mdv_cit = conv(mdv_oaa, mdv_accoa)\n", "print(mdv_cit)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Convolution can be also be performed by calling the `conv` method:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "MDV([0.026, 0.182, 0.391, 0.274, 0.107, 0.02, 0.001])" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mdv_oaa.conv(mdv_accoa)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "or using the `*` operator:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "MDV([0.026, 0.182, 0.391, 0.274, 0.107, 0.02, 0.001])" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mdv_accoa*mdv_oaa" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Correcting for Natural Abundance" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To obtain the exclusive isotopomer distribution of the carbon skeleton of a metabolite fragment caused by the labeled substrate(s), the MDV should be corrected for the netural abundance of all other atoms with natural stable isotopes. For example:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "MDV([0.479, 0.321, 0.2, 0.001, 0.0])" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mdv_ala_23_raw = MDV([0.3711, 0.3211, 0.2348, 0.0561, 0.0169])\n", "mdv_ala_23_raw.correct_for_natural_abundance(\n", " atom_dict = {'C': 8, 'H': 26, 'O': 1, 'N': 1, 'Si': 2}\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "Note:

For accurate correction, a raw fragment MDV should be provided not only until M+<# of carbons in the compound> because isotopes of all other elements may contribute to the mass, including the carbons not in the carbon skeleton of compound (i.e., those derived from the derivatization reagent).\n", "\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Correcting for Inoculum" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Unlabeled fraction introduced by inoculum can be corrected using the following line:" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "MDV([0.104, 0.429, 0.318, 0.127, 0.022])" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mdv_oaa.correct_for_inoculum(fraction = 0.01) # 0.01 is the fraction of unlabeled biomass" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Calculating the MDV of an Unlabeled Fragment" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The `get_natural_MDV` method can be used to calculate the MDV of an unlabeled metabolite fragment that has a specific number of atoms (n_atoms)." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "MDV([0.958, 0.041, 0.001, 0.0, 0.0])" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from freeflux import get_natural_MDV\n", "\n", "get_natural_MDV(n_atoms = 4)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Calculating the MDV of a Labeled Substrate" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To calculate the MDV of a labeled substrate, we need to provide information about the labeling pattern, carbon atom number in the MDV (starting form 1), percentage of each isotopomer, and purity of the labeled substrate. Here is an example of how to use the `get_substrate_MDV` method to determine the MDV of the two-carbon mixture substrate comprised of 25% 12C-13C, 25% 13C-13C and 50% 12C-12C with 100% purity:" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "MDV([0.489, 0.258, 0.253])" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from freeflux import get_substrate_MDV\n", "\n", "get_substrate_MDV(\n", " atom_nos = [1, 2], \n", " labeling_pattern = ['01', '11'], \n", " percentage = [0.25, 0.25], # If 1 - sum(percentage) is less than 1, the remaining fraction is considered as unlabeled substrate.\n", " purity = [1, 1]\n", ")" ] } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:freeflux-py37]", "language": "python", "name": "conda-env-freeflux-py37-py" }, "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.7.0" } }, "nbformat": 4, "nbformat_minor": 4 }