Package org.sbml.jsbml

Examples of org.sbml.jsbml.Species


  public SpeciesAnnotationTest() throws XMLStreamException, SBMLException {
    SBMLDocument doc = new SBMLDocument(2, 4);
    doc.addTreeNodeChangeListener(this);
    Model model = doc.createModel("model_test");
    Species s1 = model.createSpecies("s1", model.createCompartment("c1"));
    s1.setMetaId("meta_" + s1.getId());
    // Not necessary anymore.
    // s1.getAnnotation().addRDFAnnotationNamespace("bqbiol", "",
    // "http://biomodels.net/biology-qualifiers/");
    s1.addCVTerm(new CVTerm(CVTerm.Type.BIOLOGICAL_QUALIFIER,
        CVTerm.Qualifier.BQB_HAS_PART, "urn:miriam:obo.chebi:CHEBI:15422"));
    System.out.println("==================================");
    new SBMLWriter().write(doc, System.out);
    new JTreeOfSBML(doc);
  }
View Full Code Here


  /* (non-Javadoc)
   * @see org.sbml.jsbml.util.compilers.ASTNodeCompiler#compile(org.sbml.jsbml.CallableSBase)
   */
  public ASTNodeValue compile(CallableSBase variable) {
    if (variable instanceof Species) {
      Species species = (Species) variable;
      Compartment c = species.getCompartmentInstance();
      boolean concentration = !species.getHasOnlySubstanceUnits()
          && (0 < c.getSpatialDimensions());
      StringBuffer value = new StringBuffer();
      if (concentration) {
        value.append('[');
      }
View Full Code Here

    assertTrue(M.getRuleCount() == 3);
  }

  @Test
  public void test_Model_addSpecies() {
    Species s = new Species(2, 4);
    s.setId("s");
    s.setCompartment("c");
    M.addSpecies(s);
    assertTrue(M.getSpeciesCount() == 1);
  }
View Full Code Here

    assertEquals(M.getReaction(0), r);
  }

  @Test
  public void test_Model_createSpecies() {
    Species s = M.createSpecies();
    assertTrue(s != null);
    assertTrue(M.getSpeciesCount() == 1);
    assertTrue(M.getSpecies(0).equals(s) == true);
  }
View Full Code Here

    assertEquals(M.getFunctionDefinition("tan"), null);
  }

  @Test
  public void test_Model_getSpeciesWithBoundaryCondition() {
    Species s1 = new Species(2, 4);
    Species s2 = new Species(2, 4);
    Species s3 = new Species(2, 4);
    s1.setId("s1");
    s2.setId("s2");
    s3.setId("s3");
    s1.setCompartment("c1");
    s2.setCompartment("c2");
    s3.setCompartment("c3");
    s1.setBoundaryCondition(true);
    s2.setBoundaryCondition(false);
    s3.setBoundaryCondition(true);
    assertTrue(M.getSpeciesCount() == 0);
    assertTrue(M.getSpeciesWithBoundaryConditionCount() == 0);
    M.addSpecies(s1);
    assertTrue(M.getSpeciesCount() == 1);
    assertTrue(M.getSpeciesWithBoundaryConditionCount() == 1);
View Full Code Here

    assertTrue(pr.getFormula().equals("k3/k2"));
  }

  @Test
  public void test_Model_getSpecies() {
    Species s1 = new Species(2, 4);
    Species s2 = new Species(2, 4);
    s1.setId("Glucose");
    s2.setId("Glucose_6_P");
    s1.setCompartment("c");
    s2.setCompartment("c");
    M.addSpecies(s1);
    M.addSpecies(s2);
    assertTrue(M.getSpeciesCount() == 2);
    s1 = M.getSpecies(0);
    s2 = M.getSpecies(1);
    assertTrue(s1.getId().equals("Glucose"));
    assertTrue(s2.getId().equals("Glucose_6_P"));
  }
View Full Code Here

    assertTrue(s2.getId().equals("Glucose_6_P"));
  }

  @Test
  public void test_Model_getSpeciesById() {
    Species s1 = new Species(2, 4);
    Species s2 = new Species(2, 4);
    s1.setId("Glucose");
    s2.setId("Glucose_6_P");
    s1.setCompartment("c");
    s2.setCompartment("c");
    M.addSpecies(s1);
    M.addSpecies(s2);
    assertTrue(M.getSpeciesCount() == 2);
    // assertTrue(M.getSpecies("Glucose").equals(s1) != true);
    // assertTrue(M.getSpecies("Glucose_6_P").equals(s2) != true);
View Full Code Here

    o3 = null;
  }

  @Test
  public void test_Model_removeSpecies() {
    Species o1, o2, o3;
    o1 = M.createSpecies();
    o2 = M.createSpecies();
    o3 = M.createSpecies();
    o3.setId("test");
    assertTrue(M.removeSpecies(0).equals(o1));
View Full Code Here

        new ASTNode(16, fd)));
    math.addChild(pieces);
    fd.setMath(math);
    System.out.println(math.toMathML());
   
    Species species = m.createSpecies("spec");
    Reaction r = m.createReaction("r");
    r.addReactant(new SpeciesReference(species));
    KineticLaw kl = new KineticLaw(level, version);
    math = new ASTNode(fd, kl);
    math.addChild(new ASTNode(species, kl));
View Full Code Here

   
    /*
     * Species and Species References
     */
    logger.debug("==== Species ====");
    Species s1 = model.createSpecies("s1", c1);
    Species p1 = model.createSpecies("p1", c1);
    r1.createReactant(s1);
    r1.createProduct(p1);
    r1.getProduct(0).setId("p1ref");
   
    /*
 
View Full Code Here

TOP

Related Classes of org.sbml.jsbml.Species

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.