Menu

#473 getAssociation() of reaction fbc:geneProductAssociation fails with Perl binding

libSBML-5.18.0
open
nobody
None
2020-03-05
2020-02-28
smoretti
No

Hi

with the Perl binding of libSBML 5.18.0/fbc on Linux, I try to get the fbc:geneProductAssociation of reactions.
Unfortunately it does not look to work.

my $fbcReaction = $reaction->getPlugin('fbc');
$fbcReaction->isSetGeneProductAssociation(); # returns true
$fbcReaction->getGeneProductAssociation(); #returns "$VAR1 = bless( {}, 'LibSBML::GeneProductAssociation' );" with Data::Dumper
$fbcReaction->getGeneProductAssociation()->isSetAssociation(); # returns true
$fbcReaction->getGeneProductAssociation()->getAssociation(); # returns NOTHING

Maybe I do something wrong, but it looks weird.
The same code in Java works.

Discussion

  • Michael Hucka

    Michael Hucka - 2020-03-04

    Thank you for reporting this. We will try to look at this problem as soon as we can.

     
  • smoretti

    smoretti - 2020-03-05

    Other methods to get fbc values work

     
  • Frank Bergmann

    Frank Bergmann - 2020-03-05

    I've tried for some time to make it work, but i really just don't understand why it is not. So the best i can offer is a workaround, that extends the geneProductAssociation by methods that oroduce the infix, or get the specific element.

    If this does work for you, i'll be happy to commit that. I'll attach an example, as well as a the updated local-fbc.i, that you will have to place into src/bindings/perl before compilation, so the example will work for you.

     
  • smoretti

    smoretti - 2020-03-05

    Currently I found another temporary way to get the geneProductAssociation with
    $fbcReaction->getGeneProductAssociation()->toXMLNode()->getChild(0)->toXMLString();

    Then I parse the XML

     
  • Frank Bergmann

    Frank Bergmann - 2020-03-05

    it might be easier to just call getGeneProductAssociation()->toSBML() that will give you the element as xml string.

     
  • smoretti

    smoretti - 2020-03-05

    Right, easier

     

Log in to post a comment.