Skip to contents

This function reads a CSV file of parameter values and returns a named numeric vector. Only rows matching the specified idInstance are used.

Usage

load_params(model, filename, param_instance, ...)

Arguments

model

An object of class sbmlModel for which the parametrisations should be loaded.

filename

Path to the CSV file containing parameters.

param_instance

The instance ID used to filter parameters. When not specified, it is assumed that the file contains only one parametrisation.

...

Additional arguments passed to read.csv.

Value

A named numeric vector with parameter values.

Details

The input CSV file must contain the following columns:

idModelInstance

A character string identifying the model instance. Used for filtering.

Parameter

The name of the parameter to be loaded. These will become the names of the output vector.

Value

The numeric value associated with each parameter.

Examples

model_file <- system.file("extdata/", "simple_oral.sbml", package = "sbmlpbk")
model <- load_sbml(model_file)
params_file <- system.file("extdata/", "simple_oral_params.csv", package = "sbmlpbk")
params <- load_params(model, params_file, 'simple_PARAM')
head(params)
#> $BW
#> [1] 70
#> 
#> $VRc
#> [1] 0.9003
#> 
#> $VLc
#> [1] 0.0257
#> 
#> $VBc
#> [1] 0.074
#> 
#> $QCC
#> [1] 15
#> 
#> $QRc
#> [1] 0.773
#> 

# Example CSV structure:
# idModelInstance,Parameter,Value
# "model_1",a,0.5
# "model_2",a,1.0
# "model_2",b,2.5