Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plotIndividualTimeProfile multiple simulation results within one group are connected #982

Closed
PavelBal opened this issue May 24, 2022 · 6 comments · Fixed by #1054
Closed
Labels
type: bug Something isn't working

Comments

@PavelBal
Copy link
Member

plotIndividualTimeProfile

Panels d and e - there are multiple simulated curves in one group - the last point of one curve is connected with the first point of the next curve.

@IndrajeetPatil
Copy link
Member

Is there an image missing here?

@PavelBal
Copy link
Member Author

@IndrajeetPatil
Copy link
Member

Note to self: Check aggregated data to see if spurious points are being introduced (h/t @pchelle).

@PavelBal
Copy link
Member Author

Minimal example after loading simulation results (using script.R):

scenarioName <- "RIF_20mg_qd_14d"

currentDataCombined <- DataCombined$new()
currentDataCombined$addSimulationResults(simulatedScenarios[[scenarioName]]$results,
                                         quantitiesOrPaths = OutputPaths$Rifampicin_muc_duo_cell_unbound,
                                         groups = "Perpetrator intestine unbound"
)
currentDataCombined$addSimulationResults(simulatedScenarios[[scenarioName]]$results,
                                         quantitiesOrPaths = OutputPaths$Rifampicin_muc_lil_cell_unbound,
                                         groups = "Perpetrator intestine unbound"
)

plotIndividualTimeProfile(currentDataCombined)

image

@IndrajeetPatil
Copy link
Member

IndrajeetPatil commented Jul 19, 2022

Minimally reproducible example:

library(tlf)

df <- dplyr::tibble(
  xValues = c(0, 1, 2, 3, 4, 0, 1, 2, 3, 4),
  yValues = c(
    0,
    0.00788349099457264, 0.0343151688575745, 0.0759411081671715,
    0.130162701010704, 0, 5.10453501689767e-09, 4.76278302130595e-07,
    6.20401988271624e-06, 3.64091392839327e-05
  ), 
  group = "myGroup", 
  name = c(rep("data1", 5),  rep("data2", 5))
)

df
#> # A tibble: 10 x 4
#>    xValues       yValues group   name 
#>      <dbl>         <dbl> <chr>   <chr>
#>  1       0 0             myGroup data1
#>  2       1 0.00788       myGroup data1
#>  3       2 0.0343        myGroup data1
#>  4       3 0.0759        myGroup data1
#>  5       4 0.130         myGroup data1
#>  6       0 0             myGroup data2
#>  7       1 0.00000000510 myGroup data2
#>  8       2 0.000000476   myGroup data2
#>  9       3 0.00000620    myGroup data2
#> 10       4 0.0000364     myGroup data2

tlf::plotTimeProfile(
  data = as.data.frame(df),
  dataMapping = tlf::TimeProfileDataMapping$new(
    x = "xValues",
    y = "yValues",
    group = "group"
  ),
  plotConfiguration = TimeProfilePlotConfiguration$new()
)

Created on 2022-07-19 by the reprex package (v2.0.1.9000)

@IndrajeetPatil
Copy link
Member

This is actually similar to #980.

In a given group, since all datasets share the same aesthetic properties, they are linked together. This needs to be resolved in tlf itself (Open-Systems-Pharmacology/TLF-Library#340).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
2 participants