Better understanding of variants sought (also project files)

1 view (last 30 days)
Jim Bosley
Jim Bosley on 4 Sep 2018
Edited: Jim Bosley on 5 Sep 2018
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
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.

Answers (1)

Arthur Goldsipe
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.
Jim Bosley
Jim Bosley on 5 Sep 2018
The fieldnames() function is something that I was looking for - VERY useful. And this satisfies a lot of the need wrt to my "list".
I think it's awfully hard for experts/creators of software to write documentation. First, mostly we hate doing it (at least I do). Second, when one has created something, we have implicit knowledge of what objects are and what they do, and sometimes this implicit stuff is hard to write out and isn't included in the docs.
fieldnames() will be used extensively. While I'll pat myself on the back finding modelname.Variant, I'll also try to stick to the prescribed "getvariant" command.
Suffice to say that I'm enjoying using SimBiology and feel that I'm productive at this point and learning to be more so. This level of satisfaction and progress would NOT be happening without help from you and your colleague's. So, thanks again.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!