Skip to content

Commit

Permalink
Fixes Open-Systems-Pharmacology#1097 update demography caption
Browse files Browse the repository at this point in the history
New populations such as disease states will be included in later versions
  • Loading branch information
pchelle committed Nov 30, 2023
1 parent b9f01fa commit 524d7a2
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 48 deletions.
10 changes: 4 additions & 6 deletions R/captions.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,10 @@ captions <- list(
referenceSetText,
". ",
dataSource,
getPlotScaleCaption("Profiles", plotScale),
switch(parameterClass,
"character" = paste0(" and ", getBoxplotDescriptor()),
""
),
"."
"character" = paste0("Data is ", getBoxplotDescriptor(), "."),
getPlotScaleCaption("Profiles", plotScale)
)
))
}
),
Expand Down Expand Up @@ -228,7 +226,7 @@ getDataSourceCaption <- function(structureSet) {
return("")
}
dataSourceCaption <- structureSet$simulationSet$dataSource$getCaption(structureSet$workflowFolder)
return(paste0(dataSourceCaption, ". "))
return(dataSourceCaption)
}

getGoodnessOfFitCaptions <- function(structureSet, plotType, plotScale = "linear", settings = NULL) {
Expand Down
84 changes: 42 additions & 42 deletions inst/extdata/obsPop.csv
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
ID,GENDER,POP,WEIGHT,AGE
0,MALE,Adults,52,20
1,MALE,Adults,48,13
2,MALE,Adults,56,14
3,MALE,Children,33,10
4,MALE,Adults,87,37
5,MALE,Adults,52,16
6,MALE,Adults,64,25
7,MALE,Adults,65,21
8,MALE,Adults,66,27
9,MALE,Adults,43,12
10,MALE,Adults,51,14
11,MALE,Adults,60,35
12,MALE,Adults,66,14
13,MALE,Adults,43,12
14,MALE,Children,25,7
15,MALE,Adults,80,40
16,MALE,Adults,66,33
17,FEMALE,Adults,50,20
18,FEMALE,Adults,41,19
19,FEMALE,Adults,58,34
20,FEMALE,Adults,50,16
21,FEMALE,Children,21,8
22,FEMALE,Adults,86,23
23,FEMALE,Adults,76,23
24,FEMALE,Adults,68,27
25,FEMALE,Adults,64,19
26,FEMALE,Adults,40,16
27,FEMALE,Adults,64,19
28,FEMALE,Adults,72,40
29,FEMALE,Adults,65,40
30,FEMALE,Adults,46,19
31,FEMALE,Adults,45,13
32,FEMALE,Adults,64,38
33,FEMALE,Adults,34,12
34,FEMALE,Adults,48,14
35,FEMALE,Adults,64,37
36,FEMALE,Adults,58,38
37,FEMALE,Adults,43,13
38,FEMALE,Adults,63,15
39,FEMALE,Adults,47,15
40,FEMALE,Adults,61,34
41,FEMALE,Adults,52,37
0,MALE,Adults,52,16
1,MALE,Children,48,9
2,MALE,Children,56,10
3,MALE,Children,33,6
4,MALE,Adults,87,33
5,MALE,Children,52,12
6,MALE,Adults,64,21
7,MALE,Adults,65,17
8,MALE,Adults,66,23
9,MALE,Children,43,8
10,MALE,Children,51,10
11,MALE,Adults,60,31
12,MALE,Children,66,10
13,MALE,Children,43,8
14,MALE,Children,25,3
15,MALE,Adults,80,36
16,MALE,Adults,66,29
17,FEMALE,Adults,50,16
18,FEMALE,Adults,41,15
19,FEMALE,Adults,58,30
20,FEMALE,Children,50,12
21,FEMALE,Children,21,4
22,FEMALE,Adults,86,19
23,FEMALE,Adults,76,19
24,FEMALE,Adults,68,23
25,FEMALE,Adults,64,15
26,FEMALE,Children,40,12
27,FEMALE,Adults,64,15
28,FEMALE,Adults,72,36
29,FEMALE,Adults,65,36
30,FEMALE,Adults,46,15
31,FEMALE,Children,45,9
32,FEMALE,Adults,64,34
33,FEMALE,Children,34,8
34,FEMALE,Children,48,10
35,FEMALE,Adults,64,33
36,FEMALE,Adults,58,34
37,FEMALE,Children,43,9
38,FEMALE,Children,63,11
39,FEMALE,Children,47,11
40,FEMALE,Adults,61,30
41,FEMALE,Adults,52,33
43 changes: 43 additions & 0 deletions vignettes/demography.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,49 @@ It is however possible to remove this settings in case the bars do not overlap b
workflow$plotDemography$settings$dodge <- FALSE
```

In the example below, dodging is removed within a parallel comparison workflow:

<details>
<summary> __Code__ </summary>

```{r}
parallelWorkflow <- PopulationWorkflow$new(
workflowType = PopulationWorkflowTypes$parallelComparison,
simulationSets = c(adultSet, childrenSet),
workflowFolder = "Parallel-Histograms",
createWordReport = FALSE
)
inactivateWorkflowTasks(parallelWorkflow)
activateWorkflowTasks(parallelWorkflow, tasks = AllAvailableTasks$plotDemography)
displayedParameters <- list(
Age = "Organism|Age",
Weight = "Organism|Weight",
Gender = "Gender"
)
setYParametersForDemogrpahyPlot(workflow = parallelWorkflow, parameters = displayedParameters)
# Turn off dodging of histogram bars
parallelWorkflow$plotDemography$settings$dodge <- FALSE
parallelWorkflow$runWorkflow()
```

</details>


```{r example parallel report dodge, echo=FALSE, results='asis'}
cat(includeReportFromWorkflow(parallelWorkflow))
```

```{r delete parallel report dodge, include = FALSE, echo=FALSE}
# Remove the workflow folders
unlink(parallelWorkflow$workflowFolder, recursive = TRUE)
```


## Display reference population global range <a id="ref-global-range"></a>

Pediatric workflow range plots compare simulation sets to the **reference** simulation set ([#17](https://github.com/Open-Systems-Pharmacology/OSPSuite.ReportingEngine/issues/17)).
Expand Down

0 comments on commit 524d7a2

Please sign in to comment.