Rfastcormics¶
- GPRrulesMapper(exp, x)[source]¶
The function evaluates Gene-Protein-Reaction (GPR) rules by mapping gene expression values to reactions using logical operators.
- USAGE:
[res] = GPRrulesMapper (exp, x)
- INPUTS:
exp – cell array with the expression to evaluate from the rules field
x – value to plug in
- OUTPUT:
res – the numeric corresponding to the result of the calculation
- constrainModelOnMedium(model, mediumMets, notMediumConstrained, biomassReaction, functionToKeep)[source]¶
The function constrains a metabolic model based on a defined medium by restricting exchange reactions, while preserving essential functions.
- USAGE:
[model] = constrainModelOnMedium (model, mediumMets, notMediumConstrained, biomassReaction, functionToKeep)
- INPUTS:
model – (the following fields are required - others can be supplied) * S - m x n Stoichiometric matrix * lb - n x 1 Lower bounds * ub - n x 1 Upper bounds * rxns - n x 1 cell array of reaction identifiers
mediumMets – cell array of metabolites defining the growth medium
notMediumConstrained – optional list of reactions/metabolites that should not be constrained
biomassReaction – string specifying the biomass reaction to preserve
functionToKeep – list of reactions that must remain active
- OUTPUT:
model – constrained metabolic model
- createFitL(xi, rest)[source]¶
CREATEFIT(XI,REST) (c)Maria Pires Pacheco 2016
Create a fit.
- Data for ‘untitled fit 1’ fit:
X Input : xi Y Output: rest
- Output:
fitresult : a fit object representing the fit. gof : structure with goodness-of fit info.
See also FIT, CFIT, SFIT.
- createFitR(x, hybrid_curve)[source]¶
CREATEFIT(X,HYBRIDE_CURVE) %(c) Maria Pires Pacheco 2016 Create a fit.
- Data for ‘untitled fit 1’ fit:
X Input : x Y Output: hybride_curve
- Output:
fitresult : a fit object representing the fit. gof : structure with goodness-of fit info.
See also FIT, CFIT, SFIT.
- discretizeFPKM(fpkm, colnames, figflag, pathFigures, fileFormat)[source]¶
- The function discretizes gene expression data (FPKM values) into three categories:
expressed, not expressed, and unknown, based on a zFPKM transformation and half-Gaussian density fitting.
- USAGE:
[discretized, scaledExpression] = discretizeFPKM (fpkm, colnames, figflag, pathFigures)
- INPUTS:
fpkm – m x n matrix or table of FPKM expression values (genes x samples)
colnames – 1 x n cell array of sample names
figflag – optional, flag to plot and save figures (default: 0)
pathFigures – optional, path to save figures (default: current folder)
fileFormat – optional, file format you want to store the figure as
- OUTPUTS:
discretized – m x n matrix of discretized values * 1 : expressed * 0 : unknown * -1 : not expressed
scaledExpression – scaled data after zFPKM transformation
- findOrganicExRxns(model, biomassReaction, functionToKeep)[source]¶
(c) Maria Pires Pacheco 2015 Close all the exchange reactions which are carbon sources except the biomass reaction, the reactions that are supplying the medium or those that are in the functionToKeep input
- fixIrr(model)[source]¶
The function converts irreversible backwards reactions into irreversible forward reactions
- USAGE:
[model] = fixIrr (model)
- INPUTS:
model – (the following fields are required - others can be supplied) * S - m x 1 Stoichiometric matrix * lb - n x 1 Lower bounds * ub - n x 1 Upper bounds * rxns - n x 1 cell array of reaction abbreviations
- OUTPUT:
model – model with corrected reversibilties
- mapExpressionToModel(model, data, dico, rownames, processTranscripts)[source]¶
The mapExpressionToModel function map the expression to a model following the GPR rules (Pacheco et al,2019)
- USAGE:
[mapping] = mapExpressionToModel (model, data, dico, rownames, processTranscripts)
- INPUTS:
model – (the following fields are required - others can be supplied) * S - m x 1 Stoichiometric matrix * lb - n x 1 Lower bounds * ub - n x 1 Upper bounds * rxns - n x 1 cell array of reaction abbreviations
data – expression or dicretized values for the samples, size(expression,1) = lenghth(gene IDs size(expression,2) = number of samples
dico – table which contains corresponding gene identifier information. Needed to map the rownames to the genes in the model. Can contain multiple columns, with different identifiers.
rownames – cell array with the gene IDs
- OPTIONAL INPUTS:
processTranscripts – 0 for inactive (default), 1 for active - if active, consider gene names of the model without any numbers after a “.”
- OUTPUTS:
mapping matrix containing the expression values that were mapped to the reactions acoording to the GPR rules – size(mapping,1) is equal to the number of reactions and size(mapping,2) is equal to size(data,2)
- rFastcormics(model, discretized, rownames, dico, biomassReactionName, consensusProportion, epsilon, optionalSettings, fillingMediumFlag, adaptiveScalingFlag)[source]¶
The rFASTCORMICS is a context-specific building algorithm for reconstructing a tissue, a cell-specific, or any context-specific model from RNAseq data and a generic reconstruction (Pacheco et al. 2019)
- USAGE:
[contextSpecificModel, retainedRxns, indicesCompletedCoreOrig] = rFastcormics (model, discretized, rownames, dico, biomassReactionName, consensusProportion, epsilon, optionalSettings, fillingMediumFlag, adaptiveScalingFlag)
- REQUIREMENTS:
Statistics and Machine Learning Toolbox
Curve fitting toolbox
- INPUTS:
model – object - the following fields are required - (others can be supplied) * S - m x 1 Stoichiometric matrix * lb - n x 1 Lower bounds * ub - n x 1 Upper bounds * rxns - n x 1 cell array of reaction abbreviations * metFormulas m*1 metabolite Formulas
discretized – double - discretized values for the samples, size(discretized, 1) = number of genes, size(discretized, 2) = number of samples
rownames – cell array with the gene IDs
dico – table which contains corresponding gene identifier information. Needed to map the rownames to the genes in the model.
biomassReactionName – character array with the name of the objective
- OPTIONAL INPUTS:
consensusProportion – the rate of samples that have to express or not to express a gene for the gene to be considered expressed or not in the context of interest (default 0.9)
epsilon – smallest flux that is considered nonzero (default = 1e-4)
optionalSettings – structure * .func - cell array of reaction abbreviations that should carry a flux * .medium - cell array of metabolites abbreviations that defines metabolites in the growth medium of cells to constrain the model * .notMediumConstrained - reaction abbreviations not included in the medium that must be retained
fillingMediumFlag – fill the medium with supplementary reactions in case the provided medium is not sufficient to fulfill the objective function. 1 for active (default), 0 for inactive
adaptiveScalingFlag – adaptive scaling of the flux values (see LP10). 0 for inactive (default), 1 for active
- OUTPUTS:
contextSpecificModel – context-specific model, reduced to the retained reactions and associated genes
retainedRxns – indices of the retained reactions in the input model
indicesCompletedCoreOrig – indices of the core reactions in the input model
Example
[contextSpecificModel, retainedRxns, indicesCompletedCoreOrig] = rFastcormics(model, discretized, rownames, dico, biomassReactionName)