Better understanding of variants sought (also project files)
1 view (last 30 days)
Show older comments
If I create a model using the dashboard, including variants(suppose 2, 'var1', and 'var2'), and save the model, the variants are saved with the model. If I close the model, then open it with
sbioreset;
Simbiology('MyModel');
then the model is not listed in the workspace. But I can use the dashboard to see the model (including variants). I can load the model object into the workspace to allow manipulation using scripting:
sbr = sbioroot;
m1 = sbr.models(1)
Because I left the semicolon off, I see something like:
SimBiology Model - MyModel
Model Components:
Compartments: 7
Events: 0
Parameters: 181
Reactions: 83
Rules: 42
Species: 40
Note that there are no variants listed! But if I use
vars = sbioselect('Type','Variant');
I get
SimBiology Variant Array
Index: Name: Active:
1 var1 false
2 var2 false
So the variants are there, but are not listed with the model. The variants aren't listed using sbiowhos, either. Why aren't the variants listed? Is there a command (besides using sbioselect for each type of object) that lists all components of a model?
My understanding of the difference between sbioloadproject('modelname') and simbiology('modelname') is confused. As I understood it, the Simbiology() command opens a model, including variants and all other properties. It has to, because it opens the full model in the dashboard. But my understanding is that the sbioloadproject() command does NOT load variants, tasks, datasets, and graphical location information (that is, the stuff that tells the dashboard how to arrange species and reactions on the diagram view). Is there someplace tells me how to find ALL of the components of a model object? It might help to know all of what goes into a sbproj file, and (assuming that simbiology() loads all model elements) what are the elements that sbioloadoproject does NOT load. Clearly I was wrong, and variants are loaded.
And I would think that typing 'm1' (where m1 is a model object in the workspace) should list everything associated with that object including variants and datasets and (in the case of loading with Simbiology()) the set of object locations.
0 Comments
Answers (1)
Arthur Goldsipe
on 4 Sep 2018
Hi Jim,
Variants (and doses) are handled differently than the objects you see listed in the display for a model. As you discovered, one way to get access to them is via sbioselect. The primary way that we intended users to get access to them is via the methods getvariant and getdose. And you'll find a list of all methods and properties for a model on this reference page.
-Arthur
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!