ospsuite now installs and loads even when its native libraries or the .NET runtime cannot be initialised (for example on build machines that lack a compatible libxml2 or the .NET runtime), instead of failing at load time. The reason is reported when the package is attached and raised with an actionable message on the first call into the .NET API. Vignette code that requires the runtime is only executed when it is available. Together this allows the package to be built, checked, and resolved as a dependency in environments without a working runtime.
library(ospsuite) no longer changes the global ggplot2 theme and geom defaults: the {ospsuite.plots}-based plotting functions (plotTimeProfile(), plotPredictedVsObserved(), plotResidualsVsCovariate(), plotResidualsAsHistogram(), plotQuantileQuantilePlot()) now style each plot individually, and the styling of unrelated plots in the session is left untouched. As a consequence, the appearance of the deprecated {tlf}-based plotting functions may change slightly, since they no longer inherit the global theme (#1968).
Added isSupportedUnit() and validateIsNamedList() helper functions to the exported API.
Added dataCombinedAciclovir, a pre-built DataCombined object combining simulated and observed aciclovir data, exported for use in examples, vignettes, and tests.
loadDataSetsFromExcel() now treats an empty sheets vector (character(0)) the same as sheets = NULL, falling back to the configuration/all-sheets logic instead of overriding with no sheets.
convertSnapshot() is soft-deprecated in favor of two dedicated functions: loadProjectFromSnapshot() (snapshot .json -> project) and exportProjectToSnapshot() (project -> snapshot .json). convertSnapshot() still works but issues a deprecation warning and will be removed in a future release. Only PK-Sim projects (.pksim5) are supported for now; MoBi support is planned.
plotPredictedVsObserved() and plotResidualsVsCovariate() gain a showLegendPerDataset argument ("none", "observed", "all", default "all") to differentiate observed datasets within a group by point shape, consistent with plotTimeProfile() (#1839).plotResidualsVsCovariate(), plotResidualsAsHistogram(), and plotQuantileQuantilePlot() now compute residuals consistently with calculateResiduals(), producing NaN with a warning for zero or negative values on the log scale instead of extreme values (#1713).plotTimeProfile() now defaults to showLegendPerDataset = "all", showing individual dataset names for both observed and simulated data by default (#1844).DataSet$setValues() and plotting functions (plotTimeProfile(), plotPredictedVsObserved(), plotResidualsVsCovariate(), plotResidualsAsHistogram(), plotQuantileQuantilePlot()) now warn and replace negative yErrorValues with NA instead of silently accepting them (#1756).plotPredictedVsObserved() error bar mapping: when predictedAxis = "x", error bars are now correctly placed on the y-axis (#1715).{ospsuite.plots}: plotTimeProfile(), plotPredictedVsObserved(), plotResidualsVsCovariate(), plotResidualsAsHistogram(), and plotQuantileQuantilePlot(). These functions accept DataCombined objects or data frames and handle mixed error types and unit conversion directly, without requiring data preprocessing (#1652).{tlf}-based plotting functions plotIndividualTimeProfile(), plotPopulationTimeProfile(), plotObservedVsSimulated(), plotResidualsVsTime(), and plotResidualsVsSimulated() are now soft-deprecated in favor of the {ospsuite.plots}-based equivalents and will be removed in version 14.0. (#1739)validateDimension() error message not showing the actual dimension name (#1822).NULL when DataCombined has no plottable entries (#1709).{ospsuite.plots} option key references to match camelCase naming convention (e.g., watermarkEnabled, defaultPercentiles) (#1818).addResidualColumn() to unify residual computation across calculateResiduals() and the residual plot functions. Supports "log", "linear" (or "lin"), and "ratio" scaling. For log scaling, zero or negative values now produce NaN with a warning instead of an epsilon-based approximation (#1713).... arguments via @inheritDotParams, improving IDE autocompletion for plotPredictedVsObserved() and plotResidualsAsHistogram() (#1817).dataSetsFromDataFrame() function that creates a list of DataSet objects from a data.frame with the same structure as returned by dataSetToDataFrame(). This is the inverse operation of dataSetToDataFrame() and allows creating DataSet objects from data frames without requiring an Excel file. (#1495)populationFromDataFrame() function to create a Population object from a data.frame, the reverse of populationToDataFrame(). If no IndividualId column is present, sequential IDs are automatically generated. (#1807)loadDataSetsFromExcel() now accepts a sheets parameter to specify which sheets to load. When sheets = NULL (default), the function uses sheets defined in the importer configuration. If the configuration has no sheets defined, all sheets are loaded. When sheets is a character vector, those specific sheets are loaded, overriding any sheets in the configuration. The importAllSheets parameter is now deprecated and will be removed in version 14 (#1760).toDisplayUnit() now accepts an optional unit parameter to specify the source unit of the values, consistent with toUnit() and toBaseUnit() functions. When not specified, values are assumed to be in base unit (maintaining backward compatibility). (#1762)addOutputs() and setOutputs() now throw an error by default when the provided path is not found. This behavior can be disabled by setting stopIfNotFound = FALSE (#1734).ospUnits$Dimensionless$Unitless and ospUnits$Fraction$Unitless now return an empty string "" instead of the literal string "Unitless" (#1754).valueOrigin property to Quantity class (including Parameter and other derived classes) to access the value origin from the underlying .NET object. This is useful for generating automated reports that track parameter value provenance (#1751).createImporterConfigurationForFile() now automatically sets the sheets attribute when a sheet parameter is provided, eliminating the need to manually set it before using loadDataSetsFromExcel() (#1755).getSteadyState() to correctly apply lowerThreshold for both positive and negative values. The threshold now filters values in the interval [-lowerThreshold, lowerThreshold] instead of only values below the threshold (#1792).runSimulations() now throws an error if any simulation has no output selections defined, instead of silently returning empty results. (#1404)exportResultsToCSV() now validates that the input is a single SimulationResults object and rejects lists of results, preventing downstream .NET interop failures (#1752).%||%. ospsuite::%||% will not work.%||% instead of importing from the ospsuite.utils package.names parameter to dataSetToTibble() function to support custom naming of datasets.
This is particularly useful when multiple datasets have the same original name.
The naming logic has been moved from the private .dataSetToDataFrame() method in DataCombined
to dataSetToTibble() for better code reuse and maintainability. (#1627){ospsuite.utils} package. (#1570){ospsuite} now requires {ospsuite.utils} version >= 1.7.0.SimulationBatchRunValues and SimulationBatchOptions are not exported any more.
They should not be used directly.DataImporterConfiguration now supports getting and setting of the Lower Limit
of Quantification (LLOQ) column name via
a new field lloqColumn. If the column name is not set (value NULL), LLOQ values
will be imported from the measurement column if values are written in the form '< xxx' (e.g., '<0.001').
Otherwise, the values will be imported from the specified column (#722)showLegendPerDataset parameter to plotIndividualTimeProfile() and plotPopulationTimeProfile() to optionally display separate legend entries for each dataset. This is experimental.Printable class from the {ospsuite.utils} package.ospPrint\* functions
introduced in version 1.6.2. of the {ospsuite.utils} package.ParameterRange$printValue() is deprecated. Use getPrintValue() in conjunction with a print method of your choice.Quantity$printQuantity() removed. Quantity$printValue() and Quantity$printQuantityValue() are
deprecated. Use getPrintValue() in conjunction with a print method of your choice.SnapshotParameter$printValue() is deprecated. Use getPrintValue() in conjunction with a print method of your choice.calculateResiduals() for DataCombined now supports full pairwise residual
computation between multiple observed and simulated datasets within a group.name property of a Simulation can now be changed (#1245)calculateResiduals now handles single-point simulated datasets via direct
x-value matching instead of interpolation. Unmatched observed x-values return
NA (#1559).runSimulationsFromSnapshot() to run simulations from .json snapshots files,convertSnapshot() to convert project snapshots between .json and .pksim5 files.getMolWeightFor() to retrieve molecular weight for molecule of Quantity.{rClr} and gains {rSharp}.getBaseUnit() function is now named
quantityOrDimension (was dimension previously). It can now use objects
of class Quantity as inputs, to be consistent with the toBaseUnit()
function.{openxlsx} and {lifecycle} dependencies.getSteadyState() to calculate steady state values for
simulations. This function is of particular use for models of endogenous
substrates, where changing a parameter value (e.g., the production rate)
will change the steady-state values of the substrate. The steady-state is
considered to be the last values of the molecules amounts and state variable
parameters in the simulation with sufficiently long simulation time, i.e.,
where the rates of the processes do not (significantly) change. The
steady-state is NOT analytically calculated or estimated in any other way
than simulating for the given time.exportSteadyStateToXLS() to export steady state values
calculated for one simulation using the getSteadyState() to an Excel file
that can be imported in MoBi.plotIndividualTimeProfile() and plotPopulationTimeProfile().plotPopulationTimeProfile() provides two new aggregations methods:
arithmetic and geometric average and the ability to chose the number of
standard deviations to display around the mean through the nsd argument.calculateResiduals() uses natural logarithm (log()) when
calculating residuals with scaling = "log" as opposed to log10() as it
was done before. This also affects figures created by
plotObservedVsSimulated(), plotResidualsVsSimulated(), and
plotResidualsVsTime(). (#1091, #1087).plotPopulationTimeProfile() has a new aggregation argument that allow
the user to choose between quantiles, arithmetic and geometric aggregations
of y.Simulation lists can be passed to runSimulations() so that the
results are returned as a named list using the same names instead of the
simulation id. If no name is provided, the simulation id is used as before.
(#1383)DataCombined$toDataFrame() has changed.DataCombined$toDataFrame()
shows the data in the order as the data sets were added and not
alphabetically sorted.DataCombined$removeGroupAssignment() does not show a warning if specified name is
not present in the DataCombined.DataCombined$removeGroupAssignment()
does not produce an error if specified names are not unique.DefaultPlotConfiguration fields (#1216)plotObsVsPred() now have foldDistance argument set to NULL by default
(previously 2). The function will not add any fold lines on the plot by
default but display identity line. Set this argument to FALSE to not draw
any lines.DefaultPlotConfiguration has a new setting: displayLLOQ (default TRUE)
to control plotting of LLOQ lines.DefaultPlotConfiguration's xLimits and yLimits arguments are
deprecated and replaced by xAxisLimits and yAxisLimits. Use them to zoom
in the plot while preserving all data points. Use xValuesLimits and
yValuesLimits to filter out data point outside of these range. More
detailed explanations in the
ggplot2 coord_cartesian documentation.addSimulationResults and addDataSets methods of the DataCombined class
now support an optional silent argument which silences the checks for data
set names. If you expect to replace data sets in DataCombined objects
repeatedly, consider switching the parameter from the default FALSE value
to TRUE.simulationResultsToDataFrame() is faster than before (#1317, @Felixmil).DataCombined gets a new method setDataTypes() to change data types
(observed or simulated) for existing data sets. This method is useful when
you want to enforce a certain data type, e.g., for adding artificial data
set as simulated results.setOutputs() to change outputs of SimulationBatch objects.
It combines clearOutputs() and setOutputs() in one function.vignette("efficient-calculations") vignette..setEndSimulationTime() to set the end time of the
simulation. The function will either extend or shorten the simulation time to the specified end time.runSimulation() is now soft deprecated in favor of runSimulations().Adds new visualization functions:
plotObservedVsSimulated() for observed versus simulated data scatter plot.plotResidualsVsTime() for time versus residuals data scatter plot.plotResidualsVsSimulated() for simulated versus residuals data scatter plot.Adds new helper functions to work with DataCombined objects:
convertUnits() to convert datasets in DataCombined to common units.calculateResiduals() to calculate residuals for datasets in DataCombined.The class SimulationBatch gets a new property id.
The output of runSimulationBatches() is now a named list with names being
the ids of SimulationBatch.
calculateResiduals() now uses log(base = 10) for calculation of
residuals in logarithmic scale instead if log(base = exp(1))
calculateResiduals() does also return residuals for entries where
simulated or observed value is 0 in logarithmic scale. These values were
ignored in previous versions. If the observed or simulated value is zero or
negative, it is replaced by an arbitrary small value
getOSPSuiteSetting("LOG_SAFE_EPSILON") (1e-20 by default).
SimulationBatch$addRunValues() will throw an error when any start value is
NaN.SimulatioBatch gets methods getVariableParameters() and
getVariableMolecules() that return list of parameter resp. molecule paths
that are defined variable.Signature for toUnit function has changed. molWeight is now the fifth,
while sourceUnit is the fourth parameter (#837).
DataImporterConfiguration: fields timeUnitFromColumn and
measurementUnitFromColumn are renamed to isTimeUnitFromColumn and
isMeasurementUnitFromColumn
The constructor for DataImporterConfiguration does not accept a path to a
configuration file any more. Use the function
loadDataImporterConfiguration() to create a configuration object from a
file.
The constructor for DataSet objects requires a name argument.
All validate*() helper functions and "%||%" infix operators are no
longer exported. Please have a look at the new utility package, from which
these functions are now exported:
https://www.open-systems-pharmacology.org/OSPSuite.RUtils/.
The pkAnalysesAsDataFrame() function changes column data types for
QuantityPath, Parameter, and Unit from factor to character
(#673).
Adds new DataCombined class that combines observed data (DataSet) and
simulated data (SimulationResults) into a single object. Especially
important is the $toDataFrame() method of this object that returns a data
frame containing combined data from observed and simulated data, which can
be further used for visualizations or other analysis.
Adds new visualization functions:
plotIndividualTimeProfile() and plotPopulationTimeProfile() to create
time-profile plots.
Adds a new class DefaultPlotConfiguration to provide plot configurations
for plotting functions.
Adds simulationResultsToDataFrame() function to convert
SimulationResults objects into a data frame.
All *ToDataFrame() functions also get *ToTibble() variants to extract a
tibble data frame instead of a classical data frame.
Following functions are marked for deprecation and will be removed in future releases:
pkAnalysesAsDataFrame() is now pkAnalysesToDataFrame()populationAsDataFrame() is now populationToDataFrame()Version compatible with the OSPSuite V10.