Snapshot class for OSP snapshots
Snapshot.Rd
An R6 class that represents an OSP snapshot file. This class provides methods to access different components of the snapshot and visualize its structure.
Active bindings
data
The aggregated data of the snapshot from all components
pksim_version
The human-readable PKSIM version corresponding to the snapshot version
path
The path to the snapshot file relative to the working directory
compounds
List of Compound objects in the snapshot
expression_profiles
List of ExpressionProfile objects in the snapshot
individuals
List of Individual objects in the snapshot
formulations
List of Formulation objects in the snapshot
populations
List of Population objects in the snapshot
events
List of Event objects in the snapshot
protocols
List of Protocol objects in the snapshot
observed_data
List of DataSet objects (observed data) in the snapshot
Methods
Method new()
Create a new Snapshot object from a JSON file or a list
Usage
Snapshot$new(input)
Method print()
Print a summary of the snapshot
Method add_individual()
Add an Individual object to the snapshot
Method remove_individual()
Remove an individual from the snapshot by name
Method add_formulation()
Add a Formulation object to the snapshot
Method remove_formulation()
Remove a formulation from the snapshot by name
Method remove_population()
Remove a population from the snapshot by name
Method add_expression_profile()
Add an ExpressionProfile object to the snapshot
Examples
\dontrun{
# Create a new expression profile
profile_data <- list(
Type = "Enzyme",
Species = "Human",
Molecule = "CYP3A4",
Category = "Healthy",
Parameters = list()
)
profile <- ExpressionProfile$new(profile_data)
# Add the expression profile to a snapshot
snapshot$add_expression_profile(profile)
}
Method remove_expression_profile()
Remove expression profiles from the snapshot by ID
Examples
## ------------------------------------------------
## Method `Snapshot$add_individual`
## ------------------------------------------------
if (FALSE) { # \dontrun{
# Create a new individual
ind <- create_individual(name = "New Patient", age = 35, weight = 70)
# Add the individual to a snapshot
snapshot$add_individual(ind)
} # }
## ------------------------------------------------
## Method `Snapshot$remove_individual`
## ------------------------------------------------
if (FALSE) { # \dontrun{
# Remove an individual from the snapshot
snapshot$remove_individual("Subject_001")
} # }
## ------------------------------------------------
## Method `Snapshot$add_formulation`
## ------------------------------------------------
if (FALSE) { # \dontrun{
# Create a new formulation
form <- create_formulation(name = "Tablet", type = "Weibull")
# Add the formulation to a snapshot
snapshot$add_formulation(form)
} # }
## ------------------------------------------------
## Method `Snapshot$remove_formulation`
## ------------------------------------------------
if (FALSE) { # \dontrun{
# Remove a formulation from the snapshot
snapshot$remove_formulation("Tablet")
} # }
## ------------------------------------------------
## Method `Snapshot$remove_population`
## ------------------------------------------------
if (FALSE) { # \dontrun{
# Remove a population from the snapshot
snapshot$remove_population("pop_1")
} # }
## ------------------------------------------------
## Method `Snapshot$add_expression_profile`
## ------------------------------------------------
if (FALSE) { # \dontrun{
# Create a new expression profile
profile_data <- list(
Type = "Enzyme",
Species = "Human",
Molecule = "CYP3A4",
Category = "Healthy",
Parameters = list()
)
profile <- ExpressionProfile$new(profile_data)
# Add the expression profile to a snapshot
snapshot$add_expression_profile(profile)
} # }
## ------------------------------------------------
## Method `Snapshot$remove_expression_profile`
## ------------------------------------------------
if (FALSE) { # \dontrun{
# Remove an expression profile from the snapshot
snapshot$remove_expression_profile("CYP3A4|Human|Healthy")
} # }