Examples of SBMLReader


Examples of org.sbml.jsbml.SBMLReader

   *
   */
  @SuppressWarnings("deprecation")
@Test public void test_read_l2v1_assignment()
  {
    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();
View Full Code Here

Examples of org.sbml.jsbml.SBMLReader

   * Tries to use getNotesString on a model without a notes element.
   */
  @Test public void getNotesStringOnModel() throws IOException, XMLStreamException {
    String fileName = DATA_FOLDER + "/libsbml-test-data/l1v1-minimal.xml";
   
    SBMLDocument doc = new SBMLReader().readSBML(fileName);
        assertNotNull(doc.getModel().getNotesString());
    assertTrue(doc.getModel().getNotesString() == "");
  }
View Full Code Here

Examples of org.sbml.jsbml.SBMLReader

   * Tries to validate biomodels file with id 228.
   */
  @Test public void checkConsistency() throws IOException, XMLStreamException {
    String fileName = DATA_FOLDER + "/l2v4/BIOMD0000000228.xml";
   
    SBMLDocument doc = new SBMLReader().readSBML(fileName);

    int nbErrors = doc.checkConsistency();

    System.out.println("Found " + nbErrors + " errors on Biomodels 228 with the unit checking turned off.");
   
View Full Code Here

Examples of org.sbml.jsbml.SBMLReader

   * Tries to validate biomodels file with id 025 with all checks on.
   */
  @Test public void checkConsistencyAllChecks() throws IOException, XMLStreamException {
    String fileName = DATA_FOLDER + "/l2v1/BIOMD0000000025.xml";
   
    SBMLDocument doc = new SBMLReader().readSBML(fileName);
   
    doc.setConsistencyChecks(SBMLValidator.CHECK_CATEGORY.UNITS_CONSISTENCY, true);
   
    int nbErrors = doc.checkConsistency();

View Full Code Here

Examples of org.sbml.jsbml.SBMLReader

   * Tries to validate biomodels file with id 228.
   */
  @Test public void checkConsistency228() throws IOException, XMLStreamException {
    String fileName = DATA_FOLDER + "/l2v4/BIOMD0000000228.xml";
   
    SBMLDocument doc = new SBMLReader().readSBML(fileName);
    try {
      int nbErrors = doc.checkConsistency();

      System.out.println("Found " + nbErrors + " errors on Biomodels 228 with the unit checking turned off.");

View Full Code Here

Examples of org.sbml.jsbml.SBMLReader

   * Tries to validate biomodels file with id 228.
   */
  @Test public void checkConsistency025() throws IOException, XMLStreamException {
    String fileName = DATA_FOLDER + "/l2v1/BIOMD0000000025.xml";
   
    SBMLDocument doc = new SBMLReader().readSBML(fileName);
    try {
      int nbErrors = doc.checkConsistency();

      System.out.println("Found " + nbErrors + " errors on Biomodels 025 with the unit checking turned off.");

View Full Code Here

Examples of org.sbml.jsbml.SBMLReader

    if (!(kl.getMath().getChild(0).getVariable() instanceof LocalParameter)) {
      System.out.println("The local parameter k is not found!");
    }
   
   
    doc = new SBMLReader().readSBML("core/files/test-models/00733-sbml-l2v4.xml");
    r = doc.getModel().getReaction("reaction1");
    kl = r.getKineticLaw();
    if (!(kl.getMath().getChild(1).getVariable() instanceof LocalParameter)) {
      System.out.println("The local parameter k is not found!");
    }
View Full Code Here

Examples of org.sbml.jsbml.SBMLReader

      System.out.println("Usage: java validateSBML filename");
      System.exit(1);
    }

    String filename       = args[0];
    SBMLReader reader     = new SBMLReader();
    SBMLDocument document;
    long start, stop;

    start    = System.currentTimeMillis();
    document = reader.readSBML(filename);
    stop     = System.currentTimeMillis();

    if (document.getErrorCount() > 0)
    {
      print("Encountered the following errors while reading the SBML file:\n");
View Full Code Here

Examples of org.sbml.jsbml.SBMLReader

      instream = sbmlStream;
    else
      throw new IOException("No file to open!");
   
    // Read SBML document if valid SBML   
      SBMLReader reader = new SBMLReader();
    try {
      document = reader.readSBMLFromStream(instream);
      createCytoscapeGraphFromSBMLDocument();
    }
    catch (XMLStreamException e) {
      e.printStackTrace();
      document = null;
View Full Code Here

Examples of org.sbml.jsbml.SBMLReader

   *
   */
  @SuppressWarnings("deprecation")
@Test public void test_read_l2v1_assignment()
  {
    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();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.