Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for stochastic simulation added #54

Merged
merged 48 commits into from Aug 14, 2020

Conversation

hemilpanchiwala
Copy link
Member

Updates from this PR:

  • The new test file StochasticTestSuiteTest is added to SBSCL which simulates all the stochastic tests from the SBML Test Suite.
  • Complete output format of FERN is now updated according to the test suite result format and all the tests now simulate fine.
  • 36 out of 39 tests now pass successfully (others fail as currently there is no support for rules and species with no substance units).
  • Also, as stochastic tests can fail sometimes due to randomness, so for passing the Travis CI, seed values for all the models have been collected and currently, tests are ran using these seed values, so tests run fast and pass successfully.
  • Minor fixes in CSVImporter and issues in test cases with the event (there was a triggering issue) that has been resolved now.
  • Repetitive initialization in the SBMLinterpreter class is removed.

With these updates and PR #53, stochastic simulation support is now added to SBSCL.
All the updates of the project are present at my blog posts at this link.

@zakharc
Copy link
Member

zakharc commented Aug 1, 2020

@hemilpanchiwala: Please clarify:

36 out of 39 tests now pass successfully (others fail as currently there is no support for rules and species with no substance units).
Also, as stochastic tests can fail sometimes due to randomness, so for passing the Travis CI, seed values for all the models have been collected, and currently, tests are ran using these seed values, so tests run fast and pass successfully.

I see 5 errors (not fails) with NPE in the build log:

[[1;31mERROR[m] testBasicSEDMLExecutorForMiriamURNDefinedModel(org.simulator.sedml.SEDMLExecutorTest)  Time elapsed: 2.067 s  <<< ERROR!
java.lang.NullPointerException
	at org.simulator.sedml.SEDMLExecutorTest.testBasicSEDMLExecutorForMiriamURNDefinedModel(SEDMLExecutorTest.java:137)

[[1;31mERROR[m] testLeloupSBML(org.simulator.sedml.SEDMLExecutorTest)  Time elapsed: 1.024 s  <<< ERROR!
java.lang.NullPointerException
	at org.simulator.sedml.SEDMLExecutorTest.testSpecificationExample(SEDMLExecutorTest.java:228)
	at org.simulator.sedml.SEDMLExecutorTest.testLeloupSBML(SEDMLExecutorTest.java:153)

[[1;31mERROR[m] testRepressilator1(org.simulator.sedml.SEDMLExecutorTest)  Time elapsed: 0.138 s  <<< ERROR!
java.lang.NullPointerException
	at org.simulator.sedml.SEDMLExecutorTest.testSpecificationExample(SEDMLExecutorTest.java:228)
	at org.simulator.sedml.SEDMLExecutorTest.testRepressilator1(SEDMLExecutorTest.java:249)

[[1;31mERROR[m] testRepressilator(org.simulator.sedml.SEDMLExecutorTest)  Time elapsed: 0.057 s  <<< ERROR!
java.lang.NullPointerException
	at org.simulator.sedml.SEDMLExecutorTest.testSpecificationExample(SEDMLExecutorTest.java:228)
	at org.simulator.sedml.SEDMLExecutorTest.testRepressilator(SEDMLExecutorTest.java:200)

[[1;31mERROR[m] testIkappab(org.simulator.sedml.SEDMLExecutorTest)  Time elapsed: 0.03 s  <<< ERROR!
java.lang.NullPointerException
	at org.simulator.sedml.SEDMLExecutorTest.testSpecificationExample(SEDMLExecutorTest.java:228)
	at org.simulator.sedml.SEDMLExecutorTest.testIkappab(SEDMLExecutorTest.java:147)

Also, tons of warnings of this type:

WARNING: [VIOLATION]	(k1 < 10) && (k1 > 0) at time 6.4: 
Jul 30, 2020 3:28:58 AM org.simulator.sbml.SimpleConstraintListener processViolation
WARNING: [VIOLATION]	(k1 < 10) && (k1 > 0) at time 6.4: 
Jul 30, 2020 3:28:58 AM org.simulator.sbml.SimpleConstraintListener processViolation
WARNING: [VIOLATION]	(k1 < 10) && (k1 > 0) at time 6.4: 
Jul 30, 2020 3:28:58 AM org.simulator.sbml.SimpleConstraintListener processViolation
WARNING: [VIOLATION]	(k1 < 10) && (k1 > 0) at time 6.4: 
Jul 30, 2020 3:28:58 AM org.simulator.sbml.SimpleConstraintListener processViolation
WARNING: [VIOLATION]	(k1 < 10) && (k1 > 0) at time 6.4: 
Jul 30, 2020 3:28:58 AM org.simulator.sbml.SimpleConstraintListener processViolation
WARNING: [VIOLATION]	(k1 < 10) && (k1 > 0) at time 6.4: 
Jul 30, 2020 3:28:58 AM org.simulator.sbml.SimpleConstraintListener processViolation
WARNING: [VIOLATION]	(k1 < 10) && (k1 > 0) at time 6.4: 
Jul 30, 2020 3:28:58 AM org.simulator.sbml.SimpleConstraintListener processViolation
WARNING: [VIOLATION]	(k1 < 10) && (k1 > 0) at time 6.4: 
Jul 30, 2020 3:28:58 AM org.simulator.sbml.SimpleConstraintListener processViolation
WARNING: [VIOLATION]	(k1 < 10) && (k1 > 0) at time 6.4: 
Jul 30, 2020 3:28:58 AM org.simulator.sbml.SimpleConstraintListener processViolation
WARNING: [VIOLATION]	(k1 < 10) && (k1 > 0) at time 6.5: 
Jul 30, 2020 3:28:58 AM org.simulator.sbml.SimpleConstraintListener processViolation
WARNING: [VIOLATION]	(k1 < 10) && (k1 > 0) at time 6.6: 
Jul 30, 2020 3:28:58 AM org.simulator.sbml.SimpleConstraintListener processViolation
WARNING: [VIOLATION]	(k1 < 10) && (k1 > 0) at time 6.4: 
Jul 30, 2020 3:28:58 AM org.simulator.sbml.SimpleConstraintListener processViolation

Or this:

 WARN (SBMLReader.java:1096) - Cannot find a parser for the  namespace
 WARN (SBMLReader.java:1324) - !!! event.isEndElement: there is a problem in your SBML file !!!!
 WARN (SBMLReader.java:1325) - This should never happen, there is probably a problem with the parsers used.
 Try to check if one needed parser is missing or if you are using a parser in development.
 WARN (SBMLReader.java:1096) - Cannot find a parser for the  namespace
 WARN (SBMLReader.java:1096) - Cannot find a parser for the  namespace
 WARN (SBMLReader.java:808) - Some characters cannot be read: type
 WARN (SBMLReader.java:1324) - !!! event.isEndElement: there is a problem in your SBML file !!!!
 WARN (SBMLReader.java:1325) - This should never happen, there is probably a problem with the parsers used.
 Try to check if one needed parser is missing or if you are using a parser in development.
 WARN (SBMLReader.java:808) - Some characters cannot be read:  Status report
 WARN (SBMLReader.java:1324) - !!! event.isEndElement: there is a problem in your SBML file !!!!
 WARN (SBMLReader.java:1325) - This should never happen, there is probably a problem with the parsers used.
 Try to check if one needed parser is missing or if you are using a parser in development.

Is this expected?

log.txt

@hemilpanchiwala
Copy link
Member Author

hemilpanchiwala commented Aug 1, 2020

@zakharc, the reason for Travis CI failing currently is that for the simulation of the SED-ML models, it downloads the models via a URN from biomodels. But currently, the site from which it downloads is down, so the tests are failing.

This is what gets downloaded currently as a SEDML model

<title>Apache Tomcat/8.0.24 - Error report</title><style type="text/css">H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}.line {height: 1px; background-color: #525D76; border: none;}</style>

HTTP Status 404 - /biomodels-main/download

type Status report

message /biomodels-main/download

description The requested resource is not available.


Apache Tomcat/8.0.24

So, once the site runs fine, these tests will pass fine. Also, the SBMLReader warnings are due to this as it is interpreting the above code as a model.

@hemilpanchiwala
Copy link
Member Author

For the tons of warnings of [VIOLATION]...., I don't have any idea about them currently as I have not worked on them. I will see that test file and try to figure out why this warnings come.

@zakharc
Copy link
Member

zakharc commented Aug 1, 2020

@hemilpanchiwala:

so the tests are failing.

As I said in my previous post (and highlighted in bold text):
I see 5 errors (not fails) with NPE.
Fail: Our code does not meet its test criteria. That means that the test case fails due to assertions not being fulfilled.
Error: We have an unexpected situation during test execution.
Do we talk about the same tests?

the reason for Travis CI failing currently is that for the simulation of the SED-ML models, it downloads the models via a URN from biomodels. But currently, the site from which it downloads is down.

I am quite sure, that throwing NPE on this scenario is not the best idea. If this is the reason for the errors, we need a meaningful exception for that.

So, once the site runs fine, these tests will pass fine.

I think re-triggering the build would be a good idea. I would like to see it pass :)

For the tons of warnings of [VIOLATION]...., I don't have any idea about them currently as I have not worked on them. I will see that test file and try to figure out why these warnings come.

👍

@hemilpanchiwala
Copy link
Member Author

hemilpanchiwala commented Aug 1, 2020

@zakharc,

As I said in my previous post (and highlighted in bold text):
I see 5 errors (not fails) with NPE.
Fail: Our code does not meet its test criteria. That means that the test case fails due to assertions not being fulfilled.
Error: We have an unexpected situation during test execution.
Do we talk about the same tests?

Yes, I am talking about these tests only. I get the model as a string which I sent in my last message. Then this model is passed to SBMLReader which reads and only gives warnings (but simulation runs further). And at a point, when any field is accessed from this, it gets a null value. This is the reason why NPE is given.

I have run the tests again but currently, also the tests are failing. But I am sure that the Travis will pass once this thing is running as the fern branch has a passing Travis in my forked repository.

}

}
package fern.network.sbml;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused on this file. It says everything changed, but this is clearly code which existed before somewhere ?! Same with the example/Dsmts.java above.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthiaskoenig, this happened due to different line separators in Windows (CRLF) and Ubuntu (LF). The file content remains the same only the line separators are different (as FERN is developed in Windows and I am working on Ubuntu).

src/main/java/fern/simulation/Simulator.java Outdated Show resolved Hide resolved
src/main/java/fern/simulation/Simulator.java Outdated Show resolved Hide resolved
src/main/java/fern/simulation/Simulator.java Outdated Show resolved Hide resolved
src/main/java/org/simulator/comp/CompSimulator.java Outdated Show resolved Hide resolved
@hemilpanchiwala
Copy link
Member Author

@zakharc, I have updated most of the requested changes. I have some questions in few which I have commented, once you answer that I will update that changes too.

Copy link
Collaborator

@shalinshah1993 shalinshah1993 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added small changes but otherwise LGTM!

@draeger draeger merged commit 79f9593 into draeger-lab:master Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run FBA tests on all BiGG models FBA gives incorrect objective_value 0 for bigg models iMM1415 & iRC1080
5 participants