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


    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

    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

  @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

   *
   * @see org.sbml.jsbml.util.Filter#accepts(java.lang.Object)
   */
  public boolean accepts(Object o) {
    if (o instanceof CVTerm) {
      CVTerm cvt = (CVTerm) o;
      if (qualifier != null) {
        if (cvt.isBiologicalQualifier()
            && (cvt.getBiologicalQualifierType() == qualifier)) {
          return pattern != null ? cvt.filterResources(pattern)
              .size() > 0 : true;
        } else if (cvt.isModelQualifier()
            && cvt.getModelQualifierType() == qualifier) {
          return pattern != null ? cvt.filterResources(pattern)
              .size() > 0 : true;
        }
      } else if (pattern != null) {
        return cvt.filterResources(pattern).size() > 0;
      }
    } else if (o instanceof SBase) {
      SBase sbase = (SBase) o;
      if (qualifier != null) {
        if (pattern != null) {
View Full Code Here

    // 'li' subelement of the 'Bag' subelement of the 'Miriam-Qualifier' node.
    // When this parser is parsing the rdf annotation, some rdf attributes can appear. Try to
    // read them.
    else if (contextObject instanceof CVTerm && previousElements.containsKey("CVTerm")){
      if (previousElements.get("CVTerm").equals("li")){
        CVTerm cvterm = (CVTerm) contextObject;
        isReadAttribute = cvterm.readAttribute(elementName, attributeName, prefix, value);
      }
    }
   
    if (!isReadAttribute){
      logger.warn("RDFAnnotationParser : processAttribute : found an unknown attribute '" +
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 {
View Full Code Here

      // This parser can parse only model Miriam qualifiers. This element should not have attributes or namespace declarations.
      // Creates a new CVTerm and
      // sets the qualifierType and modelQualifierType of this CVTerm. Then, adds the
      // initialised CVTerm to annotation.
      if (modelQualifierMap.containsKey(elementName) && !hasNamespaces && !hasAttributes){
        CVTerm cvTerm = new CVTerm();
        cvTerm.setQualifierType(Type.MODEL_QUALIFIER);
        cvTerm.setModelQualifierType(modelQualifierMap.get(elementName));
       
        annotation.addCVTerm(cvTerm);
        return cvTerm;
      }
      else {
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

    // 'li' subelement of the 'Bag' subelement of the 'Miriam-Qualifier' node.
    // When this parser is parsing the rdf annotation, some rdf attributes can appear. Try to
    // read them.
    else if (contextObject instanceof CVTerm && previousElements.containsKey("CVTerm")){
      if (previousElements.get("CVTerm").equals("li")){
        CVTerm cvterm = (CVTerm) contextObject;
        isReadAttribute = cvterm.readAttribute(elementName, attributeName, prefix, value);
      }
    }
   
    if (!isReadAttribute){
      logger.warn("RDFAnnotationParser : processAttribute : found an unknown attribute '" +
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.