Package org.sbml.jsbml

Examples of org.sbml.jsbml.Species


    if (eventAssignment.isSetVariable()) {
      String variableID = eventAssignment.getVariable();

      Compartment compartment = model.getCompartment(variableID);
      Species species = null;
      SpeciesReference speciesReference = null;
      Parameter parameter = null;

      if (compartment == null) {
        species = model.getSpecies(variableID);
View Full Code Here


    if (initialAssignment.isSetVariable()) {
      String variableID = initialAssignment.getVariable();

      Compartment compartment = model.getCompartment(variableID);
      Species species = null;
      SpeciesReference speciesReference = null;
      Parameter parameter = null;

      if (compartment == null) {
        species = model.getSpecies(variableID);
View Full Code Here

  private void setRateRuleVariable(RateRule rule, Model model) {
    if (rule.isSetVariable()) {
      String variableID = rule.getVariable();

      Compartment compartment = model.getCompartment(variableID);
      Species species = null;
      SpeciesReference speciesReference = null;
      Parameter parameter = null;

      if (compartment == null) {
        species = model.getSpecies(variableID);
View Full Code Here

      SimpleSpeciesReference speciesReference, Model model) {

    if (speciesReference.isSetSpecies()) {
      String speciesID = speciesReference.getSpecies();

      Species species = model.getSpecies(speciesID);

      if (species != null) {
        speciesReference.setSpecies(species);
      } else {
        // TODO: the species ID doesn't match a species, throw an
View Full Code Here

  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

   
    // At the moment (rev 744), the species can be created and added to the model
    // This should no be possible as the id of the species is the same as the one
    // from the first reaction !!
    Species s1 = m.createSpecies("id1");

    System.out.println("\n\nNB species in the model (Should be 0)          : " + m.getNumSpecies());
    System.out.println(s1.getParent() + " " + s1.getModel());

    if (m.getNumSpecies() > 0) {
      // bug here
      System.out.println("Bug detected :  it should no be possible as the id of the species is the same as the one from the first reaction !!!");     
    }
View Full Code Here

  {
    SBMLReader reader = new SBMLReader();
    SBMLDocument d = null;
    Model m;
    Compartment c;
    Species s;
    Parameter gp;
    LocalParameter lp;
    AssignmentRule ar;
    Reaction r;
    SpeciesReference sr;
    KineticLaw kl;
    UnitDefinition ud;
    Reaction r1;
    ListOf<Compartment> loc;
    Compartment c1;
    ListOf<Rule> lor;
    AssignmentRule ar1;
    ListOf<Parameter> lop;
    Parameter p1;
    ListOf<Species> los;
    Species s1;
    String filename = new String( DATA_FOLDER + "/libsbml-test-data/" );
    filename += "l2v1-assignment.xml";
    try {
    d = reader.readSBML(filename);
  } catch (IOException e) {
    e.printStackTrace();
    assert(false);
  } catch (XMLStreamException e) {
    e.printStackTrace();
    assert(false);
  }

  System.out.println(" TestReadFromFile 5 : reading done.");
 
  assertTrue( d.getLevel() == 2 );
    assertTrue( d.getVersion() == 1 );
    m = d.getModel();
    assertTrue( m != null );
    assertTrue( m.getNumCompartments() == 1 );
    c = m.getCompartment(0);
    assertTrue( c != null );
    assertTrue( c.getId().equals( "cell") );
/*    ud = c.getDerivedUnitDefinition();
    assertTrue( ud.getNumUnits() == 1 );
    assertTrue( ud.getUnit(0).getKind() == Kind.LITRE );
    */
    loc = m.getListOfCompartments();
    c1 = loc.get(0);
    assertTrue( c1.equals(c) );
    c1 = loc.get("cell");
    assertTrue( c1.equals(c) );
    assertTrue( m.getNumSpecies() == 5 );
    s = m.getSpecies(0);
    assertTrue( s != null );
    assertTrue( s.getId().equals( "X0"  ) );
    assertTrue( s.getCompartment().equals( "cell") );
    assertTrue( s.getInitialConcentration() == 1.0 );
    los = m.getListOfSpecies();
    s1 = los.get(0);
    assertTrue( s1.equals(s) );
    s1 = los.get("X0");
    assertTrue( s1.equals(s) );
    s = m.getSpecies(1);
    assertTrue( s != null );
    assertTrue( s.getId().equals( "X1"  ) );
    assertTrue( s.getCompartment().equals( "cell") );
    assertTrue( s.getInitialConcentration() == 0.0 );
View Full Code Here

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

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

  private Species S;

  @Before public void setUp() throws Exception
  {
    S = new  Species(2,4);
    if (S == null);
    {
    }
  }
View Full Code Here

 
  @SuppressWarnings("deprecation")
@Test public void test_Species_setSpatialSizeUnits()
  {
    Species s = new  Species(2,1);
    String units =  "volume";;
    s.setSpatialSizeUnits(units);
    assertTrue(s.getSpatialSizeUnits().equals(units));
    assertEquals( true, s.isSetSpatialSizeUnits() );
    if (s.getSpatialSizeUnits() == units);
    {
    }
    s.setSpatialSizeUnits(s.getSpatialSizeUnits());
    assertTrue(s.getSpatialSizeUnits().equals(units));
    s.setSpatialSizeUnits("");
    assertEquals( false, s.isSetSpatialSizeUnits() );
    if (s.getSpatialSizeUnits() != null);
    {
    }
    s = null;
  }
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.