jjtapia / nfsim

Automatically exported from code.google.com/p/nfsim
0 stars 0 forks source link

NFsim unable to process XML from BNG if using PLUS/MINUS operators and generate_network() called before writeXML() #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In the attached BNGL file, call generate_network() before simulate_nf().

What is the expected output? What do you see instead?
NFsim throws the following error message:

Error log:
You are trying to create a molecule of type 'Y', but you gave an 
invalid state! The state you gave was: 'MINUS'.  Quitting now.

Please use labels and text to provide additional information.
It appears that what's happening is that BNG creates the additional species 
Y(state~MINUS) and Y(state~PLUS) when it generates the network (this can be 
seen in the attached NET file). These then get added to the ListOfSpecies in 
the XML file (also attached). When NFsim processes the ListOfMoleculeTypes it 
recognizes PLUS/MINUS and automatically creates the molecule type 
Y(state~integer[0-10]). But then when it processes the ListOfSpecies it finds 
the species Y(state~MINUS). Since 'MINUS' is no longer a state value in the 
molecule type it throws an error that an invalid state value has been used.

Since NFsim already automatically recognizes PLUS/MINUS and removes them from 
the molecule type declaration, it seems like it could also automatically skip 
any species that have these state values. I'm not sure if this would completely 
solve the problem, and I'm not sure if it's completely safe to do, but it might 
be worth investigating. It seems like network generation should not have any 
effect on the ability to run netfree simulations in NFsim.

Original issue reported on code.google.com by lh64@cornell.edu on 29 May 2013 at 10:08

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by lh64@cornell.edu on 29 May 2013 at 10:10