# Fluxomics¶

C13ConfidenceInterval(v0, expdata, model, max_score, directions, majorIterationLimit)[source]

Usage

[vs, output, v0] = C13ConfidenceInterval(v0, expdata, model, max_score, directions, majorIterationLimit)

Inputs

• v0 – set of flux vectors to be used as initial guesses. They may be valid or not.
• expdata – experimental data
• model – the standard model. Additional field .N (= null(S)) should also be provided. This is a basis of the flux space.
• max_score – maximum allowable data fit error

Optional inputs

• directions – ones and zeros of which reactions to compute (size = n x 1) or numbers of reactions to use aka. [1; 5; 7; 8; 200] or reaction strings aka. {‘GPK’, ‘PGL’}. Ratios are possible with this input only. Default = [] meaning - do FVA with no ratios.
• majorIterationLimit – default = 10000

Outputs

• vs – matrix
• output – structure
• v0 – as in input
compareBinsOfFluxes(xglc, model, sammin, sammax, metabolites)[source]

Takes the overall sammin and sammax samples, bins them into separate bin sizes and compares them, then compares the results to the largest bin size. calls [totalz, zscore, mdv1, mdv2] = compareTwoSamp(xglc, model, samp1, samp2, measuredMetabolites) sammin and sammax each contain bins of fluxes in x.samps(r,1).points

Usage

[output] = compareBinsOfFluxes(xglc, model, sammin, sammax, metabolites)

Inputs

• xglc – sugar distribution
• model – model structure
• sammin – samples containing bins of fluxes
• sammax – samples containing bins of fluxes

Optional input

• metabolites – list of metabolites

Output

• output – result of comparison
compareMultSamp(xglc, model, samps, measuredMetabolites)[source]

Compare the multiple sets of samples

Usage

[totalz, zscore, mdvs] = compareMultSamp(xglc, model, samps, measuredMetabolites)

Inputs

• xglc – sugar distribution, a random sugar distribution is calculated if empty
• model – model structure, expects model.rxns to contain a list of rxn names
• samps – samples, expects to have a field named points containing an array of sampled points

Optional input

• measuredMetabolites – parameter fed to calcMDVfromSamp.m which only calculates the MDVs for the metabolites listed in this array

Outputs

• totalz – sum of all zscores
• zscore – calculated difference for each mdv element distributed across all the points
• mdvs – contains fields:
• mdv - the calculated mdv distribution converted from the idv solved from each point contained in their respective samples sampX
• names - the names of the metabolites
• ave - the average of each mdv element across all of the points
• stdev - the standard dev for each mdv element across all points
compareTwoMDVs(mdv1, mdv2)[source]

Compares the 2 sets of mdvs

Usage

[totalz, zscore] = compareTwoMDVs(mdv1, mdv2)

Input

• mdv1, mdv2 – contains fields:
• mdv - the calculated mdv distribution converted from the idv solved from each point contained in their respective samples sampX
• names - the names of the metabolites
• ave - the average of each mdv element across all of the points
• stdev - the standard dev for each mdv element across all points

Outputs

• totalz – sum of all zscores
• zscore – calculated difference for each mdv element distributed across all the points
compareTwoSamp(xglc, model, samp1, samp2, measuredMetabolites)[source]

Compare the 2 sets of samples

Usage

[totalz, zscore, mdvs] = compareMultSamp(xglc, model, samps, measuredMetabolites)

Inputs

• xglc – sugar distribution, a random sugar distribution is calculated if empty
• model – model structure, expects model.rxns to contain a list of rxn names
• samp1, samp2 – samples, expects samp1 and samp2 to have a field named points containing an array of sampled points

Optional input

• measuredMetabolites – parameter fed to calcMDVfromSamp.m which only calculates the MDVs for the metabolites listed in this array

Outputs

• totalz – sum of all zscores
• zscore – calculated difference for each mdv element distributed across all the points
• mdv1, mdv2 – contains fields:
• mdv - the calculated mdv distribution converted from the idv solved from each point contained in their respective samples sampX
• names - the names of the metabolites
• ave - the average of each mdv element across all of the points
• stdev - the standard dev for each mdv element across all points
fitC13Data(v0, expdata, model, majorIterationLimit)[source]

Usage

[vout, rout] = fitC13Data(v0, expdata, model, majorIterationLimit)

Inputs

• v0 – It will automatically be converted to alpha by solving N*alpha = v; if v0 is a matrix then it is assumed to be a multiple start situation and vout will also have this size.
• expdata – either a data structure or a cell array of structures, in which case it is assumed that you wan to fit the sum of the scores
• model – model structure

Optional input

• majorIterationLimit – max number of iterations solver is allowed to take. Default = 1000

Outputs

• vout – reflects size of v0, result of NLPsolution
• rout – cell, result of NLPsolution
getBinsOfFluxes(samp, numfluxes, numbins)[source]

Takes a samp.points fluxes and bin them by numfluxes (remainder not used) or divide up in to bins of fluxes by numbins (remainder not used) sample each bin of fluxes and compare the differences between them.

Usage

[output] = getBinsOfFluxes(samp, numfluxes, numbins)

Inputs

• samp – fluxes
• numfluxes – default = 100
• numbins – default = []

Output

• output – structure with .samps field
getCompareBinsOfFluxes(xglc, model, samplo, samphi, metabolites)[source]

Compares the bins of fluxes between samplo and samphi, calls compareBinsOfFluxes(xglc, model, sammin, sammax, metabolites). samplo and samphi each contain samples in x.points

Usage

[output] = getCompareBinsOfFluxes(xglc, model, samplo, samphi, metabolites)

Inputs

• xglc – sugar distribution
• model – model structure
• samplo – samples containing bins of fluxes
• samphi – samples containing bins of fluxes

Optional input

• metabolites – list of metabolites

Output

• output – result of comparison
getRandGlc()[source]

Generates random glucose in isotopomer format

Usage

[xGlc] = getRandGlc()

Output

• xGlc – random glucose
goodInitialPoint(model, n)[source]

Generates 4*length(model.lb) random points, takes linear combinations of them so that all points are in the interior.

Usage

[out] = goodInitialPoint(model, n)

Inputs

• model – model structure
• n – number, default = 1

Output

• out – random points with linear combinations
isotopomerViewer(mdv1, mdv2, names)[source]

Takes in an “experiment” and views the isotopomer as distributions between mdv1 and mdv2. No output.

Usage

isotopomerViewer(mdv1, mdv2, names)

Inputs

• mdv1, mdv2 – structures
• names – names in the plot
naturallabel(n)[source]

Returns a natural label idv of n carbons. Assumes 1.1% C13

Usage

[out] = naturallabel(n)

Input

• n – size of label

Output

• out – natural label idv of n carbons
runHiLoExp(experiment)[source]

Takes an experiment with the following structure and splits the sample space at the median of a target flux solves the two spaces with a given sugar and compares the resulting mdvs to provide a z-score.

Usage

[experiment] = runHiLoExp(experiment)

Inputs

• experiment – contains:

• model with fields:

• S = the stoichiometric matrix
• rxns = array of reaction names, corresponding the S
• c = optimization target 1, or -1
• ub,lb = upper and lower bounds of reactions
• points = a #fluxes X #samples (~2000) array of the solution space if missing or empty, will generate a sample

• glcs = an array of sugars in isotopomer format, each column a separate sugar. Should not be in MDV format. Conversion is done automatically. will default to generate 1 random sugar if set to []

• targets = an array of cells with string for the reaction to split on the solution space, defaults to ‘PGL’

• thresholds = #targets X 1 array of thresholds

• metabolites = an optional parameter fed to calcMDVfromSamp.m which only calculates the MDVs for the metabolites listed in this array. e.g - optionally, metabolites can also be a structure of fragments

• hilo = a #targets X #samples array of 0/1’s, 0 id’s the sample of fluxes as the lo side and 1 id’s the sample for the hi side. hilo will only be calculated/recalculated if it’s missing or if the targets have been replaced using the param list

• mdvs = structure of mdv results:

• (name) = name of the run = t + glc# e.g. t1, t2, glc# refers to the glc in the glcs array.

Note that the split of mdvs are not stored, also since the only time mdvs should be regen’d is when glcs has changed, but we have no way of knowing when this happens, the user will have to manually empty out mdvs to have it regenerated.

• zscores = array of zscores from each run, targets X glcs

• rscores = array of ridge scores from each run, targets X glcs

• target – an optional string for a specific rxn to target. if supplied, it will override and replace the targets field in the experiment structure.

• threshold – an optional number to apply on the solution space fluxes if supplied, it will be applied to the hilo field and replace the hilo splits.

Output

• experiment – the experiment array.

This code will loop through one experiment per sugar, per target

score_KS(mdv, hilo, lambda)[source]

Calculates KS score

Usage

[out] = score_ridge(mdv, hilo, lambda, crossval)

Inputs

• mdv – structure
• hilo – (0’s and 1’s), ideally there will be a similar # of each.

Optional input

• lambda – weighting, if the mean is less than lambda, the scores get weighted less, default = .02

Output

• out – score
score_ridge`(mdv, hilo, lambda, crossval)[source]

Calculates ridge score

Usage

[out] = score_ridge(mdv, hilo, lambda, crossval)

Inputs

• mdv – structure
• hilo – (0’s and 1’s), ideally there will be a similar # of each.

Optional inputs

• lambda – ridge parameter, default = .01
• crossval – whether to do cross validation. This severely slows down the computation, default is no.

Output

• out – score