Repository navigation
Hybrid models through SBML Spatial, and vcml_convert_units - #26
Merged
Merged
Conversation
- Bump the vcell submodule to virtualcell/vcell#2175: SBML Spatial export and import of spatial stochastic (PDE/particle hybrid) applications, with each species' representation (continuous or particle) in a vcell annotation. - New entry point vcml_convert_units(vcml_content, unit_system, vcml_file_path): rewrites a VCML BioModel in VCell's units ("vcell": um, uM, s) or VCell's SBML units ("sbml": dm, umol, l, s), converting every quantity, geometry included (ModelUnitConverter). VCell imports SBML in the SBML's own units; this converts it. - Tests: a hybrid vcml_to_sbml -> sbml_to_vcml round trip, and unit conversion both ways (Java and Python). - The not-well-formed SBML test now expects SBMLImportException ("Unable to read SBML stream"): the newer vcell-core reads the stream itself, so the ClassCastException from inside JSBML no longer surfaces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. VCell submodule bump: PDE/particle hybrids through SBML Spatial. The submodule now points at virtualcell/vcell#2175.
vcml_to_sbmlwrites spatial stochastic (Smoldyn / PDE-particle hybrid) applications. Each species carries its representation as<vcell:SpeciesContextSpecSettings vcell:representation="continuous|particle"/>; absent means continuous.sbml_to_vcmlreads that representation back as a hybrid application.2. New
vcml_convert_units(vcml_content, unit_system, vcml_file_path). It rewrites a VCML BioModel in another model unit system, converting every quantity, geometry included, with VCell's ownModelUnitConverter."vcell"means µm, µM and s: VCell's default units, and what its spatial and stochastic math assumes."sbml"means the units VCell writes SBML in: dm, µmol, l and s.convert_units(in a companion pyvcell PR) wraps this.vcmlConvertUnits, plus its ctypes binding and Python API.Tests
test_hybrid_vcml_to_sbml_to_vcml: a hybrid with A as particles and B forced continuous goes VCML → SBML → VCML. The annotations come out, and so doStochastic="true"and theForceContinuousflags.test_vcml_convert_units: TinySpatial (dm) → VCell units → SBML units, plus rejection of an unknown unit system.test_vcml_convert_units, the same conversion through the native library.testSbmlToFiniteVolumeInput_not_well_formednow expectsSBMLImportException("Unable to read SBML stream"). The newer vcell-core reads the SBML stream itself, so JSBML'sClassCastExceptionno longer surfaces, which is the improvement the test's TODO asked for.tests/test_libvcell.py(20) against the native library fromscripts/local_build_native.sh.Context: Phase 6 of viva-pde-particle, describing hybrid models in SBML Spatial. With this build, a hybrid run on the native VCell solver from its SBML (SBML → VCell import → vcell-fvsolver) is bit-identical to the run from the original VCML with the same seed.
🤖 Generated with Claude Code