Skip to contents

Retrieve a single molecule by path in the given container

Usage

getMolecule(path, container, stopIfNotFound = TRUE)

Arguments

path

A string representing the path relative to the container

container

A Container or Simulation used to find the molecules

stopIfNotFound

Boolean. If TRUE (default) and no molecule exist for the given path, an error is thrown. If FALSE, NULL is returned.

Value

The Molecule with the given path. If the molecule for the path does not exist, an error is thrown if stopIfNotFound is TRUE (default), otherwise NULL

See also

loadSimulation(), getContainer() and getAllContainersMatching() to retrieve objects of type Container or Simulation

Examples


simPath <- system.file("extdata", "simple.pkml", package = "ospsuite")
sim <- loadSimulation(simPath)
molecule <- getMolecule("Organism|Liver|A", sim)