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', 'PropertyNameCondition'
,
'PropertyNamePattern
', 'Condition
', PropertyValue
)
Out
=
sbioselect(Obj
, 'Where', 'PropertyName1
',
'Condition1
', PropertyValue1
,
'Where', 'PropertyName2
', 'Condition2
', PropertyValue2
,...)
Out
=
sbioselect(Obj
, 'Where', 'PropertyName1
',
'Condition1
', PropertyValue1
,Bool_Operator
,
'Where', 'PropertyName2
', 'Condition2
', PropertyValue2
,...)
Out
= sbioselect(Obj
,
'Depth', DepthValue
,...)
Arguments
| Object or array of objects returned by the sbioselect function. might
contain a mixture of object types (for example, species and parameters),
depending on the selection you specify. If |
| SimBiology® object or array of objects to search. If an
object is not specified, sbioselect searches the
root. |
| Any property of the object being searched. |
| Specify to
include in the selection criteria. |
| Type of object to include in the selection, for example, sbiomodel , species , reaction ,
or kineticlaw . |
| The search condition. See the table under Description for a list of conditions. |
PropertyNameCondition | Search condition that applies only to the name property. See the table listing “Conditions for Names” below. |
PropertyNamePattern | Character vector or string used to select the property name according to the condition
imposed by PropertyNameCondition . |
| Specify the depth number to search. Valid numbers are positive
integer values and inf . If is inf , sbioselect searches and
all of its children. If is 1 , sbioselect only
searches and not
its children. By default, is inf . |
Description
sbioselect
searches for objects with specified
constraints.
searches
the root object (including all model objects contained by the root
object) and returns the objects with the property name (Out
=
sbioselect('PropertyName
', PropertyValue
)
)
and property value (PropertyName
)
contained by the root object. PropertyValue
searches
the root object and finds objects that have a property name (Out
=
sbioselect('Where', 'PropertyName
', 'Condition
', PropertyValue
)
)
and value (PropertyName
)
that matches the condition (PropertyValue
). Condition
returns
the objects with the property name (Out
=
sbioselect(Obj
, 'PropertyName
', PropertyValue
)
)
and property value (PropertyName
)
found in any object (PropertyValue
).
If the property name in a property-value pair contains either a Obj
'?'
or '*'
,
then the name is automatically interpreted as a wildcard expression,
equivalent to the where clause ('Where', 'wildcard', 'PropertyName',
'==', PropertyValue)
.
finds
the objects of type (Out
=
sbioselect(Obj
, 'Type', 'TypeValue
',
'PropertyName
', PropertyValue
)TypeValue
), with the property
name (
)
and property value (PropertyName
)
found in any object (PropertyValue
). Obj
is
the type of SimBiology object to be included in the selection,
for example, TypeValue
species
, reaction
,
or kineticlaw
.
finds
objects that have a property name (Out
=
sbioselect(Obj
, 'Where', 'PropertyName
',
'Condition
', PropertyValue
)
)
and value (PropertyName
)
that match the condition (PropertyValue
). Condition
If you search for a character vector 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')
sbioselect
searches for model objects on
the root in both cases.
finds
objects with a property name that matches the pattern in (Out
=
sbioselect(Obj
, 'Where', 'PropertyNameCondition'
,
'PropertyNamePattern
', 'Condition
', PropertyValue
)PropertyNamePattern
)
with the condition (PropertyNameCondition
)
and matches the value (PropertyValue
) with
the condition (Condition
). Use this syntax
when you want search conditions on both property names and property
values.
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 Properties | Example Syntax |
---|---|
== | Search in the model object ( parameterObj = sbioselect (modelObj,... 'Where', 'Value', '==', 0.5) == ,
this is equivalent to omitting the condition as shown:parameterObj = sbioselect (modelObj,... 'Value', 0.5) Search in the model object
( 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 ( speciesObj = sbioselect (modelObj, ... 'Where', 'InitialAmount', '>', 50) Search
in the model object ( speciesObj = sbioselect (modelObj,... 'Where', 'InitialAmount', '<=', 50) |
between | Search in the model object ( speciesObj = sbioselect (modelObj,... 'Where', 'InitialAmount',... 'between', [200 300]) |
~between | Search 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]) |
equal_and_same_type | Similar to == , but in addition requires
the property value to be of the same type. Search in the model
object ( zeroObj = sbioselect(modelObj, ... 'Where', '*', 'equal_and_same_type', 0); |
unequal_and_same_type | Similar to ~= , but in addition requires
the property value to be of the same type. Select all objects
containing a property of type double and value not equal to 0. (Using nonzeroObj = sbioselect(modelObj, ... 'Where', '*', 'unequal_and_same_type', 0); |
The following table shows you conditions for the name property or for properties whose values are character vectors.
Conditions for Names | Example Syntax |
---|---|
== | Search in the model object ( speciesObj = sbioselect (modelObj,... 'Type', 'species', 'Where',... 'Name', '==', 'Glucose') |
~= | Search in the model object ( speciesObj = sbioselect (modelObj,... 'Type', 'species', 'Where',... 'Name', '~=', 'Glucose') |
==i | Same as |
~=i |
Search in the model object ( speciesObj = sbioselect (modelObj,... 'Type', 'species', 'Where',... 'Name', '~=i', 'glucose') |
regexp . Supports expressions
supported by the functions regexp and regexpi . | Search in the model object ( Obj = sbioselect (modelObj, 'Where',... 'Name', 'regexp', '[ea]se') Search
in the root, and return objects that have Obj = sbioselect ('Where',... 'Name', 'regexp', 'kinase') |
regexpi | Same as |
~regexp | Search in the model object ( Obj = sbioselect (modelObj, 'Where',... 'Name', '~regexp', 'kinase') |
~regexpi | Same as |
wildcard | Supports |
wildcardi | Same as |
~wildcard | Search in the model object ( Obj = sbioselect (modelObj, 'Where',... 'Name', '~wildcard', 'kin*') |
~wildcardi | Same as |
Use the condition type function
for any property.
The specified value should be a function handle that, when applied
to a property value, returns a boolean indicating whether there is
a match. The following table shows an example of using function
.
Condition | Example Syntax |
---|---|
'function' |
Search in the model object and return reaction objects whose
Out = sbioselect(modelObj, 'Where',... 'Stoichiometry', 'function',... @(x)any(x>2)) iseven = @(x) isnumeric(x)... && isvector(x) && mod(x, 2) == 0; evenValuedObj = sbioselect(modelObj, ... 'where', 'Value', 'function', iseven); |
The condition 'contains'
can be used only
for those properties whose values are an array of SimBiology objects.
The following table shows an example of using contains
.
Condition | Example Syntax |
---|---|
'contains' | Search in the model object and return reaction objects whose
Out = sbioselect(modelObj, 'Where',... 'Reactants', 'contains',... modelObj.Species(1)) |
finds
objects contained by Out
=
sbioselect(Obj
, 'Where', 'PropertyName1
',
'Condition1
', PropertyValue1
,
'Where', 'PropertyName2
', 'Condition2
', PropertyValue2
,...)Obj
that matches all the conditions
specified.
You can combine any number of property name/property value pairs
and conditions in the sbioselect
command.
finds
objects contained by Out
=
sbioselect(Obj
, 'Where', 'PropertyName1
',
'Condition1
', PropertyValue1
,Bool_Operator
,
'Where', 'PropertyName2
', 'Condition2
', PropertyValue2
,...)Obj
that matches all the conditions
specified. Supported character vectors for Bool_Operator
are
as follows.
'and' | True if ( 'Where' , 'PropertyName1' ,'Condition1' ,PropertyValue1 )
and ( 'Where' , 'PropertyName2' ,'Condition2' ,PropertyValue2 )
are both true. |
'or' | True if either ( 'Where' , 'PropertyName1' ,'Condition1' ,PropertyValue1 )
or ( 'Where' , 'PropertyName2' ,'Condition2' ,PropertyValue2 )
is true. |
'xor' | True if exactly one of ( 'Where' , 'PropertyName1' ,'Condition1' ,PropertyValue1 )
or ( 'Where' , 'PropertyName2' ,'Condition2' ,PropertyValue2 )
is true. |
'not' | True if ( 'Where' , 'PropertyName1' ,'Condition1' ,PropertyValue1 )
is true and ( 'Where' , 'PropertyName2' ,'Condition2' ,PropertyValue2 )
is not true. |
Compound expressions with multiple boolean operators are supported.
Precedence of the operators follows the order of operations for boolean
algebra not
–> and
–> xor
–> or
.
finds objects using a model search depth of Out
= sbioselect(Obj
,
'Depth', DepthValue
,...)
. DepthValue
Note
The order of results from sbioselect
is not guaranteed. Hence, it is
not recommended to depend on the order of results.
Examples
Version History
Introduced before R2006a