Package org.sbml.jsbml

Examples of org.sbml.jsbml.CVTerm


      // sets the qualifierType and biologicalQualifierType of this
      // CVTerm. Then, adds the
      // initialized CVTerm to annotation.
      if (biologicalQualifierMap.containsKey(elementName)
          && !hasAttributes && !hasNamespaces) {
        CVTerm cvTerm = new CVTerm();
        cvTerm.setQualifierType(Type.BIOLOGICAL_QUALIFIER);
        cvTerm.setBiologicalQualifierType(biologicalQualifierMap
            .get(elementName));

        annotation.addCVTerm(cvTerm);
        return cvTerm;
      } else {
View Full Code Here


  }

  @Test
  public void test_CVTerm_addResource()
  {
    CVTerm term = new  CVTerm(); // TODO : difference to document => CVTerm term = new  CVTerm(CVTerm.Type.MODEL_QUALIFIER); constructor does not exist
    term.setQualifierType(CVTerm.Type.MODEL_QUALIFIER);   
    String resource =  "GO6666";
    assertTrue( term != null );
    assertTrue( term.getQualifierType() == CVTerm.Type.MODEL_QUALIFIER ); // TODO : difference to document ==> CVTerm.Type.MODEL_QUALIFIER
    term.addResource(resource);
    List<String> xa = term.getResources(); // TODO : difference to document ==> term.getResources(); does not return XMLAttributes but a List<String>
    assertTrue( xa.size() == 1 );
    // assertTrue(xa.getName(0).equals( "rdf:resource"));
    assertTrue(xa.get(0).equals( "GO6666"));
    term = null;
  }
View Full Code Here

    term = null;
  }

  @Test public void test_CVTerm_create()
  {
    CVTerm term = new  CVTerm();
    term.setQualifierType(CVTerm.Type.MODEL_QUALIFIER)
    assertTrue( term != null );
    assertTrue( term.getQualifierType() == CVTerm.Type.MODEL_QUALIFIER );
    term = null;
  }
View Full Code Here

  }
  */

  @Test public void test_CVTerm_getResources()
  {
    CVTerm term = new  CVTerm();
    term.setQualifierType(CVTerm.Type.MODEL_QUALIFIER);
    String resource =  "GO6666";
    String resource1 =  "OtherURI";
    long number;
    term.addResource(resource);
    term.addResource(resource1);
    number = term.getNumResources();
    assertTrue( number == 2 );
    assertTrue(term.getResourceURI(0).equals( "GO6666"));
    assertTrue(term.getResourceURI(1).equals( "OtherURI"));
    term = null;
  }
View Full Code Here

    term = null;
  }

  @Test public void test_CVTerm_set_get()
  {
    CVTerm term = new  CVTerm();
    term.setQualifierType(CVTerm.Type.MODEL_QUALIFIER);
    assertTrue( term != null );
    assertTrue( term.getQualifierType() == CVTerm.Type.MODEL_QUALIFIER );
    term.setModelQualifierType(CVTerm.Qualifier.BQM_IS); // TODO : difference to document ==> libsbml.BQM_IS become
    assertTrue( term != null );
    assertTrue( term.getQualifierType() == CVTerm.Type.MODEL_QUALIFIER );
    assertTrue( term.getModelQualifierType() == CVTerm.Qualifier.BQM_IS );
    term.setQualifierType(CVTerm.Type.BIOLOGICAL_QUALIFIER);
    term.setBiologicalQualifierType(CVTerm.Qualifier.BQB_IS);
    assertTrue( term.getQualifierType() == CVTerm.Type.BIOLOGICAL_QUALIFIER );
    assertTrue( term.getBiologicalQualifierType() == CVTerm.Qualifier.BQB_IS );
    term = null;
  }
View Full Code Here

    SBMLDocument sbmlDoc = new SBMLDocument(3, 1);
    Model model = sbmlDoc.createModel("m_default_name");

    model.getHistory().addModifiedDate(Calendar.getInstance().getTime());
    model.getAnnotation().addCVTerm(new CVTerm(CVTerm.Qualifier.BQB_IS, "urn:miriam:obo.go:GO%3A1234567"));

    QualitativeModel qModel = new QualitativeModel(model);

    model.addExtension(QUAL_NS_PREFIX, qModel);

    if (model.getExtension(QUAL_NS) == null) {
      System.out.println("!!!!!!! getting a plugin object using a namespace does not work");
    }
   
    // ListOfCompartments
    Compartment comp1 = model.createCompartment("comp1");
    comp1.setConstant(true);

    // ListOfQualitativeSpecies
    QualitativeSpecies g0 = qModel.createQualitativeSpecies("G0", comp1.getId(), false);
    g0.setMaxLevel(1);
    g0.setInitialLevel(0);

    g0.getAnnotation().addCVTerm(new CVTerm(CVTerm.Qualifier.BQB_IS, "urn:miriam:obo.go:GO%3A1234567"));
    g0.setNotes("<notes>\n\t<body xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t<p>TestNotes parsing &#285; &#65;</p>\n\t</body>\n</notes>");

    QualitativeSpecies g1 = qModel.createQualitativeSpecies("G1", comp1.getId(), false);
    g1.setName("G1 name");
    g1.setMaxLevel(3);
    g1.setInitialLevel(1);


    QualitativeSpecies g2 = qModel.createQualitativeSpecies("G2", comp1.getId(), false);
    g2.setMaxLevel(2);
    g2.setInitialLevel(2);

    g2.getAnnotation().addCVTerm(new CVTerm(CVTerm.Qualifier.BQB_IS, "urn:miriam:obo.go:GO%3A1234567"));
    g2.getHistory().addModifiedDate(Calendar.getInstance().getTime());

    QualitativeSpecies g3 = qModel.createQualitativeSpecies("G3", comp1.getId(), true);
    g3.setMaxLevel(1);
    g3.setInitialLevel(1);
View Full Code Here

    SBMLDocument doc = new SBMLDocument(2, 4);
    doc.setNotes("<body>Senseless test commentar</body>");

    Model m = doc.createModel("model");

    CVTerm term = new CVTerm();
    term.setQualifierType(Type.MODEL_QUALIFIER);
    term.setModelQualifierType(Qualifier.BQM_IS);
    term.addResource("urn:miriam:kegg.pathway:hsa00010");
    m.addCVTerm(term);

    History history = new History();
    Creator creator = new Creator();
    creator.setFamilyName("Dr\u00e4ger");
View Full Code Here

  @Test public void checkHashCode() throws ParseException {
    SBMLDocument doc1 = new SBMLDocument(3, 1);
    Model model = doc1.createModel("test_model");
    Compartment c = model.createCompartment("c1");
    Species s = model.createSpecies("s1", c);
    s.addCVTerm(new CVTerm(CVTerm.Qualifier.BQB_IS, "urn:miriam:kegg.compound:C00001"));
    Rule r = model.createAlgebraicRule();
    r.setMath(ASTNode.parseFormula("sin(3) + 1"));
   
    SBMLDocument doc2 = doc1.clone();
    assertTrue(doc1.hashCode() == doc2.hashCode());
    assertTrue(model.hashCode() != doc2.hashCode());
    assertTrue(s.getCVTerm(0).equals(new CVTerm(CVTerm.Qualifier.BQB_IS, "urn:miriam:kegg.compound:C00001")));
    assertTrue(s.getCVTerm(0).hashCode() == (new CVTerm(CVTerm.Qualifier.BQB_IS, "urn:miriam:kegg.compound:C00001")).hashCode());
    assertTrue(doc1.equals(doc2));
    assertTrue(doc2.equals(doc1));
  }
View Full Code Here

      Model m2 = new Model("model1", 2, 4);
     
      Species s1 = m.createSpecies("id1");
     
      Annotation annotation = new Annotation();
      CVTerm cvterm = new CVTerm();
      cvterm.addResource("urn.miriam.obo.go#GO%3A1234567");
      cvterm.setQualifierType(Type.BIOLOGICAL_QUALIFIER);
      cvterm.setBiologicalQualifierType(Qualifier.BQB_IS);
     
      annotation.addCVTerm(cvterm);
     
      System.out.println("The Annotation is still empty as there is no metaid defined on the species !!");
      System.out.println("@" + s1.getAnnotationString() + "@");
     
      s1.setMetaId("meta4");
      s1.setAnnotation(annotation);
     
      System.out.println("After adding a metaid on the species, the Annotation String get generated as it should.");
      System.out.println("@" + s1.getAnnotationString() + "@");
     


      String urn_id = "C00001";
     
      Species specie = m2.createSpecies();
      specie.setId("S2");
      specie.setName("S2");
      // specie.setCompartment(compartment);
      specie.setInitialAmount(1);

      annotation = new Annotation();
      CVTerm cvTerm = new CVTerm(Qualifier.BQB_IS);
      cvTerm.setQualifierType(Type.BIOLOGICAL_QUALIFIER);
     
      if(urn_id.startsWith("C"))
      {
      cvTerm.addResource("urn:miriam:kegg.compound:" + urn_id);
      annotation.addCVTerm(cvTerm);
      annotation.appendNoRDFAnnotation("http://www.genome.jp/dbget-bin/www_bget?cpd:"+urn_id);
      }
     
      if(urn_id.startsWith("G"))
      {
      cvTerm.addResource("urn:miriam:kegg.glycan:" + urn_id);
      annotation.addCVTerm(cvTerm);
      annotation.appendNoRDFAnnotation("<myApp:xxx>http://www.genome.jp/dbget-bin/www_bget?gl:"+urn_id + "</myApp:xxx>");
      }
     
      if (urn_id.contains("."))
      {
      cvTerm.addResource("urn:miriam:ec-code:" + urn_id);
      annotation.addCVTerm(cvTerm);
      annotation.appendNoRDFAnnotation("http://www.genome.jp/dbget-bin/www_bget?ec:"+urn_id);
      }

      System.out.println("The Annotation is still empty as there is no metaid defined on the species !!");
View Full Code Here

    Model model = doc.createModel("test_model");
   
    Parameter k1 = model.createParameter("k1");
    Parameter k2 = model.createParameter("k2");

    k1.addCVTerm(new CVTerm(CVTerm.Qualifier.BQB_IS, "test"));
   
    k1.setConstant(false);
    k2.setConstant(false);
   
    Event event = model.createEvent("test_event");
View Full Code Here

TOP

Related Classes of org.sbml.jsbml.CVTerm

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.