Skip to content

Conversation

@pratikunterwegs
Copy link
Contributor

@pratikunterwegs pratikunterwegs commented Jan 20, 2026

This PR separates the data preparation for plotting into intermediate functions prefixed prep_plot_*().

Known issues:
- Two functions in burden_diagnostics.R are yet to be worked on; now removed.

  • Some plotting preparation and plotting functions need better tests.

@github-actions
Copy link

This pull request:

  • Adds 1 new dependencies (direct and indirect)
  • Adds 1 new system dependencies
  • Removes 0 existing dependencies (direct and indirect)
  • Removes 0 existing system dependencies

Reach out on slack (#code-review or #help channels) to double check if there are base R alternatives to the new dependencies.

(Note that results may be inaccurate if you branched from an outdated version of the target branch.)

@github-actions
Copy link

This pull request:

  • Adds 1 new dependencies (direct and indirect)
  • Adds 1 new system dependencies
  • Removes 2 existing dependencies (direct and indirect)
  • Removes 1 existing system dependencies

Reach out on slack (#code-review or #help channels) to double check if there are base R alternatives to the new dependencies.

(Note that results may be inaccurate if you branched from an outdated version of the target branch.)

@github-actions
Copy link

This pull request:

  • Adds 1 new dependencies (direct and indirect)
  • Adds 1 new system dependencies
  • Removes 2 existing dependencies (direct and indirect)
  • Removes 1 existing system dependencies

Reach out on slack (#code-review or #help channels) to double check if there are base R alternatives to the new dependencies.

(Note that results may be inaccurate if you branched from an outdated version of the target branch.)

1 similar comment
@github-actions
Copy link

This pull request:

  • Adds 1 new dependencies (direct and indirect)
  • Adds 1 new system dependencies
  • Removes 2 existing dependencies (direct and indirect)
  • Removes 1 existing system dependencies

Reach out on slack (#code-review or #help channels) to double check if there are base R alternatives to the new dependencies.

(Note that results may be inaccurate if you branched from an outdated version of the target branch.)

)

#' @name constants
burden_outcome_names <- c(

Choose a reason for hiding this comment

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

we also have deaths_cwyx, cases_cwyx, dalys_cwyx, yll_cwyx, rubella_deaths_congenital and rubella_cases_congenital.

@github-actions
Copy link

This pull request:

  • Adds 1 new dependencies (direct and indirect)
  • Adds 1 new system dependencies
  • Removes 2 existing dependencies (direct and indirect)
  • Removes 1 existing system dependencies

Reach out on slack (#code-review or #help channels) to double check if there are base R alternatives to the new dependencies.

(Note that results may be inaccurate if you branched from an outdated version of the target branch.)

@github-actions
Copy link

This pull request:

  • Adds 1 new dependencies (direct and indirect)
  • Adds 1 new system dependencies
  • Removes 2 existing dependencies (direct and indirect)
  • Removes 1 existing system dependencies

Reach out on slack (#code-review or #help channels) to double check if there are base R alternatives to the new dependencies.

(Note that results may be inaccurate if you branched from an outdated version of the target branch.)

@pratikunterwegs pratikunterwegs self-assigned this Jan 30, 2026
Copy link

@xiangli313 xiangli313 left a comment

Choose a reason for hiding this comment

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

I think this is looking good. I am approving it; and will be using it once merged (will feedback).

#' @param year_min Minimum year.
#'
#' @export
prep_plot_fvp <- function(fvp, year_min, year_max) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xiangli313 - I had a question regarding this function that prepares the FVP data for plotting. This function is used to generate the data for the FVPs-over-time plot (usually Fig. 2 in burden diagnostics reports). Where can I find an example of the FVPs dataset that is used to make the FVPs plot? The related plotting function is plot_fvp().

Choose a reason for hiding this comment

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

FVP data is derived from both coverage and wpp data. It is calculated given specific version of coverage and wpp. If you just need example dataset, please find fvps.rds from here https://montagu.vaccineimpact.org/packit/rapid-model-run-burden/20251218-112844-86af9b70/downloads

Copy link

@kgaythorpe kgaythorpe left a comment

Choose a reason for hiding this comment

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

fantastic, thanks Pratik, happy to approve from my side

#' @param coverage WIP. Coverage data.
#'
#' @export
prep_plot_coverage_set <- function(coverage) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xiangli313 - similar question/request for some example coverage set data so that this function can be tested. This function prepares data that is used to generate the coverage set data (usually Fig. 1 in diagnostics reports). The related plotting function is plot_coverage_set().

Choose a reason for hiding this comment

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

@github-actions
Copy link

This pull request:

  • Adds 1 new dependencies (direct and indirect)
  • Adds 1 new system dependencies
  • Removes 2 existing dependencies (direct and indirect)
  • Removes 1 existing system dependencies

Reach out on slack (#code-review or #help channels) to double check if there are base R alternatives to the new dependencies.

(Note that results may be inaccurate if you branched from an outdated version of the target branch.)

@pratikunterwegs pratikunterwegs marked this pull request as ready for review January 30, 2026 12:29
Copy link

@zegibney zegibney left a comment

Choose a reason for hiding this comment

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

Looks really good Pratik and very easy to follow, grateful for it all being in one place! A few minor comments.

Copy link

Choose a reason for hiding this comment

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

Minor typo in the file name, only figured it out when I was questioning my ability to spell diagnostics!

checkmate::assert_data_frame(burden_set)
checkmate::assert_data_frame(wpp)

gender <- rlang::arg_match(gender)

cols_to_select <- c("country", "year", "age", "cohort_size")
cols_to_select <- c("country", "year", "age", "cohort_size", "scenario")
Copy link

Choose a reason for hiding this comment

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

Could wait until the end to standardise across files but can we make this scenario_type to match existing conventions? @xiangli313 what do you think? I see in constants.R there is the file dict.

Choose a reason for hiding this comment

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

Totally agree. We used to have scenario/scenario_type as enum tables in montagu. For the future, we can create a similar constant table for vimcheck.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to check - should I change scenario to scenario_type throughout?

Choose a reason for hiding this comment

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

Actually, rethink about, let's keep scenario. Usually, for per scenario_type, there could be a few incremental scenarios. And scenario naming convention usually have scenario_type as an suffix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure - I'll keep it as it is.

@@ -21,3 +21,28 @@ scenario_data_colnames <- c(
"scenario",
Copy link

Choose a reason for hiding this comment

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

See comment about scenario/scenario_type.

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

This pull request:

  • Adds 1 new dependencies (direct and indirect)
  • Adds 1 new system dependencies
  • Removes 2 existing dependencies (direct and indirect)
  • Removes 1 existing system dependencies

Reach out on slack (#code-review or #help channels) to double check if there are base R alternatives to the new dependencies.

(Note that results may be inaccurate if you branched from an outdated version of the target branch.)

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

This pull request:

  • Adds 1 new dependencies (direct and indirect)
  • Adds 1 new system dependencies
  • Removes 2 existing dependencies (direct and indirect)
  • Removes 1 existing system dependencies

Reach out on slack (#code-review or #help channels) to double check if there are base R alternatives to the new dependencies.

(Note that results may be inaccurate if you branched from an outdated version of the target branch.)

@pratikunterwegs
Copy link
Contributor Author

I'm going to try and get the failing MacOS check to pass - seems like a question of waiting until the runner recovers - and then merge.

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.

5 participants