biosimulators / Biosimulators_PySCeS

PySCeS biochemical network simulation program via BioSimulators-compliant command-line interface and Docker container
https://docs.biosimulators.org/Biosimulators_PySCeS
MIT License
2 stars 0 forks source link

Handle more Biomodels models #7

Open luciansmith opened 1 year ago

luciansmith commented 1 year ago

Here's links to all the biomodels that currently fail when running PySCeS:

pysces_failures.csv

(Many of these are probably due to #6; putting this here so I don't forget to update it when that gets fixed.)

jmrohwer commented 1 year ago

Thanks Lucian. New PySCeS release is currently waiting on a bug fix in numpy.f2py for Python 3.12 (https://github.com/numpy/numpy/issues/25000), which has been refactored to use meson due to the deprecation of distutils. As soon as this is fixed and I can build PySCeS again, I'll cut a release.

jmrohwer commented 6 months ago

Quoting @luciansmith from #6 here

The CI is indeed supposed to test everything, but it's always worth checking by hand. Which I did, and it worked! Congratulations!

https://run.biosimulations.org/runs/663eabc116d2b6badabee790

I also tried an updated OMEX file with 297 in it, which successfully ran, but which failed to produce output because of one of the updates: it asks for output from variables with assignment rules (i.e. 'Cdh1in'), and that failed. I'm not sure if that's a problem with the wrapper or PySCeS itself?

https://run.biosimulations.org/runs/663eac7216d2b6badabee7e1#tab=log

The following variable targets cannot not be recorded:
  - /sbml:sbml/sbml:model/sbml:listOfParameters/sbml:parameter[@id='Cdh1in']
  - /sbml:sbml/sbml:model/sbml:listOfParameters/sbml:parameter[@id='IEin']
  - /sbml:sbml/sbml:model/sbml:listOfParameters/sbml:parameter[@id='Mcmin']
  - /sbml:sbml/sbml:model/sbml:listOfParameters/sbml:parameter[@id='Mih1']
  - /sbml:sbml/sbml:model/sbml:listOfParameters/sbml:parameter[@id='SBFin']
  - /sbml:sbml/sbml:model/sbml:listOfParameters/sbml:parameter[@id='Swe1T']
  - /sbml:sbml/sbml:model/sbml:listOfParameters/sbml:parameter[@id='kmih']
  - /sbml:sbml/sbml:model/sbml:listOfParameters/sbml:parameter[@id='kswe']

Targets must have one of the following SBML ids:
  - BE
  - BUD
  - Cdc20
  - Cdc20a
  - Cdh1
  - Cdh1tot
[...]

However, this problem pales in comparison to the fact that I filed this issue almost a year ago, and the issue has been solved! The build system now runs fine, everything gets pushed to biosimulations, and the results can be compared to other simulators again! Thank you so much for all the work you put into making this possible; I was very lost at the beginning. I'm going to close this, re-run all the biomodels from my revamped temp-biomodels repository, and update #7 with the new list. Thank you again!

This is most definitely a wrapper issue. There have been major changes and fixes to the way PySCeS deals with assignment rules in version 1.1.1, and also on 1.2.0 and 1.2.1 there have been fixes to this functionality (the latter mainly having to do with substring matching). The wrapper in all eventuality predates this. The data are there:

>>>mod = pysces.model('BIOMD0000000297_url.xml.psc', '.')
>>>mod.__settings__['cvode_return_event_timepoints'] = False
>>>mod.doSim(end=140, points=200)
>>>mod.sim.columns
Index(['Time', 'Trim', 'Sic', 'Clb', 'PTrim', 'PClb', 'SBF', 'IE', 'Cdc20a',
       'Cdc20', 'Cdh1', 'Swe1', 'Swe1M', 'PSwe1', 'PSwe1M', 'Mih1a', 'Mcm',
       'BE', 'Cln', 'mass', 'R1', 'R2', 'R3', 'R4', 'R5', 'R6', 'R7', 'R8',
       'R9', 'R10', 'R11', 'R12', 'R13', 'R14', 'R15', 'R16', 'R18', 'R19',
       'R20', 'R21', 'R22', 'R23', 'R24', 'R25', 'R26', 'R27', 'R28', 'R29',
       'R30', 'R31', 'R32', 'R33', 'R34', 'R35', 'R36', 'R37', 'R38', 'R39',
       'R40', 'R41', 'R42', 'R43', 'R44', 'R45', 'R46', 'R47', 'R48', 'R49',
       'R50', 'R51', 'R52', 'kswe', 'kmih', 'SBFin', 'IEin', 'Cdh1in', 'Mih1',
       'Mcmin', 'Swe1T'],
      dtype='object')

mod.sim contains the simulation results. By default this is a numpy.recarray, but if the user has pandas installed, this can be changed to output a pandas DataFrame by setting mod.enableDataPandas(), which was done here. It is clear that the variables are all tracked by PySCeS.

I played no part in writing the wrapper for PySCeS, so would not really be able to help there unless I get into the code from scratch. But perhaps this info is sufficient to easily update the wrapper. Perhaps this should go into a new issue?

luciansmith commented 6 months ago

Thanks for the info! And yes, let's maybe use this issue (#7) to find particular problems and file those as different smaller-chunk issues?

The problem with the wrappers is that the person who wrote all the wrappers (Jonathan Karr) left to go work for industry, so we've been very slowly building back up wrapper expertise as we go. I can certainly take a look; hopefully the fix will be straightforward.

jmrohwer commented 6 months ago

Continued in #5 as that issue pertains to the present bug.

luciansmith commented 1 month ago

So! PySCeS version 1.2.2 is now up and running on biosimulators.org. I have not yet tackled the issue of exporting variables from assignment rules, but it finally looks like I can do that, and hopefully it'll be a relatively straightforward fix?

Even before that, though, I ran all the biomodels through 1.2.2, and got successful runs for 345 models, where before I only succeeded on 241. Progress! Thanks again for all your help.

luciansmith commented 3 weeks ago

Here's a new list of successes and failures with PySCeS. 711 now successfully run! pysces_compare.csv

jmrohwer commented 3 weeks ago

Great, thanks for your efforts! :smile: