sbioselect - Search for objects with specified constraints

Syntax

Out = sbioselect('PropertyName', PropertyValue)
Out = sbioselect('Where', 'PropertyName', 'Condition', PropertyValue)
Out = sbioselect(Obj, 'PropertyName', PropertyValue)
Out = sbioselect(Obj, 'Type', 'TypeValue', 'PropertyName', PropertyValue)
Out = sbioselect(Obj, 'Where', 'PropertyName', 'Condition', PropertyValue)
Out = sbioselect(Obj, 'Where', 'PropertyName1', 'Condition1', PropertyValue1, 'Where', 'PropertyName2', 'Condition2', PropertyValue2,...)
Out = sbioselect(Obj, 'Depth', DepthValue,...)

Arguments

OutObject or array of objects returned by the sbioselect function. Out might contain a mixture of object types (for example, species and parameters), depending on the selection you specify.

If PropertyValue is a cell array, then the function returns all objects with the property 'PropertyName' that matches any element of PropertyValue.

ObjSimBiology object or array of objects to search. If an object is not specified, sbioselect searches the root.
PropertyNameAny property of the object being searched.
PropertyValueSpecify PropertyValue to include in the selection criteria.
TypeValueType of object to include in the selection, for example, sbiomodel, species, reaction, or kineticlaw.
ConditionConstraint to impose on the search. See the table under Description for a list of conditions.
DepthValueSpecify the depth number to search. Valid numbers are positive integer values and inf. If DepthValue is inf, sbioselect searches Obj and all of its children. If DepthValue is 1, sbioselect only searches Obj and not its children. By default, DepthValue is inf.

Description

sbioselect searches for objects with specified constraints.

Out = sbioselect('PropertyName', PropertyValue) searches the root object (including all model objects contained by the root object) and returns the objects with the property name (PropertyName) and property value (PropertyValue) contained by the root object.

Out = sbioselect('Where', 'PropertyName', 'Condition', PropertyValue) searches the root object and finds objects that have a property name (PropertyName) and value (PropertyValue) that matches the condition (Condition).

Out = sbioselect(Obj, 'PropertyName', PropertyValue) returns the objects with the property name (PropertyName) and property value (PropertyValue) found in any object (Obj).

Out = sbioselect(Obj, 'Type', 'TypeValue', 'PropertyName', PropertyValue) finds the objects of type (TypeValue), with the property name (PropertyName) and property value (PropertyValue) found in any object (Obj). TypeValue is the type of SimBiology object to be included in the selection, for example, species, reaction, or kineticlaw.

Out = sbioselect(Obj, 'Where', 'PropertyName', 'Condition', PropertyValue) finds objects that have a property name (PropertyName) and value (PropertyValue) that match the condition (Condition).

If you search for a string property value without specifying a condition, you must use the same format as get returns. For example, if get returns the Name as 'MyObject', sbioselect will not find an object with a Name property value of 'myobject'. Therefore, for this example, you must specify:

modelObj = sbioselect ('Name', 'MyObject')

Instead, if you use a condition, you can specify:

modelObj = sbioselect ('Where', 'Name', '==i', 'myobject')

Thus, conditions let you control the specificity of your selection.

sbioselect searches for model objects on the root in both cases.

The conditions, with examples of property names and corresponding examples of property values that you can use, are listed in the following tables. This table shows you conditions for numeric properties.

Conditions for Numeric PropertiesExample Syntax
==

Search in the model object (modelObj), and return parameter objects that have Value equal to 0.5. sbioselect returns parameter objects because only parameter objects have a property called Value.

parameterObj = sbioselect (modelObj,...
 'Where', 'Value', '==', 0.5)

In the case of ==, this is equivalent to omitting the condition as shown:

parameterObj = sbioselect (modelObj,...
'Value', 0.5)

Search in the model object (modelObj), and return parameter objects that have ConstantValue false (nonconstant parameters).

parameterObj = sbioselect (modelObj,...
 'Where', 'ConstantValue', '==', false)
~=Search in the model object (modelObj), and return parameter objects that do not have Value equal to 0.5.
parameterObj = sbioselect (modelObj,...
 'Where', 'Value', '~=', 0.5)
>,<,>=,<=

Search in the model object (modelObj), and return species objects that have an initial amount (InitialAmount) greater than 50.

speciesObj = sbioselect (modelObj, ...
 'Where', 'InitialAmount', '>', 50)

Search in the model object (modelObj), and return species objects that have an initial amount (InitialAmount) less than or equal to 50.

speciesObj = sbioselect (modelObj,...
 'Where', 'InitialAmount', '<=', 50)
between

Search in the model object (modelObj), and return species objects that have an initial amount (InitialAmount) between 200 and 300.

speciesObj = sbioselect (modelObj,...
 'Where', 'InitialAmount',...
 'between', [200 300])
~betweenSearch in the model object (modelObj), and return species objects that have an initial amount (InitialAmount) that is not between 200 and 300.
speciesObj = sbioselect (modelObj,...
 'Where', 'InitialAmount',...
 '~between', [200 300])

The following table shows you conditions for properties whose values are strings.

Conditions for String PropertiesExample Syntax
== Search in the model object (modelObj), and return species objects named 'Glucose'.
speciesObj = sbioselect (modelObj,...
 'Type', 'species', 'Where',...
 'Name', '==', 'Glucose')
~=Search in the model object (modelObj), and return species objects that are not named 'Glucose'.
speciesObj = sbioselect (modelObj,...
 'Type', 'species', 'Where',...
 'Name', '~=', 'Glucose')
==iSame as ==; in addition, this is case insensitive.
~=i Search in the model object (modelObj), and return species objects that are not named 'Glucose', ignoring case.
speciesObj = sbioselect (modelObj,...
 'Type', 'species', 'Where',...
 'Name', '~=i', 'glucose')
regexp. Supports expressions supported by the functions regexp and regexpi. Search in the model object (modelObj), and return objects that have 'ese' or 'ase' anywhere within the name.
Obj = sbioselect (modelObj, 'Where',...
 'Name', 'regexp', '[ea]se')

Search in the root, and return objects that have kinase anywhere within the name.

Obj = sbioselect ('Where',...
 'Name', 'regexp', 'kinase')

Note that this query could result in a mixture of object types (for example, species and parameters).

regexpi Same as regexp; in addition, this is case insensitive.
~regexpSearch in the model object (modelObj), and return objects that do not have kinase anywhere within the name.
Obj = sbioselect (modelObj, 'Where',...
 'Name', '~regexp', 'kinase')
~regexpi Same as ~regexp; in addition, this is case insensitive.

The condition 'contains' can be used only for those properties whose values are an array of SimBiology objects. The following table shows you an example of using contains.

ConditionExample Syntax
'contains'Search in the model object and return reaction objects whose Reactant property contains the specified species.
Out = sbioselect(modelObj, 'Where',...
'Reactants', 'contains',...
 modelObj.Species(1))

Out = sbioselect(Obj, 'Where', 'PropertyName1', 'Condition1', PropertyValue1, 'Where', 'PropertyName2', 'Condition2', PropertyValue2,...) finds objects contained by Obj that matches all the conditions specified.

You can combine any number of property name/property value pairs and conditions in the sbioselect command.

Out = sbioselect(Obj, 'Depth', DepthValue,...) finds objects using a model search depth of DepthValue.

Examples

  1. Import a model.

    modelObj = sbmlimport('oscillator');
  2. Find and return an object named pA.

    Obj = sbioselect(modelObj, 'Name', 'pA');
  3. Find and return species objects whose Name starts with p and have A or B as the next letter in the name.

    speciesObj = sbioselect(modelObj, 'Type', 'species', 'Where',...
     'Name', 'regexp', '^p[AB]');
  4. Find a cell array. Note how cell array values must be specified inside another cell array.

    modelObj.Species(2).UserData = {'a' 'b'}; 
    Obj = sbioselect(modelObj,'UserData',{{'a' 'b'}})
    
    SimBiology Species Array
    
    Index:    Compartment:    Name:    InitialAmount:  InitialAmountUnits:
    1         unnamed         pB       0                  
    

See Also

regexp

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS