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

Improvements to profile plots when multiple datasets of a given type present per group #1054

Merged
merged 45 commits into from
Aug 12, 2022

Conversation

@IndrajeetPatil IndrajeetPatil marked this pull request as draft July 29, 2022 10:03
@IndrajeetPatil IndrajeetPatil changed the title Profile plots for multiple datasets per group WIP: Profile plots for multiple datasets per group Jul 29, 2022
@IndrajeetPatil

This comment was marked as outdated.

@PavelBal

This comment was marked as outdated.

@IndrajeetPatil

This comment was marked as resolved.

@PavelBal

This comment was marked as resolved.

@IndrajeetPatil

This comment was marked as resolved.

@IndrajeetPatil

This comment was marked as outdated.

@IndrajeetPatil IndrajeetPatil marked this pull request as ready for review August 4, 2022 14:03
@IndrajeetPatil IndrajeetPatil changed the title WIP: Profile plots for multiple datasets per group Improvements to profile plots when multiple datasets of a given type present per group Aug 4, 2022
@IndrajeetPatil
Copy link
Member Author

Best to review the changes in how plot look will be by checking how snapshots for plots have changed:

https://github.com/Open-Systems-Pharmacology/OSPSuite-R/pull/1054/files

@PavelBal
Copy link
Member

I see that interpolation has been removed completely? I would like to test how it behaves now, but require this feature first #1067

@IndrajeetPatil
Copy link
Member Author

Why is #1067 needed to check that? We haven't had it thus far and have trusted the results from interpolation anyway.

Here are two examples that can be used to check if the observed and simulated data are being paired properly:

Example-1

# load the simulation
sim <- loadTestSimulation("MinimalModel")
simResults <- importResultsFromCSV(
  simulation = sim,
  filePaths = getTestDataFilePath("Stevens_2012_placebo_indiv_results.csv")
)

# import observed data (will return a list of `DataSet` objects)
dataSet <- loadDataSetsFromExcel(
  xlsFilePath = getTestDataFilePath("CompiledDataSetStevens2012.xlsx"),
  importerConfiguration = loadDataImporterConfiguration(getTestDataFilePath("ImporterConfiguration.xml"))
)

# create a new instance and add datasets
myCombDat <- DataCombined$new()
myCombDat$addDataSets(dataSet)
myCombDat$addSimulationResults(
  simResults,
  quantitiesOrPaths = c(
    "Organism|Lumen|Stomach|Metformin|Gastric retention",
    "Organism|Lumen|Stomach|Metformin|Gastric retention distal",
    "Organism|Lumen|Stomach|Metformin|Gastric retention proximal"
  )
)

myCombDat$setGroups(
  names = c(
    "Organism|Lumen|Stomach|Metformin|Gastric retention",
    "Organism|Lumen|Stomach|Metformin|Gastric retention distal",
    "Organism|Lumen|Stomach|Metformin|Gastric retention proximal",
    "Stevens_2012_placebo.Placebo_total",
    "Stevens_2012_placebo.Placebo_distal",
    "Stevens_2012_placebo.Placebo_proximal"
  ),
  groups = c("Solid total", "Solid distal", "Solid proximal", "Solid total", "Solid distal", "Solid proximal")
)

plotObservedVsSimulated(myCombDat)

Example-2

  simFilePath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite")
  sim <- loadSimulation(simFilePath)

  simResults <- runSimulation(sim)

  obsData <- lapply(
    c("ObsDataAciclovir_1.pkml", "ObsDataAciclovir_2.pkml", "ObsDataAciclovir_3.pkml"),
    function(x) loadDataSetFromPKML(system.file("extdata", x, package = "ospsuite"))
  )

  names(obsData) <- lapply(obsData, function(x) x$name)

  outputPath <- "Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)"
  myDataCombined <- DataCombined$new()

  # Add simulated results
  myDataCombined$addSimulationResults(
    simulationResults = simResults,
    quantitiesOrPaths = outputPath,
    groups = "Aciclovir PVB"
  )

  # Add observed data set
  myDataCombined$addDataSets(obsData$`Vergin 1995.Iv`, groups = "Aciclovir PVB")

  plotObservedVsSimulated(myDataCombined)

@IndrajeetPatil
Copy link
Member Author

@PavelBal Builds passing now.

Skipping a few tests on CI that won't pass until Open-Systems-Pharmacology/TLF-Library#367 is resolved. But since the PR has already grown to a monstrous size, there is no reason to postpone this until all issues are resolved.

I will make a new PR once that issue is resolved.

@IndrajeetPatil IndrajeetPatil merged commit b0aeb13 into develop Aug 12, 2022
@IndrajeetPatil IndrajeetPatil deleted the 982_profile_plot_imrovements branch August 12, 2022 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment