Skip to content

Comments

Add a function to create VPC data#12

Merged
roninsightrx merged 29 commits intomainfrom
vpc
Sep 30, 2025
Merged

Add a function to create VPC data#12
roninsightrx merged 29 commits intomainfrom
vpc

Conversation

@roninsightrx
Copy link
Contributor

@roninsightrx roninsightrx commented Sep 25, 2025

Function to easily run the simulations to create a VPC. (only data generation, actual vpc plotting is still done using e.g. vpc package).

roninsightrx and others added 19 commits September 23, 2025 04:38
Co-authored-by: Michael McCarthy <51542091+mccarthy-m-g@users.noreply.github.com>
Co-authored-by: Michael McCarthy <51542091+mccarthy-m-g@users.noreply.github.com>
Co-authored-by: Michael McCarthy <51542091+mccarthy-m-g@users.noreply.github.com>
Co-authored-by: Michael McCarthy <51542091+mccarthy-m-g@users.noreply.github.com>
Co-authored-by: Michael McCarthy <51542091+mccarthy-m-g@users.noreply.github.com>
Co-authored-by: Michael McCarthy <51542091+mccarthy-m-g@users.noreply.github.com>
Co-authored-by: Michael McCarthy <51542091+mccarthy-m-g@users.noreply.github.com>
Co-authored-by: Michael McCarthy <51542091+mccarthy-m-g@users.noreply.github.com>
Co-authored-by: Michael McCarthy <51542091+mccarthy-m-g@users.noreply.github.com>
Co-authored-by: Michael McCarthy <51542091+mccarthy-m-g@users.noreply.github.com>
@roninsightrx
Copy link
Contributor Author

Implements #11

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds functionality to create VPC (Visual Predictive Check) data by implementing a run_vpc function that generates simulation datasets for pharmacokinetic model validation. The function performs iterative simulations across subjects to produce observation and simulation data suitable for VPC plotting with external packages like vpc.

Key changes:

  • New run_vpc function for generating VPC simulation data
  • Core simulation logic in run_vpc_core for individual subjects
  • Comprehensive test coverage with vancomycin and busulfan model examples

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
R/run_vpc.R Main implementation with run_vpc and run_vpc_core functions
tests/testthat/test-run_vpc.R Test cases validating VPC functionality with different models
man/run_vpc.Rd Documentation for the main run_vpc function
man/run_vpc_core.Rd Documentation for the core simulation function
R/parse_input_data.R Bug fix for ID assignment in parsed data
NAMESPACE Export declaration for new run_vpc function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

roninsightrx and others added 3 commits September 29, 2025 13:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mccarthy-m-g mccarthy-m-g linked an issue Sep 29, 2025 that may be closed by this pull request
Copy link
Collaborator

@mccarthy-m-g mccarthy-m-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

} else {
p <- function() { }
}
p <- if(progress) { progressr::progressor(along = data_parsed) } else { \(x) {} }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

splitting this off as a function didn't work for me

@roninsightrx roninsightrx merged commit 232e8dd into main Sep 30, 2025
2 checks passed
@roninsightrx roninsightrx deleted the vpc branch September 30, 2025 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add function to make VPC for model + dataset

2 participants