-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fix: Ensure Correct Column (npde_mode_simBlq vs. npde_simBlq) is Used for sim_blq=TRUE in Plotting Functions #381
Open
certara-irebai
wants to merge
3
commits into
ggPMXdevelopment:develop
Choose a base branch
from
certara-irebai:blq-issue
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
skip_if_not(file.exists(test_path("hiv_project.zip"))) | ||
.path <- normalizePath(test_path("hiv_project.zip")) | ||
|
||
withr::with_tempdir({ | ||
|
||
unzip(.path) | ||
|
||
ctr <- suppressWarnings(pmx_mlxtran("hiv_project.mlxtran", endpoint = c(1, 2))) | ||
|
||
|
||
|
||
|
||
test_that("BLQ column class is correct", { | ||
# Check if the sim_blq dataset exists | ||
expect_true("sim_blq_npde_iwres" %in% names(ctr$data), info = "sim_blq dataset is missing in ctr$data.") | ||
|
||
# Check if the npde_simBlq column exists in the dataset | ||
expect_true("npde_simBlq" %in% colnames(ctr$data[["sim_blq"]]), | ||
info = "npde_simBlq column is missing in sim_blq_npde_iwres dataset.") | ||
|
||
# Verify the class of the column | ||
expect_is(ctr$data[["sim_blq"]][["npde_simBlq"]], "numeric", | ||
info = "npde_simBlq column is not of class numeric.") | ||
}) | ||
|
||
|
||
test_that("Variable mapped to y-aesthetic is correct", { | ||
# Generate the plot with sim_blq = TRUE | ||
plot <- pmx_plot_npde_pred(ctr, sim_blq = TRUE) | ||
|
||
# Extract the ggplot mapping | ||
mapping <- ggplot2::ggplot_build(plot)$data[[1]] | ||
|
||
# Check that the y aesthetic is mapped to the correct column | ||
expect_true("y" %in% names(mapping), info = "y aesthetic is missing in the plot mapping.") | ||
expect_equal(mapping$y, ctr$data[["sim_blq"]][["npde_simBlq"]], | ||
info = "y aesthetic is not correctly mapped to npde_simBlq.") | ||
}) | ||
|
||
|
||
test_that("Exact values of npde_simBlq match the residuals file", { | ||
# Load the reference data | ||
residuals_path <- normalizePath("hiv_project/ChartsData/ScatterPlotOfTheResiduals/y1_residuals.txt") # Remplacez par le chemin exact après extraction | ||
residuals_file <- fread(residuals_path) | ||
|
||
expected_values <- residuals_file[["npde_simBlq"]] | ||
|
||
# Check if the npde_simBlq column exists | ||
expect_true("npde_simBlq" %in% colnames(ctr$data[["sim_blq_npde_iwres"]]), | ||
info = "npde_simBlq column is missing in sim_blq dataset.") | ||
|
||
# Compare values | ||
actual_values <- ctr$data[["sim_blq_npde_iwres"]][["npde_simBlq"]] | ||
expect_equal(actual_values, expected_values, | ||
tolerance = 1e-6, info = "npde_simBlq values do not match expected values.") | ||
}) | ||
|
||
|
||
}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the
_mode_simBlq
column exists, is there a_mean_simBlq
or other sort of column. In some cases, the endpoint is also part of the variable name; do we know if that is the case here?