Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » sbml-interoperability » question about CVTerms
Show: Today's Posts  :: Message Navigator
| Subscribe to topic 
Return to the default flat view Create a new topic Submit Reply
AuthorTopic
Allyson Lister


Posts: 88
Registered:
December 2007
Re: question about CVTerms 17 Sep '09 01:06 Go to previous messageGo to previous message

Hi all,

I have another question about CVTerms that is very similar to this one,
which is why I am replying to this thread.

I've created the attached test class (with two test methods), and every time
I add a CVTerm, it doesn't actually get added. The return value of the
addCVTerm() always comes back good, in both methods, but the assertion that
the number of CVTerms is 4 doesn't work - it always says its 1.

I'm trying to reproduce the style of annotation we find in BioModels, where
the ultimate annotation should look like:

<bqbiol:isVersionOf>
<rdf:bag>
<rdf:li rdf:resource="http://some.uri.thing.1"/>
</rdf:bag>
</bqbiol:isVersionOf>
<bqbiol:isVersionOf>
<rdf:bag>
<rdf:li rdf:resource="http://some.uri.thing.2"/>
</rdf:bag>
</bqbiol:isVersionOf>
<bqbiol:isVersionOf>
<rdf:bag>
<rdf:li rdf:resource="http://some.uri.thing.3"/>
</rdf:bag>
</bqbiol:isVersionOf>
<bqbiol:isVersionOf>
<rdf:bag>
<rdf:li rdf:resource="http://some.uri.thing.4"/>
</rdf:bag>
</bqbiol:isVersionOf>

Yes, that is virtually the same annotation repeated 4 times, but conceivably
this could happen. Why is only one CVTerm getting added in both test
methods?

thanks :)
Allyson

2009/9/9 Allyson Lister <allyson.lurena@googlemail.com>

> 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
>



--
Allyson Lister
http://themindwobbles.wordpress.com

CISBAN, http://www.cisban.ac.uk
Newcastle University

Attachment: AddCVTermsTest.java
(Size: 3.13KB, Downloaded 178 time(s))
      

SubjectPosterDate
Read Message   question about CVTerms Allyson Lister09 Sep '09 03:00
Read Message   Re: question about CVTerms Sarah Keating09 Sep '09 04:46
Read Message   Re: question about CVTerms Allyson Lister09 Sep '09 05:10
Read Message   Re: question about CVTerms  Allyson Lister17 Sep '09 01:06
Read Message   Re: question about CVTerms Sarah Keating17 Sep '09 02:09
Read Message   Re: question about CVTerms Allyson Lister17 Sep '09 02:19
Read Message   Re: question about CVTerms Sarah Keating17 Sep '09 04:13
Read Message   Re: question about CVTerms Allyson Lister17 Sep '09 04:21
Read Message   Re: question about CVTerms Stefan.Hoops17 Sep '09 07:54
Read Message   Re: question about CVTerms Allyson Lister17 Sep '09 08:06
Read Message   Re: question about CVTerms Sarah Keating17 Sep '09 08:10
Read Message   Re: question about CVTerms Stefan.Hoops17 Sep '09 11:05
Read Message   Re: question about CVTerms Mike Hucka19 Sep '09 19:14
Read Message   Re: question about CVTerms curoli20 Sep '09 16:24
Read Message   Re: question about CVTerms Stefan.Hoops17 Sep '09 05:31
Read Message   Re: question about CVTerms curoli17 Sep '09 08:40
Read Message   Re: question about CVTerms Stefan.Hoops17 Sep '09 11:03
Read Message   Re: question about CVTerms curoli17 Sep '09 11:59
Read Message   Re: question about CVTerms curoli17 Sep '09 12:19
Previous Topic:Extracting All SBase objects
Next Topic:removal of CV terms from annotation
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.