Main Content

SimBiology.DiffResults

Results of comparison between two SimBiology models and diagrams

Since R2022a

Description

SimBiology.DiffResults contains the results from comparing two SimBiology models and diagram information.

Creation

Use sbiodiff to compare the models and the function returns SimBiology.DiffResults as an output.

Properties

expand all

Results of comparison between two SimBiology models and their diagrams, specified as a table.

The table has the following columns:

  • Class — Model component type specified as a string. Note that for a variant, the table shows "Variant (X)", where X is the string "species", "compartment", or "parameter" depending on the type of the component referenced in the corresponding row of the variant content. For details on how SimBiology matches variants, see Doses and Variants.

  • Source — Source component name.

    • For a species, parameter, or compartment, the column shows a qualified name (such as cell.Ligand).

    • For a kinetic law, it shows "Kinetic Law (Y)", where Y is the parent reaction name.

    • For a rule, it shows the rule name. If the name is empty, it shows the value of the Rule property instead.

    • For an event, it shows the event name. If the name is empty, it shows the value of the Trigger property instead.

    • For a reaction, observable, dose, or variant, it shows the value of the Name property.

  • Target — Target component name (see the Source column for details)

  • Property — Name of the component property for which the value is shown in the SourceValue and TargetValue column.

  • SourceValue — Value of the corresponding property of the source component

  • TargetValue — Value of the corresponding property of the target component

The Property, SourceValue, and TargetValue show <missing> as the value for any deleted or inserted model component.

Tip

The Class, Source, Target, and Property columns contain strings. You can use these columns to select specific changes by using string comparisons. For instance, to get all modifications to the value of any parameter from the table, use:

diffResults = sbiodiff(m1,m2);
diffTbl = diffResults.Comparisons;
param_subset = diffTbl(diffTbl.Class == "Parameter" & diffTbl.Property == "Value",:);

To find <missing> values, use ismissing.

Data Types: table

Source model information, specified as a structure. The structure contains the following fields.

  • Project — Name of the SBPROJ file that contains the source model. If you specify the corresponding model as a SimBiology model object, this field value is "".

  • ModelName — SimBiology model name

  • Model — SimBiology model object

  • LastModified — Last modified date of the SBPROJ file. If you specify the corresponding model as a SimBiology model object, this field value is "".

Data Types: struct

Target model information, specified as a structure. The structure contains the following fields.

  • Project — Name of the SBPROJ file that contains the target model. If you specify the corresponding model as a SimBiology model object, this field value is "".

  • ModelName — SimBiology model name

  • Model — SimBiology model object

  • LastModified — Last modified date of the SBPROJ file. If you specify the corresponding model as a SimBiology model object, this field value is "".

Data Types: struct

Object Functions

getComponentsGet model components associated with SimBiology model comparison results
visdiffVisualize SimBiology model comparison results

Examples

collapse all

Load a source model.

model1      = sbmlimport("lotka");
y1          = sbioselect(model1, "Type", "species", "Name", "y1");
y1.Value    = 880;

Load a target model to compare against the source model.

model2      = sbmlimport("lotka");
y1          = sbioselect(model2, "Type", "species", "Name", "y1");
y1.Value    = 920;

Compare the models using sbiodiff and display the comparison table.

diffResults = sbiodiff(model1,model2);
diffTable   = diffResults.Comparisons
diffTable=1×6 table
           Class      Source    Target    Property    SourceValue    TargetValue
         _________    ______    ______    ________    ___________    ___________

    1    "Species"     "y1"      "y1"     "Value"       {[880]}        {[920]}  

You can also view the comparison results graphically in the Comparison tool.

visdiff(diffResults);

Get a table of model components associated with the changes reported in the comparison table.

tbl = getComponents(diffResults)
tbl=1×2 table
                  Source                      Target         
         ________________________    ________________________

    1    {1×1 SimBiology.Species}    {1×1 SimBiology.Species}

Version History

Introduced in R2022a