10.1.2.1.2. freeflux.core.mdv¶
Define the MDV class.
10.1.2.1.2.1. Attributes¶
10.1.2.1.2.2. Classes¶
Define MDV (i.e., mass isotopomer distribution vector) object and its operations. |
10.1.2.1.2.3. Functions¶
|
|
|
Calculate the MDV of an unlabeled fragment. |
|
Calculate the MDV of a fragment from labeled substrate. |
|
|
|
Perform convolution between two MDVs. |
|
10.1.2.1.2.4. Module Contents¶
- class freeflux.core.mdv.MDV(fractions, nonnegative=True, normalize=True, base_atom='C')[source]¶
Define MDV (i.e., mass isotopomer distribution vector) object and its operations.
Convolution between mdv1 and mdv2 can be performed in three ways: 1. mdv1.conv(mdv2); 2. mdv1*mdv2; 3. mdv.conv(mdv1, mdv2).
The zero element for convolution is MDV([0]), and the identity element is MDV([1]).
Scalar multiplication (a*mdv) and MDV addition (mdv1 + mdv2) are also supported. In these cases, the resulting MDV are not automatically normalized.
In addition to C, MDV can be built based on H, N, O, Si, and S.
- Parameters:
- correct_for_natural_abundance(atom_dict)[source]¶
- Parameters:
atom_dict (dict) – element needs to be corrected => # of corresponding atoms in metabolite (fragment).
- freeflux.core.mdv._isotopomer_combination(n_atoms, n_natural_isotops)[source]¶
- Parameters:
- Returns:
combs2
- Return type:
Example
>>> _isotopomer_combination(2, 3) OrderedDict([(0, [Counter({0: 2})]), (1, [Counter({0: 1, 1: 1})]), (2, [Counter({0: 1, 2: 1}), Counter({1: 2})]), (3, [Counter({1: 1, 2: 1})]), (4, [Counter({2: 2})])])
- freeflux.core.mdv.get_natural_MDV(n_atoms, base_atom='C')[source]¶
Calculate the MDV of an unlabeled fragment.
- freeflux.core.mdv.get_substrate_MDV(atom_nos, labeling_pattern, percentage, purity, label_atom='C')[source]¶
Calculate the MDV of a fragment from labeled substrate. Currently this function only supports H, C or N-labeled substrate.
- Parameters:
labeling_pattern (str or list of str) –
Labeling pattern of substrate, ‘0’ for unlabeled atom, ‘1’ for labeled atom, e.g., ‘100000’ for 1-13C glucose.
List if tracer with multiple labeling patterns are used.
Natural substrate (with all ‘0’s) don’t need to be explicitly set.
If str, labeling_pattern should not be natural substrate.
percentage (float or list of float) –
Molar percentage (in range of [0,1]) of corresponding tracer. Sum of percentage should be <= 1, and the rest will be considered as natural substrate.
List if tracer with multiple labeling patterns are used.
If list, len(percentage) should be equal to len(labeling_pattern).
If float, labeling_pattern should not be natural substrate.
purity (float or list of float) –
Labeled atom purity (in range of [0,1]) of corresponding tracer.
List if tracer with multiple labeling patterns are used.
If list, len(purity) should be equal to len(labeling_pattern).
If float, labeling_pattern should not be natural substrate.
label_atom (str) – Labeled atom, i.e., base atom in the MDV. Currently supports only “H”, “C” and “N”.
- freeflux.core.mdv.diff_conv(mdv_mdvder1, mdv_mdvder2)[source]¶
- Parameters:
mdv_mdvder1 (2-list of arrays) – namely [MDV, MDVder], MDVder in shape of (len(MDV), len(v))
mdv_mdvder2: – 2-list of arrays: namely [MDV, MDVder], MDVder in shape of (len(MDV), len(v))
- Returns:
mdv (array)
mdvder (2-D array) – In shape of (len(MDV), len(v)).