| SimBiology® | ![]() |
speciesObj = addspecies(compObj, 'NameValue')
speciesObj = addspecies(compObj, 'NameValue', InitialAmountValue)
speciesObj = addspecies(...'PropertyName', PropertyValue...)
| compObj | Compartment object. |
| NameValue | Name for a species object. Enter a character string unique
within compObj. Species
objects are identified by name within Event, ReactionRate, and Rule property strings. For information on naming species see Name. You can use the function sbioselect to find an object with a specific Name property value. |
| IntialAmountValue | Initial amount value for the species object. Enter double. Positive real number, default = 0. |
| PropertyName | Enter the name of a valid property. Valid property names are listed in Property Summary. |
| PropertyValue | Enter the value for the property specified in PropertyName. Valid property values are listed on each property reference page. |
speciesObj = addspecies(compObj, 'NameValue') creates a species object and returns the species object (speciesObj). In the species object, this method assigns a value (NameValue) to the property Name, and assigns the compartment object (compObj) to the property Parent. In the compartment object, this method assigns the species object to the property Species.
speciesObj = addspecies(compObj, 'NameValue', InitialAmountValue), in addition to the above, this method assigns an initial amount (InitialAmountValue) for the species.
You can also add a species to a reaction using the methods addreactant and addproduct .
A species object must have a unique name at the level at which it is created. For example, a compartment object cannot contain two species objects named H2O. However, another compartment can have a species named H2O.
View properties for a species object with the get command, and modify properties for a species object with the set command. You can view a summary table of species objects in a compartment (compObj) with get(compObj, 'Species') or the properties of the first species with get(compObj.Species(1)).
speciesObj = addspecies(...'PropertyName', PropertyValue...)defines optional
properties. The property name/property value pairs can be in any format
supported by the function set (for example, name-value
string pairs, structures, and name-value cell array pairs). The property
summary on this page shows the list of properties.
If there is more than one compartment object (compObj) in the model, you must qualify the species name with the compartment name. For example cell.glucose denotes that you want to put the species named glucose into a compartment named cell. Additionally, if the compartment named cell does not exist, the process of adding the reaction creates the compartment and names it cell.
If you change the name of a species you must configure all applicable elements, such as events and rules that use the species, any user-specified ReactionRate, or the kinetic law object property SpeciesVariableNames. Use the method setspecies to configure SpeciesVariableNames.
To update species names in the SimBiology® graphical user interface, access each appropriate pane through the Project Explorer. You can also use the Find feature to locate the names that you want to update. The Output pane opens with the results of Find. Double-click a result row to go to the location of the model component.
Species names are automatically updated for reactions that use MassAction kinetic law.
Methods for species objects
| copyobj (any object) | Copy SimBiology® object and its children |
| delete (any object) | Delete SimBiology® object |
| display (any object) | Display summary of SimBiology® object |
Properties for species objects
| Annotation | Store link to URL or file |
| BoundaryCondition | Indicate species boundary condition |
| ConstantAmount | Specify variable or constant species amount |
| InitialAmount | Species initial amount |
| InitialAmountUnits | Species initial amount units |
| Name | Specify name of object |
| Notes | HTML text describing SimBiology® object |
| Parent | Indicate parent object |
| Tag | Specify label for SimBiology® object |
| Type | Display top-level SimBiology® object type |
| UserData | Specify data to associate with object |
Add two species to a model, one is a reactant and the other is the enzyme catalyzing the reaction.
Create a model object with the name my_model and add a compartment object.
modelObj = sbiomodel ('my_model');
compObj = addcompartment(modelObj, 'comp1');Add two species objects with the names glucose_6_phosphate and glucose_6_phosphate_dehydrogenase.
speciesObj1 = addspecies (compObj, 'glucose_6_phosphate');
speciesObj2 = addspecies (compObj, ...
'glucose_6_phosphate_dehydrogenase');Set initial amount of glucose_6_phosphate to 100 and verify.
set (speciesObj1, 'InitialAmount',100); get (speciesObj1, 'InitialAmount')
MATLAB returns
ans = 100
Use get to note that modelObj contains the species object array.
get(compObj, 'Species')
MATLAB returns,
SimBiology Species Array Index: Name: InitialAmount: InitialAmountUnits: 1 glucose_6_phosphate 100 2 glucose_6_phosphate_dehydrogenase 0
Retrieve information about the first species in the array.
get(compObj.Species(1))
Annotation: ''
BoundaryCondition: 0
ConstantAmount: 0
InitialAmount: 100
InitialAmountUnits: ''
Name: 'glucose_6_phosphate'
Notes: ''
Parent: [1x1 SimBiology.Compartment]
Tag: ''
Type: 'species'
UserData: []addcompartment, addproduct, addreactant, addreaction
![]() | addrule (model) | addvariant (model) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |