Questions on Loading SBML and Extracting Simulation Information in PyVCell

14 views
Skip to first unread message

Yuxuan Mao

unread,
Aug 11, 2025, 10:17:14 AMAug 11
to VCell Open Discussion Forum
Hi Jim,

I am currently exploring PyVCell for programmatic model simulation and have a couple of questions:

1. Is there a direct way to load an SBML file into PyVCell without first converting it to VCML using the VCell application? If yes, could you please provide an example of the recommended workflow for doing so?

2. After loading a .vcml file with vc.load_vcml_file(), is there a way to programmatically access simulation details such as the simulation name, duration, number of intervals or time points, and solver/tolerance settings? If so, could you provide the relevant API calls or object attributes for retrieving this information?

Any guidance, code examples, or relevant documentation links would be greatly appreciated. Thank you for your work on making VCell accessible through Python.

Best regards,
Yuxuan 

Schaff,Jim

unread,
Aug 13, 2025, 2:07:30 PMAug 13
to VCell Open Discussion Forum
Hi Yuxuan,

Firstly, thank you for using pyvcell.  please note that pyvcell 0.0.13 is still in early development, and not yet ready for production use.

  1. VCell has its own internal datamodel for models/simulations - and VCML is the serialization of these data structures (encoding VCell BioModels and VCell MathModels).
    pyvcell supports importing SBML models without the VCell Application (but pyvcell does translate SBML into VCML datamodels during the process.

    !pip install -q pyvcell
    import pyvcell.vcml as vc
    biomodel = vc.load_sbml_file("/path/to/sbml")

    Warning, if a particular model fails to import, the error message is not yet very helpful.  These core vcell operations are implemented via VCell Java code -> GraalVM native compilation -> Python ctypes, and we need to improve the end-to-end error reporting.


  2. The only supported local solver in pyvcell is our Fully Implicit  Finite Volume PDE solver (for spatial models only).  We have not yet exposed many of the solver options yet, but we could expose more if that would be helpful. See https://github.com/virtualcell/pyvcell/blob/main/pyvcell/vcml/models.py#L349 for our python dataclass for Simulations.

    class Simulation(VcmlNode):
        name: str
        duration: float
        output_time_step: float
        mesh_size: tuple[int, int, int]

We don't yet have many examples, but we plan to create more of this content.  Maybe if you give me a specific workflow I can work it out.  But just to be clear, pyvcell is currently only supporting spatial models.

Best regards,
Jim.




From: vcell-...@googlegroups.com <vcell-...@googlegroups.com> on behalf of Yuxuan Mao <ym...@uw.edu>
Sent: Monday, August 11, 2025 10:10 AM
To: VCell Open Discussion Forum <vcell-...@googlegroups.com>
Subject: [VCell] Questions on Loading SBML and Extracting Simulation Information in PyVCell
 
*** Attention: This is an external email. ***
Use caution responding, opening attachments or clicking on links.
 
--
You received this message because you are subscribed to the Google Groups "VCell Open Discussion Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vcell-discus...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vcell-discuss/b81de984-7931-4d25-a3af-1836add455c9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages