Examples of SBMLDocument


Examples of org.sbml.jsbml.SBMLDocument

      String localName, boolean hasAttributes, boolean isLastNamespace,
      Object contextObject)
  {

    if (contextObject instanceof SBMLDocument) {
      SBMLDocument sbmlDocument = (SBMLDocument) contextObject;

      sbmlDocument.addNamespace(localName, prefix, URI);
     
      log4jLogger.debug("processNamespace: " + prefix + " = " + URI);
    }
    else if (contextObject instanceof SBase) {
      SBase sbase = (SBase) contextObject;
View Full Code Here

Examples of org.sbml.jsbml.SBMLDocument

          Annotation annotation = (Annotation) newContextObject;
          sbase.setAnnotation(annotation);

          return annotation;
        } else if (contextObject instanceof SBMLDocument) {
          SBMLDocument sbmlDocument = (SBMLDocument) contextObject;
          if (elementName.equals("model")) {
            Model model = (Model) newContextObject;
            model.setLevel(sbmlDocument.getLevel());
            model.setVersion(sbmlDocument.getVersion());
            model.initDefaults();
            sbmlDocument.setModel(model);

            return model;
          }
        } else if (contextObject instanceof Model) {
View Full Code Here

Examples of org.sbml.jsbml.SBMLDocument

        xmlObject.addAttributes(sbase.getDeclaredNamespaces());
      }
     
      if (sbase instanceof SBMLDocument) {
       
        SBMLDocument sbmlDocument = (SBMLDocument) sbmlElementToWrite;

        xmlObject.addAttributes(sbmlDocument
            .getSBMLDocumentNamespaces());
      }

      xmlObject.setPrefix("");
      xmlObject.setNamespace(JSBML.getNamespaceFrom(sbase.getLevel(), sbase.getVersion()));
View Full Code Here

Examples of org.sbml.jsbml.SBMLDocument

  /**
   * @throws java.lang.Exception
   */
  @Before
  public void setUp() throws Exception {
    docL3 = new SBMLDocument(3, 1);
    modelL3 = docL3.createModel("test");
    modelL3.createUnitDefinition("ud1");
    Compartment c = modelL3.createCompartment("comp");
    modelL3.createSpecies("s1", c);
    modelL3.createEvent("event");
   
    docL2V4 = new SBMLDocument(2, 4);
    modelL2V4 = docL2V4.createModel("test");
  }
View Full Code Here

Examples of org.sbml.jsbml.SBMLDocument

 
  /**
   *
   */
  @Before public void setUp() {
    doc = new SBMLDocument(2, 4);
    model = doc.createModel("model");
   
    Compartment comp = model.createCompartment("cell");
    comp.setMetaId("cell");
   
View Full Code Here

Examples of org.sbml.jsbml.SBMLDocument

   * Initialize an object
   */
  @Before
  public void init() {
    int level = 3, version = 1;
    SBMLDocument doc = new SBMLDocument(level, version);
    Model model = doc.createModel("test_model");
    sbase = model.createParameter("test_param");
    kind = Unit.Kind.AMPERE;
    assertTrue(!sbase.isSetUnits());
  }
View Full Code Here

Examples of org.sbml.jsbml.SBMLDocument

   */
  @SuppressWarnings("deprecation")
  @Test public void readL1V2Branch() throws XMLStreamException, InvalidPropertiesFormatException, IOException, ClassNotFoundException {
    String fileName = DATA_FOLDER + "/libsbml-test-data/l1v2-branch.xml";
   
    SBMLDocument doc = new SBMLReader().readSBMLFile(fileName);
    Model model = doc.getModel();
   
    assertTrue(doc.getLevel() == 1 && doc.getVersion() == 2);
   
    assertTrue(model.getLevel() == 1 && model.getVersion() == 2);
   
    // assertTrue(model.getId().equals("")); // TODO: document. Different behavior than libsbml, we set the id as the name for SBML level 1 models.
    assertTrue(model.getId().equals("Branch"));
View Full Code Here

Examples of org.sbml.jsbml.SBMLDocument

   * @throws InvalidPropertiesFormatException
   */
  @Test public void readL1V1Units() throws XMLStreamException, InvalidPropertiesFormatException, IOException, ClassNotFoundException {
    String fileName = DATA_FOLDER + "/libsbml-test-data/l1v1-units.xml";
   
    SBMLDocument doc = new SBMLReader().readSBMLFile(fileName);
    Model model = doc.getModel();
   
    assertTrue(doc.getLevel() == 1 && doc.getVersion() == 1);
   
    assertTrue(model.getLevel() == 1 && model.getVersion() == 1);
   
    assertTrue(model.getId().equals(""));
    assertTrue(model.getName().equals(""));
View Full Code Here

Examples of org.sbml.jsbml.SBMLDocument

   */
  @Test public void readL1V1Rules() throws XMLStreamException, InvalidPropertiesFormatException, IOException, ClassNotFoundException {

    String fileName = DATA_FOLDER + "/libsbml-test-data/l1v1-rules.xml";
   
    SBMLDocument doc = new SBMLReader().readSBMLFile(fileName);
    Model model = doc.getModel();
   
    assertTrue(doc.getLevel() == 1 && doc.getVersion() == 1);
   
    assertTrue(model.getLevel() == 1 && model.getVersion() == 1);
   
    assertTrue(model.getId().equals(""));
    assertTrue(model.getName().equals(""));
View Full Code Here

Examples of org.sbml.jsbml.SBMLDocument

  // USING THE LAYOUT EXTENSION FOR STORAGE ///
    // ??? FIXME: is the current Layout saved
  @Deprecated
  public static void saveLayoutOfCurrentViewInSBMLFile(File file){
    CyNetworkView view = Cytoscape.getCurrentNetworkView();
    SBMLDocument doc = writeLayoutOfNetworkViewToSBMLDocument(view);
    if (doc != null){
      try {
        SBMLWriter.write(doc, file, CySBML.NAME, CySBML.VERSION);
       
      } catch (SBMLException e) {
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.