Package org.sbml.jsbml

Examples of org.sbml.jsbml.Species


    {
      final Reaction reaction = model.getReaction( l );
     
      for( int m = 0; m < reaction.getNumModifiers(); m++ )
      {
        final Species modifier = model.getSpecies( reaction.getModifier( m ).getSpecies() );
        final OntologyTerm uniProtTerm = SbmlUtils.getOntologyTerm( modifier, Ontology.UNIPROT );
       
        if( uniProtTerm != null )
        {
          final List<String> uniProtTermAndCompartment = Arrays.asList( uniProtTerm.getId(), model.getCompartment( modifier.getCompartment() ).getName().toLowerCase() );
          uniProtTermAndCompartmentToSpeciesId.put( uniProtTermAndCompartment, modifier.getId() );
         
          Set<String> reactionIds = uniProtTermAndCompartmentToReactionIds.get( uniProtTermAndCompartment );
         
          if( reactionIds == null )
          {
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

    Model m;
    Compartment c;
    KineticLaw kl;
    LocalParameter p;
    Reaction r;
    Species s;
    SpeciesReference sr;
    UnitDefinition ud;
    String filename = DATA_FOLDER + "/libsbml-test-data/l1v1-branch.xml";
    d = new SBMLReader().readSBML(filename);
    if (d == null)
      ;
    {
    }
    assertTrue(d.getLevel() == 1);
    assertTrue(d.getVersion() == 1);
    m = d.getModel();
    assertTrue(m.getName().equals("Branch"));
    assertTrue(m.getNumCompartments() == 1);
    c = m.getCompartment(0);
    assertTrue(c.getName().equals("compartmentOne"));
    assertTrue(c.getVolume() == 1);
    ud = c.getDerivedUnitDefinition();
    assertTrue(ud.getNumUnits() == 1);

    // assertTrue(ud.getUnit(0).getKind() == Unit.Kind.LITRE); // getDerivedUnitDefinition not working properly
    assertTrue(m.getNumSpecies() == 4);
    s = m.getSpecies(0);
    assertTrue(s.getName().equals("S1"));
    assertTrue(s.getCompartment().equals("compartmentOne"));
    assertTrue(s.getInitialAmount() == 0);
    assertTrue(s.getBoundaryCondition() == false);

    //    ud = s.getDerivedUnitDefinition(); // getDerivedUnitDefinition not working properly
//    assertTrue(ud.getNumUnits() == 2);
//    assertTrue(ud.getUnit(0).getKind() == Unit.Kind.MOLE);
//    assertTrue(ud.getUnit(0).getExponent() == 1);
//    assertTrue(ud.getUnit(1).getKind() == Unit.Kind.LITRE);
//    assertTrue(ud.getUnit(1).getExponent() == -1);
   
    s = m.getSpecies(1);
    assertTrue(s.getName().equals("X0"));
    assertTrue(s.getCompartment().equals("compartmentOne"));
    assertTrue(s.getInitialAmount() == 0);
    assertTrue(s.getBoundaryCondition() == true);
    s = m.getSpecies(2);
    assertTrue(s.getName().equals("X1"));
    assertTrue(s.getCompartment().equals("compartmentOne"));
    assertTrue(s.getInitialAmount() == 0);
    assertTrue(s.getBoundaryCondition() == true);
    s = m.getSpecies(3);
    assertTrue(s.getName().equals("X2"));
    assertTrue(s.getCompartment().equals("compartmentOne"));
    assertTrue(s.getInitialAmount() == 0);
    assertTrue(s.getBoundaryCondition() == true);
    assertTrue(m.getNumReactions() == 3);
    r = m.getReaction(0);
    assertTrue(r.getName().equals("reaction_1"));
    assertTrue(r.getReversible() == false);
    assertTrue(r.getFast() == false);
View Full Code Here

    Compartment c = model.createCompartment("c");
    c.setSize(4.3);
    c.setSBOTerm(SBO.getPhysicalCompartment());

    Species s1 = model.createSpecies("s1", c);
    s1.addCVTerm(new CVTerm(CVTerm.Type.BIOLOGICAL_QUALIFIER,
        Qualifier.BQB_IS, "urn:miriam:kegg.compound:C12345"));
    s1.setValue(23.7);
    model.removeSpecies(s1);

    try {
      System.out.println();
      new SBMLWriter().write(doc, System.out);
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

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

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

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

  @Test
  public void test_Model_getNumSpeciesWithBoundaryCondition() {
    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.getNumSpecies() == 0);
    assertTrue(M.getNumSpeciesWithBoundaryCondition() == 0);
    M.addSpecies(s1);
    assertTrue(M.getNumSpecies() == 1);
    assertTrue(M.getNumSpeciesWithBoundaryCondition() == 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.getNumSpecies() == 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.getNumSpecies() == 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

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.