本文整理汇总了C#中libsbml.Model.getListOfReactions方法的典型用法代码示例。如果您正苦于以下问题:C# Model.getListOfReactions方法的具体用法?C# Model.getListOfReactions怎么用?C# Model.getListOfReactions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsbml.Model
的用法示例。
在下文中一共展示了Model.getListOfReactions方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test_Reaction_parent_create
public void test_Reaction_parent_create()
{
Model m = new Model(2,4);
Reaction r = m.createReaction();
ListOf lo = m.getListOfReactions();
assertTrue( lo == m.getReaction(0).getParentSBMLObject() );
assertTrue( lo == r.getParentSBMLObject() );
assertTrue( m == lo.getParentSBMLObject() );
}
示例2: getReaction
/// <summary>
/// [ ReactionStruct ]
/// [[ Id , Name , [ KineticLawStruct ] , Reversible , Fast , [ ReactantStruct ] , [ ProductStruct ] , [ ModifierSpecies ] ]]
/// </summary>
/// <param name="aSBMLmodel"></param>
/// <returns></returns>
public static List<ReactionStruct> getReaction(Model aSBMLmodel)
{
List<ReactionStruct> list = new List<ReactionStruct>();
ListOfReactions reactions = aSBMLmodel.getListOfReactions();
for (int i = 0; i < reactions.size(); i++ )
{
Reaction aReaction = aSBMLmodel.getReaction(i);
string anId = aReaction.getId();
string aName =aReaction.getName();
//----------KineticLaw----------------------------------
List<KineticLawStruct> ListOfKineticLaw = new List<KineticLawStruct>();
if( aReaction.isSetKineticLaw())
{
KineticLaw aKineticLaw = aReaction.getKineticLaw();
if( aKineticLaw != null)
{
string aFormula_KL;
if( aKineticLaw.isSetFormula())
aFormula_KL = aKineticLaw.getFormula();
else
aFormula_KL = "";
List<string> aString_KL = new List<string>();
if (aSBMLmodel.getLevel() == 1)
{
aString_KL.Add( "" );
}
else
{
if (aKineticLaw.isSetMath())
{
ASTNode anASTNode_KL = aKineticLaw.getMath();
aString_KL.Add( libsbml.libsbml.formulaToString( anASTNode_KL ) );
}
else
aString_KL.Add( "" );
}
string aTimeUnit_KL = aKineticLaw.getTimeUnits();
string aSubstanceUnit_KL = aKineticLaw.getSubstanceUnits();
List<ParameterStruct> listOfParameters = new List<ParameterStruct>();
ListOfParameters parameters = aKineticLaw.getListOfParameters();
for (int j = 0; j < parameters.size(); j++ )
{
Parameter aParameter = aKineticLaw.getParameter(j);
if (aParameter == null)
continue;
string anId_KL_P = aParameter.getId();
string aName_KL_P = aParameter.getName();
double aValue_KL_P = aParameter.getValue();
string aUnit_KL_P = aParameter.getUnits();
bool aConstant_KL_P = aParameter.getConstant();
ParameterStruct parameter = new ParameterStruct(
anId_KL_P,
aName_KL_P,
aValue_KL_P,
aUnit_KL_P,
aConstant_KL_P);
listOfParameters.Add( parameter );
}
XMLNode anExpressionAnnotation = aKineticLaw.getAnnotation();
KineticLawStruct kineticLaw = new KineticLawStruct(
aFormula_KL,
aString_KL,
aTimeUnit_KL,
aSubstanceUnit_KL,
listOfParameters,
anExpressionAnnotation );
ListOfKineticLaw.Add(kineticLaw);
}
}
bool aReversible = aReaction.getReversible();
bool aFast = aReaction.getFast();
//----------Reactants----------------------------------
List<ReactantStruct> ListOfReactants = new List<ReactantStruct>();
ListOfSpeciesReferences reactants = aReaction.getListOfReactants();
for (int k = 0; k < reactants.size(); k++ )
{
SpeciesReference aSpeciesReference = aReaction.getReactant(k);
string aSpecies_R = aSpeciesReference.getSpecies();
//.........这里部分代码省略.........
示例3: test_Reaction_parent_add
public void test_Reaction_parent_add()
{
Reaction ia = new Reaction(2,4);
Model m = new Model(2,4);
ia.setId("k");
m.addReaction(ia);
ia = null;
ListOf lo = m.getListOfReactions();
assertTrue( lo == m.getReaction(0).getParentSBMLObject() );
assertTrue( m == lo.getParentSBMLObject() );
}
示例4: test_Reaction_ancestor_create
public void test_Reaction_ancestor_create()
{
Model m = new Model(2,4);
Reaction r = m.createReaction();
ListOf lo = m.getListOfReactions();
assertTrue( r.getAncestorOfType(libsbml.SBML_MODEL) == m );
assertTrue( r.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
assertTrue( r.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
assertTrue( r.getAncestorOfType(libsbml.SBML_EVENT) == null );
Reaction obj = m.getReaction(0);
assertTrue( obj.getAncestorOfType(libsbml.SBML_MODEL) == m );
assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
assertTrue( obj.getAncestorOfType(libsbml.SBML_EVENT) == null );
}
示例5: test_Reaction_ancestor_add
public void test_Reaction_ancestor_add()
{
Reaction ia = new Reaction(2,4);
Model m = new Model(2,4);
ia.setId("k");
m.addReaction(ia);
ia = null;
ListOf lo = m.getListOfReactions();
Reaction obj = m.getReaction(0);
assertTrue( obj.getAncestorOfType(libsbml.SBML_MODEL) == m );
assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
assertTrue( obj.getAncestorOfType(libsbml.SBML_EVENT) == null );
}
示例6: test_ReadSBML_metaid_ListOf
public void test_ReadSBML_metaid_ListOf()
{
SBase sb;
string s = wrapSBML_L2v1("<listOfFunctionDefinitions metaid='lofd'/>" +
"<listOfUnitDefinitions metaid='loud'/>" +
"<listOfCompartments metaid='loc'/>" +
"<listOfSpecies metaid='los'/>" +
"<listOfParameters metaid='lop'/>" +
"<listOfRules metaid='lor'/>" +
"<listOfReactions metaid='lorx'/>" +
"<listOfEvents metaid='loe'/>");
D = libsbml.readSBMLFromString(s);
M = D.getModel();
assertTrue( M != null );
sb = M.getListOfFunctionDefinitions();
assertEquals( true, sb.isSetMetaId() );
assertTrue(( "lofd" == sb.getMetaId() ));
sb = M.getListOfUnitDefinitions();
assertEquals( true, sb.isSetMetaId() );
assertTrue(( "loud" == sb.getMetaId() ));
sb = M.getListOfCompartments();
assertEquals( true, sb.isSetMetaId() );
assertTrue(( "loc" == sb.getMetaId() ));
sb = M.getListOfSpecies();
assertEquals( true, sb.isSetMetaId() );
assertTrue(( "los" == sb.getMetaId() ));
sb = M.getListOfParameters();
assertEquals( true, sb.isSetMetaId() );
assertTrue(( "lop" == sb.getMetaId() ));
sb = M.getListOfRules();
assertEquals( true, sb.isSetMetaId() );
assertTrue(( "lor" == sb.getMetaId() ));
sb = M.getListOfReactions();
assertEquals( true, sb.isSetMetaId() );
assertTrue(( "lorx" == sb.getMetaId() ));
sb = M.getListOfEvents();
assertEquals( true, sb.isSetMetaId() );
assertTrue(( "loe" == sb.getMetaId() ));
}
示例7: test_ReadSBML_line_col_numbers
public void test_ReadSBML_line_col_numbers()
{
//setXMLParser();
SBase sb;
string s = "<?xml version='1.0' encoding='UTF-8'?>\n" +
"<sbml xmlns='http://www.sbml.org/sbml/level2' level='2' version='1'>\n" +
" <model id='testModel' name='testModel'>\n" +
" <listOfReactions> <reaction/> </listOfReactions>\n" +
" </model>\n" +
"</sbml>\n";
D = libsbml.readSBMLFromString(s);
M = D.getModel();
assertTrue( M != null );
sb = M;
sb = M.getListOfReactions();
sb = M.getReaction(0);
}