Comparison#

MATLAB functions in RAVEN/src/comparison of the RAVEN toolbox.

Functions#

Function

Summary

compareMultipleModels

Compare two or more condition-specific models.

diffModels

Report the semantic differences between two models.

Reference#

compareMultipleModels#

function compStruct = compareMultipleModels(models,varargin)

Compare two or more condition-specific models.

Compares two or more models on overlap of reactions, metabolites, genes, EC-codes, metabolite names and reaction equations (with and without compartmentalization), and on high-dimensional comparisons in the reaction-space: subsystem utilization, structural similarity, an optional low-dimensional structural projection, and an optional functional (task-based) comparison.

Parameters

models : cell

cell array of two or more models.

Name-Value Arguments

printResults : logical

true if the results should be printed on the screen (default false).

plotResults : logical

true if the results should be plotted (default false).

groupVector : double or cell

numeric vector or cell array for grouping similar models, i.e. by tissue (default all models ungrouped).

funcCompare : logical

should a functional comparison be run (default false).

taskFile : char

string containing the name of the task file to use for the functional comparison (should be an .xls or .xlsx file, required for functional comparison).

Returns

compStruct : struct

structure that contains the comparison results, with fields:

  • modelIDs : cell array of model ids

  • rxns, mets, genes, eccodes, metNames, equ, uEqu : the overlap for each field, each with sub-fields comparison (binary matrix where each row indicates which models are included in the comparison) and nElements (vector with the number of elements for each comparison). "equ" are the reaction equations after sorting and "uEqu" are the equations when not taking compartmentalization into account. These are the only fields of the seven that use EC-code, metabolite name or reaction equation to compare models that do not share an id convention; the rest compare by identifier only.

  • subsystems : substructure containing subsystem information, with fields matrix (matrix with comparison of number of rxns per subsystem) and ID (vector consisting of names of all subsystems)

  • reactions : substructure containing reaction information, with fields matrix (binary matrix composed of reactions (rows) in each model (column), used as the input for the model comparisons) and IDs (list of the reactions contained in the reaction matrix)

  • structComp : matrix with pairwise comparisons of model structure based on (1-Hamming distance) between models

  • structCompMap : matrix with 3D tSNE (or MDS) mapping of model structures based on Hamming distances

  • funcComp : substructure containing function comparison results, with fields matrix (matrix with PASS / FAIL (1 / 0) values for each task) and tasks (vector containing names of all tasks)

Examples

compStruct = compareMultipleModels(models, printResults, ...
    plotResults, groupVector, funcCompare, taskFile);

diffModels#

function report = diffModels(modelA, modelB, varargin)

Report the semantic differences between two models.

Compares two models entry by entry, keyed by identifier, and returns a report listing every difference found. Reactions, metabolites and genes are matched by id; for the ids present in both models the reaction stoichiometry, bounds, objective coefficient, grRule, EC codes, and the metabolite formula, charge and compartment are compared. This is the structured added/removed/changed diff that compareMultipleModels (which reports overlap counts, similarity and clustering across N models) does not provide.

grRules are compared for logical equality rather than as strings: each rule is expanded to disjunctive normal form and the genes within each isozyme, and the isozymes themselves, are sorted before comparison, so "a and b" equals "b and a" and "(a or b)" equals "(b or a)". This is stronger than a case/whitespace string match.

Parameters

modelA : struct

the first model.

modelB : struct

the second model.

Name-Value Arguments

stoichTol : double

absolute tolerance for stoichiometric coefficient differences (default 1e-9).

maxPerCategory : double

the maximum number of differences reported per category before the rest are truncated with a single summary line (default 50).

printResults : logical

print the report to the command window (default false).

Returns

report : struct

difference report with fields:

  • equal : true if no differences were found.

  • differences : cell array of human-readable difference strings, each naming the category and the entity affected.

  • rxnsOnlyInA / rxnsOnlyInB : reaction ids present in only one model.

  • metsOnlyInA / metsOnlyInB : metabolite ids present in only one model.

  • genesOnlyInA / genesOnlyInB : gene ids present in only one model.

Usage: report = diffModels(modelA, modelB, ...) :

See also

compareMultipleModels : N models, set membership across seven identity notions (ids, EC codes, metabolite names, equations), similarity matrix, clustering and an optional task-based functional comparison -- no values.