Summary
There is currently no way to serialize a MoBiModule back to a PKML file. loadModuleFromPKML() exists, but the reverse does not, so a module built or modified in R (e.g. via createMoBiModule() + extendInitialConditionsBB() / addProteinExpressionToParameterValuesBB()) cannot be persisted as a re-importable module.
What's missing
-
R API: the PKML savers are saveInitialConditionsToPKML(), saveParameterValuesToPKML(), saveIndividualToPKML(), saveExpressionProfileToPKML(), saveDataSetToPKML(), and saveSimulation(). There is no saveModuleToPKML(), and the MoBiModule R6 object exposes no save method.
-
.NET ModuleTask: exposes LoadModulesFromFile, CreateModule, AddBuildingBlocksToModule, RemoveBuildingBlockFromModule, the BB getters — but no ExportToPKML. A direct call throws:
System.MissingMethodException: Could not find a suitable instance method ExportToPKML
on type MoBi.R.Services.ModuleTask for method parameters Module, String
-
Core persisters: only SimulationPersister (whole-simulation save) is available; there is no module/PKML persister for a single module.
Proposed
Add saveModuleToPKML(module, filePath) mirroring loadModuleFromPKML(path), backed by an ExportToPKML (or equivalent) method on the .NET ModuleTask, so that:
m <- loadModuleFromPKML(\"in.pkml\")
# ... modify m ...
saveModuleToPKML(m, \"out.pkml\")
identical_module <- loadModuleFromPKML(\"out.pkml\")
Use case
Workflows that programmatically build extension modules (e.g. adding a brain spatial-structure extension to PBPK models) want to persist the generated modules as standalone, re-importable PKML artifacts. Today the only workaround is saving each building block separately (saveInitialConditionsToPKML / saveParameterValuesToPKML), which loses the module wrapper.
Summary
There is currently no way to serialize a
MoBiModuleback to a PKML file.loadModuleFromPKML()exists, but the reverse does not, so a module built or modified in R (e.g. viacreateMoBiModule()+extendInitialConditionsBB()/addProteinExpressionToParameterValuesBB()) cannot be persisted as a re-importable module.What's missing
R API: the PKML savers are
saveInitialConditionsToPKML(),saveParameterValuesToPKML(),saveIndividualToPKML(),saveExpressionProfileToPKML(),saveDataSetToPKML(), andsaveSimulation(). There is nosaveModuleToPKML(), and theMoBiModuleR6 object exposes no save method..NET
ModuleTask: exposesLoadModulesFromFile,CreateModule,AddBuildingBlocksToModule,RemoveBuildingBlockFromModule, the BB getters — but noExportToPKML. A direct call throws:Core persisters: only
SimulationPersister(whole-simulation save) is available; there is no module/PKML persister for a single module.Proposed
Add
saveModuleToPKML(module, filePath)mirroringloadModuleFromPKML(path), backed by anExportToPKML(or equivalent) method on the .NETModuleTask, so that:Use case
Workflows that programmatically build extension modules (e.g. adding a brain spatial-structure extension to PBPK models) want to persist the generated modules as standalone, re-importable PKML artifacts. Today the only workaround is saving each building block separately (
saveInitialConditionsToPKML/saveParameterValuesToPKML), which loses the module wrapper.