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 compartmentalisation), and on high-dimensional comparisons of the reaction content: subsystem coverage, structural similarity, a low-dimensional structural projection (skipped when neither tsne nor mdscale is available), and an optional functional (task-based) comparison.

Parameters

models : cell

cell array of two or more models.

Name-Value Arguments

printResults : logical

true to print the results to the command window (default false).

plotResults : logical

true to plot the results (default false).

groupVector : double or cell

numeric vector or cell array that assigns each model to a group, for example by tissue. The groups colour the points of the structural projection plot (default [], no grouping).

funcCompare : logical

true to run the functional comparison, which requires taskFile (default false).

taskFile : char

name of the task file for the functional comparison, in a format that parseTaskList reads. Required when funcCompare is true.

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 without compartments. The fields rxns, mets and genes compare identifiers; eccodes, metNames, equ and uEqu compare EC codes, metabolite names and reaction equations, which allows overlap between models that use different identifiers.

  • subsystems : substructure containing subsystem information, with fields matrix (number of reactions per subsystem, subsystems in rows and models in columns) and ID (cell array with the names of all subsystems). Only the first subsystem of each reaction is counted. The field is absent when a model lacks the subSystems field.

  • reactions : substructure containing reaction information, with fields matrix (binary matrix with reactions in rows and models in columns, 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 the 3D tSNE (or MDS) mapping of model structures based on Hamming distances. It is empty when neither tsne nor mdscale is available.

  • funcComp : substructure containing function comparison results, with fields matrix (1 for a passed task and 0 for a failed task, tasks in rows and models in columns) and tasks (the descriptions of all tasks). It is present only when funcCompare is true.

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 and reported when present in only one model. For the ids present in both models, the reaction stoichiometry, bounds, objective coefficient, grRule and EC codes, and the metabolite formula, charge and compartment are compared.

grRules are compared by logical content: 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)".

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

maximum number of entries in report.differences per category. Further differences of that category are replaced by a single summary line (default 50).

printResults : logical

true to 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 entity affected.

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

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

  • genesOnlyInA and genesOnlyInB : gene ids present in only one model. Both are empty when either model lacks the genes field.

See also

compareMultipleModels : overlap counts, similarity and clustering across two or more models.