| Author | Topic |
Posts: 10
Registered: April 2011
|
|
Re: create compartment is missing id
|
19 Apr '11 01:34
|
 |
|
Thanks it's working now.
Regards,
Eyal
On Mon, Apr 18, 2011 at 7:28 PM, Andreas Dräger <
andreas.draeger@uni-tuebingen.de> wrote:
> Hi Spike,
>
> It is really not obvious why you create an invalid model here.
>
> final SBMLDocument document = new SBMLDocument(2, 4);
>>> document.createModel("MyModel");
>>> Compartment compartment = new Compartment();
>>>
>>
> Here is the problem. You didn't specifiy the Level/Version combination for
> your compartment.
>
> compartment.setId("SPIKE_cell");
>>> compartment.setName("SPIKE_cell");
>>> compartment.setMetaId("meta_" + compartment.getId());
>>> ListOf<Compartment> listOfCompartments = new ListOf<Compartment>();
>>>
>>
> You also didn't specify the Level/Version of this list. Actually, it should
> not be possible to set a list with undefined Level/Version combination for a
> model that obviously has a defined LV configuration. I'll check this
> problem.
>
> listOfCompartments.add(compartment );
>>>
>>> document.getModel().setListOfCompartments(listOfCompartments );
>>>
>>
> What happens is that when writing this model to XML the writer does not
> know that you desire to write a compartment of Level 2, it therefore only
> writes the name as this is done in Level 1. I'll change this slightly to
> avoid this behavior, but please change your code as follows:
>
> final SBMLDocument document = new SBMLDocument(2, 4);
> Model model = document.createModel("MyModel");
> Compartment compartment = model.createCompartment();
> compartment.addChangeListener(new
> SimpleSBaseChangeListener());
> compartment.setId("SPIKE_cell");
> compartment.setName("SPIKE_cell");
> compartment.setMetaId("meta_" + compartment.getId());
> (new SBMLWriter()).write(document, System.out);
>
> Cheers
> Andreas
>
> --
> Dr. Andreas Dräger
> University of Tuebingen
> Center for Bioinformatics Tuebingen (ZBIT)
> Sand 1
> 72076 Tübingen
> Germany
>
> Phone: +49-7071-29-78982
> Fax: +49-7071-29-5091
>
____________________________________________________________
To manage your jsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/jsbml-development
For a web interface to the jsbml-development mailing list, visit
http://sbml.org/Forums/
For questions or feedback about the jsbml-development list,
contact sbml-team@caltech.edu
|
|
|