|
Hi Sarah,
Thanks a lot for the tip - I completely forgot about the metaid! And it's
good to know the -2 is valid and what it means, even if it's not yet in the
docs.
Thanks! :)
2009/9/9 Sarah Keating <skeating@caltech.edu>
> Hi Allyson
>
> I think we have a break down in documentation :-)
>
> The return value -2 will be returned if the object on which you are
> attempting to set the CVTerm has no metaid value. The annotation is
> required to refer to the metaid and thus it doesn't make sense to add
> the CVTerm if the object has no metaid set.
>
> Sarah
>
> Allyson Lister wrote:
> > Hi all,
> >
> > I've had some odd behaviour with my CVTerms, and was wondering if someone
> > could tell me what I was doing wrong. :)
> >
> > (Jaunty, libsbml4.0.0, Java version of libsbml)
> >
> > Basically, I'm trying to create some new CVTerms and add them to the
> model
> > element. However, I'm in a method that only knows that model element is
> an
> > SBase object.
> >
> > // retrieveCVTerm adds qualifiertype and either modelqualifiertype or
> > biologicalqualifiertype, depending.
> > // In this case it adds a modelqualifiertype as described by the second
> > argument
> > // It then sends back the cvTerm created. While it uses the sBase object,
> it
> > DOES NOT modify it.
> > CVTerm cvTerm = retrieveCVTerm( sBase,
> > libsbmlConstants.MODEL_QUALIFIER, key );
> > // add uri to cvTerm
> > cvTerm.addResource( bqm );
> > System.err.println( "cvTerm.getNumResources() m = " +
> > cvTerm.getNumResources() );
> > int returnvalue = sBase.addCVTerm( cvTerm );
> > System.err.println( "sBase.getNumCVTerms() m : " +
> > sBase.getNumCVTerms() );
> > System.err.println( "Return value: " + returnvalue );
> > if ( returnvalue ==
> > libsbmlConstants.LIBSBML_OPERATION_SUCCESS ) {
> > System.err.println( "return value OK." );
> > } else if ( returnvalue ==
> > libsbmlConstants.LIBSBML_OPERATION_FAILED ) {
> > System.err.println( "addition failed." );
> > } else {
> > System.err.println( "Unknown error value" );
> > }
> >
> > However, no matter how I run this, the CVTerm simply isn't getting added
> to
> > the sBase object, as evidenced by the output:
> >
> > cvTerm.getNumResources() m = 1
> > sBase.getNumCVTerms() m : 0
> >
> > When I try to load model qualifiers, the error value is odd:
> > Return value: -2
> > Unknown error value
> >
> > When I try to use the same code, but for biological qualifiers, the error
> > value is OK, *but* the CVTerm still isn't added to the sBase object:
> > Return value: 0
> > return value OK.
> >
> >
> > And the resulting SBML file does not have any MIRIAM annotations. The
> cvTerm
> > object is created, then added to sBase, but somehow the addition is
> failing.
> >
> > The docs (
> >
> http://sbml.org/Software/libSBML/docs/cpp-api/class_c_v_term.html#567c2728d8b1a9d7ee2b34ffc00a7f67
> )
> > say the only possible return values are
> > libsbmlConstants.LIBSBML_OPERATION_FAILED or
> > libsbmlConstants.LIBSBML_OPERATION_SUCCESS, but from the message above,
> it
> > looks like neither values are returned.
> >
> > Any help would be most appreciated!
> >
> > Thanks!
> >
>
> ____________________________________________________________
> To manage your sbml-interoperability list subscription, visit
> https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability
>
> For a web interface to the sbml-interoperability mailing list, visit
> http://sbml.org/Forums/
>
> For questions or feedback about the sbml-interoperability list,
> contact sbml-team@caltech.edu
>
--
Allyson Lister
http://themindwobbles.wordpress.com
CISBAN, http://www.cisban.ac.uk
Newcastle University
____________________________________________________________
To manage your sbml-interoperability list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/sbml-interoperability
For a web interface to the sbml-interoperability mailing list, visit
http://sbml.org/Forums/
For questions or feedback about the sbml-interoperability list,
contact sbml-team@caltech.edu
|