{ "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": [ "