getModifier() public method

public getModifier ( long n ) : ModifierSpeciesReference
n long
return ModifierSpeciesReference
Esempio n. 1
0
        /// <summary>
        ///     Imports the SBML Modifiers to MoBi Modifiers.
        /// </summary>
        private void CreateModifiers(Reaction sbmlReaction, IReactionBuilder reactionBuilder, string reactionCompartment, Model model)
        {
            for (long i = 0; i < sbmlReaction.getNumModifiers(); i++)
            {
                var modifier = sbmlReaction.getModifier(i);
                if (ModifierInDifferentCompartment(reactionCompartment, modifier, model))
                {
                    continue;
                }

                var modifierMolecule = _sbmlInformation.GetMoleculeBySBMLId(modifier.getSpecies());
                if (modifierMolecule != null)
                {
                    reactionBuilder.AddModifier(modifierMolecule.Name);
                }
            }
        }
 public void test_SpeciesReference_Modifier_parent_create()
 {
     Reaction r = new Reaction(2,4);
       ModifierSpeciesReference sr = r.createModifier();
       ListOf lo = r.getListOfModifiers();
       assertTrue( lo == sr.getParentSBMLObject() );
       assertTrue( lo == r.getModifier(0).getParentSBMLObject() );
       assertTrue( r == lo.getParentSBMLObject() );
 }
 public void test_SpeciesReference_Modifier_parent_add()
 {
     ModifierSpeciesReference sr = new ModifierSpeciesReference(2,4);
       sr.setSpecies("s");
       Reaction r = new Reaction(2,4);
       r.addModifier(sr);
       sr = null;
       ListOf lo = r.getListOfModifiers();
       assertTrue( lo == r.getModifier(0).getParentSBMLObject() );
       assertTrue( r == lo.getParentSBMLObject() );
 }
 public void test_SpeciesReference_Modifier_ancestor_create()
 {
     Reaction r = new Reaction(2,4);
       ModifierSpeciesReference sr = r.createModifier();
       ListOf lo = r.getListOfModifiers();
       assertTrue( sr.getAncestorOfType(libsbml.SBML_REACTION) == r );
       assertTrue( sr.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
       assertTrue( sr.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( sr.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null );
       ModifierSpeciesReference obj = r.getModifier(0);
       assertTrue( obj.getAncestorOfType(libsbml.SBML_REACTION) == r );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null );
 }
 public void test_SpeciesReference_Modifier_ancestor_add()
 {
     ModifierSpeciesReference sr = new ModifierSpeciesReference(2,4);
       sr.setSpecies("s");
       Reaction r = new Reaction(2,4);
       r.addModifier(sr);
       sr = null;
       ListOf lo = r.getListOfModifiers();
       ModifierSpeciesReference obj = r.getModifier(0);
       assertTrue( obj.getAncestorOfType(libsbml.SBML_REACTION) == r );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null );
 }