Frank Bergmann - 2015-01-20

NOTICE NOTICE NOTICE
The comments associated with this ticket were lost in late 2014.
The SBML Team manually recovered the comments. The text is appended below.
NOTICE NOTICE NOTICE


Comment By: Frank Bergmann (fbergmann)
Date: 2013-09-12 19:20

Hello Jeremy,

it is actually working, and you were almost there, however it will only work, once the meta id is set on the sbase element:

>>> s.setAnnotation(species_annotation % ('foo', 'foo', 'foo', 'foo', 'foo', 'foo', 'foo', 'foo'))
-2
>>> s.setMetaId('foo')
0
>>> s.setAnnotation(species_annotation % ('foo', 'foo', 'foo', 'foo', 'foo', 'foo', 'foo', 'foo'))
0

i hope this works for you ...


Comment By: Jeremy D Zucker (djinnome)
Date: 2013-09-12 19:59

Hi Frank,

That worked perfectly.

Thanks so much!

Jeremy

On Thu, Sep 12, 2013 at 3:20 PM, Frank Bergmann fbergmann@users.sf.netwrote:

Hello Jeremy,

it is actually working, and you were almost there, however it will only
work, once the meta id is set on the sbase element:

s.setAnnotation(species_annotation % ('foo', 'foo', 'foo', 'foo', 'foo', 'foo', 'foo', 'foo'))-2>>> s.setMetaId('foo')0>>> s.setAnnotation(species_annotation % ('foo', 'foo', 'foo', 'foo', 'foo', 'foo', 'foo', 'foo'))0

i hope this works for you ...

Status: open
Created: Thu Sep 12, 2013 07:02 PM UTC by Jeremy D Zucker
Last Updated: Thu Sep 12, 2013 07:02 PM UTC
Owner: nobody

Hi folks,

I am trying to annotate species with the following rdf string in python
libsbml.

species_annotation = """ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#%s">
<bqbiol:is>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:biocyc:NC10:%s"/>
<rdf:li rdf:resource="urn:miriam:pubchem:%s"/>
<rdf:li rdf:resource="urn:miriam:chebi:%s"/>
<rdf:li rdf:resource="urn:miriam:cas:%s"/>
</rdf:Bag>
</bqbiol:is>
</rdf:Description> <rdf:Description rdf:about="#%s"> <in:inchi xmlns:in="http://biomodels.net/inchi" metaid="#%s">%s</in:inchi> </rdf:Description> </rdf:RDF>"""

However, in libsbml 5.8.0 (but not 5.5 or lower), I get the following
error:

s = libsbml.Species(2, 1)s = libsbml.Species(2, 1)>>> s.setName('foo')s.setName('foo')0>>> s.setAnnotation(species_annotation % ('foo', 'foo', 'foo', 'foo', 'foo', 'foo', 'foo', 'foo'))s.setAnnotation(species_annotation % ('foo', 'foo', 'foo', 'foo', 'foo', 'foo', 'foo', 'foo
'))-2>>> libsbml.LIBSBML_UNEXPECTED_ATTRIBUTE-2>>>

Note that this code works just fine in libsbml 5.5.0

Does this mean that libsbml 5.8.0 no longer accepts strings as input for
the setAnnotation method?


Sent from sourceforge.net because you indicated interest in
https://sourceforge.net/p/sbml/libsbml/361/

To unsubscribe from further messages, please visit
https://sourceforge.net/auth/subscriptions/

--
Jeremy Zucker
Associate Computational Biologist
Broad Institute

 

Related

libSBML: #361