pyvcell¶
pyvcell is the Python interface for Virtual Cell — enabling spatial modeling, simulation, and analysis of cell biological systems directly from Python.
What you can do¶
- Define models from Antimony, SBML, or VCML, or build them programmatically
- Create geometries — analytic shapes, multi-compartment, or image-based
- Run spatial simulations locally using the VCell finite volume solver
- Analyze results — time-series statistics, spatiotemporal arrays (Zarr/NumPy), 3D mesh data (VTK)
- Visualize — built-in plotting (Matplotlib), 3D rendering (VTK/PyVista), interactive widgets (Trame)
Quick example¶
import pyvcell.vcml as vc
# Load a model and simulate
biomodel = vc.load_vcml_file("model.vcml")
result = vc.simulate(biomodel, "sim1")
# Plot results
result.plotter.plot_concentrations()
result.plotter.plot_slice_3d(time_index=3, channel_id="s1")
Getting started¶
- Installation — Install pyvcell and set up your environment
- Quick Start — Load a model, run a simulation, and plot results
Guides¶
| Guide | Description |
|---|---|
| Building a Model | Define reactions in Antimony, create geometry, simulate |
| Working with SBML | Load and run SBML spatial models |
| Complex Geometries | Multi-compartment and reusable geometries |
| Parameter Exploration | Batch parameter sampling and sensitivity analysis |
| Field Data Workflows | Chain simulations using field data as initial conditions |
| Visualization & Analysis | Plotting, 3D slices, animations, and Trame widgets |
API Reference¶
| Module | Contents |
|---|---|
| Models | Biomodel, Model, Species, Compartment, Reaction, Geometry, Application, Simulation |
| I/O Functions | Load/write VCML, SBML, and Antimony |
| Simulation & Results | simulate(), Result, Plotter, VtkData, Field |
Example notebooks¶
Interactive notebooks are available in the examples/notebooks/ directory:
- Antimony model building — Define a model from Antimony and simulate
- Parameter exploration — Batch runs with random parameter sampling
- Geometry import — Multi-compartment geometry from existing models
- SBML workflow — Load and run SBML spatial models