Skip to content

Commit

Permalink
478 lloq legend (#1048)
Browse files Browse the repository at this point in the history
* Fixes #478 indicate lloq in time profiles

* Fixes #478 lloq dotted lines appear on plots

* Enforce missing lloq as numeric class preventing ggplot scale issues

* Update documentation now that lloq is handled differently
  • Loading branch information
pchelle authored Jun 21, 2023
1 parent d19092e commit 8972244
Show file tree
Hide file tree
Showing 15 changed files with 333 additions and 220 deletions.
25 changes: 24 additions & 1 deletion R/error-checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -459,4 +459,27 @@ validateGuestParameters <- function(guestParameters, pkParameters) {
}
)
return(invisible())
}
}

checkLLOQValues <- function(lloq, structureSet){
if(any(is.infinite(lloq))){
warning(
messages$warningHasInfiniteValues(
n = sum(is.infinite(lloq)),
datasetName = structureSet$simulationSet$dataSource$dataFile
),
call. = FALSE
)
lloq[is.infinite(lloq)] <- NA
}
# If no negative value, return lloq
if(isEmpty(which(lloq<=0))){
return(lloq)
}
warning(
messages$negativeDataRemoved(length(which(lloq<=0))),
call. = FALSE
)
lloq[lloq<=0 & !is.na(lloq)] <- NA
return(lloq)
}
2 changes: 1 addition & 1 deletion R/gof-plot-task.R
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ GofPlotTask <- R6::R6Class(
self$saveResults(set, taskResults$results)

# If first simulation set was a reference population,
# its simulated, observed and lloq data are added for the next plots through settings
# its simulated and observed data are added for the next plots through settings
# the option plotReferenceObsData from the simulation set will take care of the actual inclusion within the plots
if (all(isTRUE(set$simulationSet$referencePopulation), isTRUE(self$settings$includeReferenceData))) {
self$settings$referenceData <- taskResults$referenceData
Expand Down
8 changes: 8 additions & 0 deletions R/messages.R
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ messages <- list(
"Qualification TimeProfile is unable to display data for all 3 axes. Only Y and Y2 axes were kept."
},

warningHasInfiniteValues = function(n, datasetName = NULL){
paste0(
"Data ",
ifNotNull(datasetName, paste0("from '", highlight(datasetName), "' "), ""),
"included ", highlight(n), " infinite values"
)
},

pkParameterNotFound = function(pkParameterName, pkRatioMapping){
paste0(
"PK Parameter '", highlight(pkParameterName), "' not found for ",
Expand Down
3 changes: 3 additions & 0 deletions R/qualification-gof.R
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,12 @@ getGOFDataForMapping <- function(outputMapping, configurationPlan, axesUnits) {
)

# Re-use nomenclature and functions from utilities-goodness-of-fit
# TODO: Qualification currently do not handle LLOQ
# Add place holder for lloq, that will be replaced once data include lloq information
observedData <- data.frame(
Time = observedTime,
Concentration = observedValues,
lloq = as.numeric(NA),
Path = observedDataSet
)
simulatedData <- data.frame(
Expand Down
Loading

0 comments on commit 8972244

Please sign in to comment.