Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » sbml-interoperability » simple question about adding a species
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: simple question about adding a species 22 Jan '09 01:31 Go to previous messageGo to previous message

Hi Frank,

This sounds and looks very much like C++ code ;) While I used to use that
back in a previous job, here I'm using the Java version of libSBML, and as
Neil pointed out, when we run getSpecies() in Java, I don't think we get
back a reference/pointer - I think it's a copy. I even tried removing the
"final" parts of Neil's code above, to make sure that wasn't the problem,
but I get the same results as he does.

Very good idea, but not sure it will work for us Java-ites.

thanks very much! :)

2009/1/21 Frank Bergmann <fbergman@u.washington.edu>

> Actually it is easier than all that, all you need to do, is to get
> your species
>
> Species *species = model->getSpecies("sbmlId" or unsigned int index);
>
> now you check whether the species was there, by testing for NULL, and
> if all is well you do your modification:
>
> if (species != NULL) species->setInitialAmount(newValue);
>
> as you only received a reference to the actual species, all changes
> will be there the next time you write this model out.
>
> As to your question when does the validation happen, the next
> validation happens upon a call to checkConsinstency ... which will
> fill your error log ...
>
> i hope this helps,
> best
> Frank
>
> On Jan 21, 2009, at 3:49 AM, Allyson Lister wrote:
>
> > Hi all,
> >
> > I'm using libSbml 3.2.0 in its Java incarnation.
> >
> > I would like to get a species from a model (model.getSpecies(myId),
> > modify
> > it, and then put it back in, essentially overwriting what was there
> > before.
> > However, it is unclear from the docs whether
> > model.addSpecies( mySpecies)
> > will overwrite any existing species with that same id, or if it will
> > not add
> > the new version of the species. Alternatively, should I remove the old
> > version first, and then add the new species (I'm guessing that's
> > not an
> > option, as it will mess up all existing links to that species within
> > the
> > model). Looking at the C++ code, it seems to run an append()
> > function over
> > the species set, but I don't know if that append function will allow
> > duplicates or not, or how duplicates are determined. I may be
> > overthinking
> > this, but the best way to do this would be great!
> >
> > thanks,
> > allyson
> >
> > --
> >
> > Allyson Lister
> > http://lurena.vox.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
>
> ____________________________________________________________
> 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://lurena.vox.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

      

SubjectPosterDate
Read Message   simple question about adding a species Allyson Lister21 Jan '09 03:49
Read Message   Re: simple question about adding a species Alejandro21 Jan '09 08:55
Read Message   Re: simple question about adding a species Neil Swainston21 Jan '09 09:06
Read Message   Re: simple question about adding a species ajouraku22 Jan '09 01:57
Read Message   Re: simple question about adding a species Frank Bergmann21 Jan '09 09:18
Read Message   Re: simple question about adding a species Allyson Lister22 Jan '09 01:21
Read Message   Re: simple question about adding a species Neil Swainston22 Jan '09 01:50
Read Message   Re: simple question about adding a species Allyson Lister22 Jan '09 01:24
Read Message   Re: simple question about adding a species ajouraku22 Jan '09 03:56
Read Message   Re: simple question about adding a species Sarah Keating22 Jan '09 08:58
Read Message   Re: simple question about adding a species Mike Hucka02 Feb '09 22:21
Read Message   Re: simple question about adding a species  Allyson Lister22 Jan '09 01:31
Read Message   Re: simple question about adding a species Allyson Lister22 Jan '09 02:58
Read Message   Re: simple question about adding a species Allyson Lister22 Jan '09 09:21
Read Message   Re: simple question about adding a species Mike Hucka23 Jan '09 00:25
Read Message   Re: simple question about adding a species curoli23 Jan '09 06:19
Read Message   Re: simple question about adding a species Allyson Lister23 Jan '09 01:09
Previous Topic:Re: &quot; The basic libsbml library file&quot;
Next Topic:libsbml and tomcat
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.