Main Content

simbio.diagram.splitBlock

Split SimBiology species block in diagram

Description

simbio.diagram.splitBlocksplits a species block so that each expression that references the species is connected to a different copy of the species block inSimBiology Model Builder。The changes are instantly reflected in the app.

Before you run the function at the command line:

  1. Open the corresponding SimBiology model in theSimBiology Model Builderapp.

  2. Export the model from the app to MATLAB®workspace by selectingExport>Export Model to MATLAB Workspaceon theHometab of the app.

You can query and configure only the properties of the objects shown in theDiagramtab of the app. The objects shown in the diagram are compartments, species, reactions, rate rules, repeated assignment rules, and parameters that are on the left-hand side of a rate rule, a repeated assignment rule, or an event function.

example

expr= simbio.diagram.splitBlock(speciesObj)makes copies of a SimBiology speciesspeciesObjblock so that each expression that referencesspeciesObjis connected to a different copy of the species block and returns a list of expression objectsexprthat are connected tospeciesObj。使用这个函数使图看起来更少cluttered and clearer.

Examples

collapse all

Open thegproteinmodel in theSimBiology Model Builderapp.

simBiologyModelBuilder('gprotein');

The app opens and shows the model in theDiagramtab.

On theHometab of the app, selectExport>Export Model to MATLAB Workspace

In theSimBiology Model Exportdialog, clickOKto export the model with the variable namem1

Go to the MATLAB command line and confirm that the modelm1is in the workspace. Get a list of species of the model.

m1.Species
ans = SimBiology Species Array Index: Compartment: Name: Value: Units: 1 unnamed G 7000 2 unnamed Gd 3000 3 unnamed Ga 0 4 unnamed RL 0 5 unnamed L 6.022e+17 6 unnamed R 10000 7 unnamed Gbg 3000

The model diagram already has a copy for each expression that the species Gbg is being referenced. In this case, callingsimbio.diagram.splitBlockdoes not split the block again, but returns the list of expressions that the species is connected to. In this case,Gbgis used in two reactions.

Gbg = m1.Species(7); expr = simbio.diagram.splitBlock(Gbg)
expr = SimBiology Reaction Array Index: Reaction: 1 Gd + Gbg -> G 2 G + RL -> Ga + Gbg + RL

Join all the cloned blocks so that there is only one block forGbg。In this case, keep the copy of the block that is connected to the G Protein activation reaction (G + RL -> Ga + Gbg + RL). Note that the order of reactions returned inexprcan change.

simbio.diagram.joinBlock(Gbg,expr(2))

Input Arguments

collapse all

Species object, specified as a SimBiologySpeciesobject.speciesObjmust be scalar.

Output Arguments

collapse all

List of expressions that species is connected to, returned as aReaction,Ruleobject or array of objects. The rule object can be a rate rule or repeated assignment rule.

Version History

Introduced in R2021a