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

Closes #4 Add vaccines test data #74

Merged
merged 8 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ on:
- "v*"
branches:
- main
- devel
- patch
# 'pull_request' events are triggered when PRs are
# created against one of these target branches.
pull_request:
branches:
- main
- devel
- patch
# 'release' events are triggered when...
# you guessed it - when releases are made.
Expand Down Expand Up @@ -63,6 +61,8 @@ jobs:
check:
name: Check
uses: pharmaverse/admiralci/.github/workflows/r-cmd-check.yml@main
with:
error-on: warning # TODO: find a way to ignore specific notes
if: github.event_name == 'pull_request'
docs:
name: Documentation
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: pharmaversesdtm
Type: Package
Title: Test Data for the Pharmaverse Family of Packages
Version: 0.1.1
Version: 0.1.1.9000
Authors@R: c(
person("Edoardo", "Mancini", email = "[email protected]", role = c("aut", "cre")),
person("Gayatri", "G", role = "aut"),
Expand Down
17 changes: 17 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# pharmaversesdtm (development version)

## New Features

Following Vaccine Specific SDTM datasets have been added. (#4)

- `ce_vaccine`
- `dm_vaccine`
- `ex_vaccine`
- `face_vaccine`
- `is_vaccine`
- `vs_vaccine`
- `suppce_vaccine`
- `suppdm_vaccine`
- `suppex_vaccine`
- `suppface_vaccine`

# pharmaversesdtm 0.1.1

## Documentation
Expand Down
77 changes: 77 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,80 @@
#'
#' @source \url{https://github.com/cdisc-org/sdtm-adam-pilot-project/blob/master/updated-pilot-submission-package/900172/m5/datasets/cdiscpilot01/tabulations/sdtm/sv.xpt?raw=true} # nolint
"sv"

#' Demographics Dataset for Vaccine Studies
#'
#' An example SDTM DM dataset for vaccine studies
#'
#' @source \url{https://github.com/pharmaverse/admiralvaccine/blob/main/data/vx_dm.rda} # nolint
"dm_vaccine"

#' Vital Signs Dataset for Vaccine Studies
#'
#' An example SDTM VS dataset for vaccine studies
#'
#' @source \url{https://github.com/pharmaverse/admiralvaccine/blob/main/data/vx_vs.rda} # nolint
"vs_vaccine"

#' Clinical Events Dataset for Vaccine Studies
#'
#' An example SDTM CE dataset for vaccine studies
#'
#' @source \url{https://github.com/pharmaverse/admiralvaccine/blob/main/data/vx_ce.rda} # nolint
"ce_vaccine"

#' Exposures Dataset for Vaccine Studies
#'
#' An example SDTM EX dataset for vaccine studies
#'
#' @source \url{https://github.com/pharmaverse/admiralvaccine/blob/main/data/vx_ex.rda} # nolint
"ex_vaccine"

#' Immunogenicity Specimen Assessments Dataset for Vaccine Studies
#'
#' An example SDTM IS dataset for vaccine studies
#'
#' @source \url{https://github.com/pharmaverse/admiralvaccine/blob/main/data/vx_is.rda} # nolint
"is_vaccine"

#' Findings About Clinical Events Dataset for Vaccine Studies
#'
#' An example SDTM FACE dataset for vaccine studies
#'
#' @source \url{https://github.com/pharmaverse/admiralvaccine/blob/main/data/vx_face.rda} # nolint
"face_vaccine"

#' Supplemental Qualifiers for Clinical Events Dataset for Vaccine Studies
#'
#' An example SDTM SUPPCE dataset for vaccine studies
#'
#' @source \url{https://github.com/pharmaverse/admiralvaccine/blob/main/data/vx_suppce.rda} # nolint
"suppce_vaccine"

#' Supplemental Qualifiers for Demographics Dataset for Vaccine Studies
#'
#' An example SDTM SUPPDM dataset for vaccine studies
#'
#' @source \url{https://github.com/pharmaverse/admiralvaccine/blob/main/data/vx_suppdm.rda} # nolint
"suppdm_vaccine"

#' Supplemental Qualifiers for Exposures Dataset for Vaccine Studies
#'
#' An example SDTM SUPPEX dataset for vaccine studies
#'
#' @source \url{https://github.com/pharmaverse/admiralvaccine/blob/main/data/vx_suppex.rda} # nolint
"suppex_vaccine"

#' Supplemental Qualifiers for Findings About for Clinical Events Dataset for Vaccine Studies # nolint
#'
#' An example SDTM SUPPFACE dataset for vaccine studies
#'
#' @source \url{https://github.com/pharmaverse/admiralvaccine/blob/main/data/vx_suppface.rda} # nolint
"suppface_vaccine"

#' Supplemental Qualifiers for Immunogenicity Specimen Assessments Dataset for Vaccine Studies # nolint
#'
#' An example SDTM SUPPIS dataset for vaccine studies
#'
#' @source \url{https://github.com/pharmaverse/admiralvaccine/blob/main/data/vx_suppis.rda} # nolint
"suppis_vaccine"
219 changes: 219 additions & 0 deletions data-raw/ce_vaccine.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
# Dataset: ce_vaccine
# Description: CE test SDTM dataset for Vaccine studies


# Load libraries ----

library(tibble)
library(dplyr)
library(tidyr)
library(metatools)

# Create CE

## Create a dummy CE dataset

ce_t <- tribble(
~STUDYID, ~DOMAIN, ~USUBJID, ~CESEQ, ~CETERM, ~CEDECOD, ~CELAT, ~CELOC, ~CEPRESP, ~CEOCCUR,
~CESEV, ~CEREL, ~CEOUT, ~EPOCH, ~CEDTC, ~CESTDTC, ~CEENDTC, ~CEDUR, ~CETPTREF, ~CERFTDTC,
~CEEVINTX, ~CESTAT, ~CEREASND,
"ABC", "CE", "ABC-1001", 1, "CHILLS", "Chills", NA,
NA, "Y", "N", NA, NA, NA, NA,
NA, NA, NA, NA, "VACCINATION 1", "2021-11-03T10:50:00",
"SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1001", 2, "PAIN AT INJECTION SITE", "Injection site pain",
"LEFT", "DELTOID MUSCLE", "Y", "Y", "MODERATE", "RELATED", "RECOVERED/RESOLVED",
"VACCINATION 1", "2021-11-09", "2021-11-04", "2021-11-07", "P4D", "VACCINATION 1",
"2021-11-03T10:50:00", "SINCE VACCINATION", NA,
NA,
"ABC", "CE", "ABC-1001", 3, "REDNESS", "Erythema", "LEFT",
"DELTOID MUSCLE", "Y", "Y", "MODERATE", "RELATED", "RECOVERED/RESOLVED",
"VACCINATION 1", "2021-11-06", "2021-11-04", "2021-11-04", "P1D", "VACCINATION 1",
"2021-11-03T10:50:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1001", 4, "SWELLING", "Swelling",
"LEFT", "DELTOID MUSCLE", "Y", "Y", "MODERATE", "RELATED", "RECOVERED/RESOLVED",
"VACCINATION 1", "2021-11-11", "2021-11-03", "2021-11-09", "P7D", "VACCINATION 1",
"2021-11-03T10:50:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1001", 5, "DIARRHEA", "Diarrhoea", NA,
NA, "Y", "N", NA, NA, NA, NA,
NA, NA, NA, NA, "VACCINATION 1", "2021-11-03T10:50:00",
"SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1001", 6, "FATIGUE", "Fatigue", NA,
NA, "Y", "Y", "MILD", "RELATED", "RECOVERED/RESOLVED", "VACCINATION 1",
"2021-11-06", "2021-11-03", "2021-11-04", "P2D", "VACCINATION 1",
"2021-11-03T10:50:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1001", 7, "FEVER", "Pyrexia", NA,
NA, "Y", "N", NA, NA, NA, NA,
NA, NA, NA, NA, "VACCINATION 1", "2021-11-03T10:50:00",
"SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1001", 8, "HEADACHE", "Headache", NA,
NA, "Y", "N", NA, NA, NA, NA,
NA, NA, NA, NA, "VACCINATION 1", "2021-11-03T10:50:00",
"SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1001", 9, "NEW OR WORSENED JOINT PAIN",
"Arthralgia", NA, NA, "Y", "Y", "MILD", "RELATED",
"RECOVERED/RESOLVED", "VACCINATION 1", "2021-11-06", "2021-11-04", "2021-11-04",
"P1D", "VACCINATION 1", "2021-11-03T10:50:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1001", 10, "NEW OR WORSENED MUSCLE PAIN",
"Myalgia", NA, NA, "Y", "Y", "MILD", "RELATED",
"RECOVERED/RESOLVED", "VACCINATION 1", "2021-11-06", "2021-11-04", "2021-11-04",
"P1D", "VACCINATION 1", "2021-11-03T10:50:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1001", 11, "VOMITING", "Vomiting", NA,
NA, "Y", "N", NA, NA, NA, NA,
NA, NA, NA, NA, "VACCINATION 1", "2021-11-03T10:50:00",
"SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1001", 12, "CHILLS", "Chills", NA, NA,
"Y", NA, NA, NA, NA, NA,
NA, NA, NA, NA, "VACCINATION 2", "2021-12-30T09:10:00",
"SINCE VACCINATION", "NOT DONE", "SUBJECT DID NOT COMPLETE ELECTRONIC DIARY",
"ABC", "CE", "ABC-1001", 13, "PAIN AT INJECTION SITE", "Injection site pain",
"LEFT", "DELTOID MUSCLE", "Y", NA, NA, NA,
NA, NA, NA, NA, NA, NA,
"VACCINATION 2", "2021-12-30T09:10:00", "SINCE VACCINATION", "NOT DONE",
"SUBJECT DID NOT COMPLETE ELECTRONIC DIARY",
"ABC", "CE", "ABC-1001", 14, "REDNESS", "Erythema", "LEFT",
"DELTOID MUSCLE", "Y", NA, NA, NA, NA,
NA, NA, NA, NA, NA, "VACCINATION 2",
"2021-12-30T09:10:00", "SINCE VACCINATION", "NOT DONE",
"SUBJECT DID NOT COMPLETE ELECTRONIC DIARY",
"ABC", "CE", "ABC-1001", 15, "SWELLING", "Swelling", "LEFT",
"DELTOID MUSCLE", "Y", NA, NA, NA, NA,
NA, NA, NA, NA, NA, "VACCINATION 2",
"2021-12-30T09:10:00", "SINCE VACCINATION", "NOT DONE",
"SUBJECT DID NOT COMPLETE ELECTRONIC DIARY",
"ABC", "CE", "ABC-1001", 16, "DIARRHEA", "Diarrhoea", NA,
NA, "Y", NA, NA, NA, NA, NA,
NA, NA, NA, NA, "VACCINATION 2", "2021-12-30T09:10:00",
"SINCE VACCINATION", "NOT DONE", "SUBJECT DID NOT COMPLETE ELECTRONIC DIARY",
"ABC", "CE", "ABC-1001", 17, "FATIGUE", "Fatigue", NA,
NA, "Y", NA, NA, NA, NA, NA,
NA, NA, NA, NA, "VACCINATION 2", "2021-12-30T09:10:00",
"SINCE VACCINATION", "NOT DONE", "SUBJECT DID NOT COMPLETE ELECTRONIC DIARY",
"ABC", "CE", "ABC-1001", 18, "FEVER", "Pyrexia", NA,
NA, "Y", NA, NA, NA, NA, NA,
NA, NA, NA, NA, "VACCINATION 2", "2021-12-30T09:10:00",
"SINCE VACCINATION", "NOT DONE", "SUBJECT DID NOT COMPLETE ELECTRONIC DIARY",
"ABC", "CE", "ABC-1001", 19, "HEADACHE", "Headache", NA, NA, "Y", NA, NA, NA, NA, NA, NA, NA, NA,
NA, "VACCINATION 2", "2021-12-30T09:10:00", "SINCE VACCINATION", "NOT DONE",
"SUBJECT DID NOT COMPLETE ELECTRONIC DIARY",
"ABC", "CE", "ABC-1001", 20, "NEW OR WORSENED JOINT PAIN", "Arthralgia", NA, NA, "Y", NA, NA, NA,
NA, NA, NA, NA, NA, NA, "VACCINATION 2", "2021-12-30T09:10:00", "SINCE VACCINATION", "NOT DONE",
"SUBJECT DID NOT COMPLETE ELECTRONIC DIARY",
"ABC", "CE", "ABC-1001", 21, "NEW OR WORSENED MUSCLE PAIN", "Myalgia", NA, NA, "Y", NA, NA, NA,
NA, NA, NA, NA, NA, NA, "VACCINATION 2", "2021-12-30T09:10:00", "SINCE VACCINATION", "NOT DONE",
"SUBJECT DID NOT COMPLETE ELECTRONIC DIARY",
"ABC", "CE", "ABC-1001", 22, "VOMITING", "Vomiting", NA, NA, "Y", NA, NA, NA, NA, NA, NA, NA, NA,
NA, "VACCINATION 2", "2021-12-30T09:10:00", "SINCE VACCINATION", "NOT DONE",
"SUBJECT DID NOT COMPLETE ELECTRONIC DIARY",
"ABC", "CE", "ABC-1002", 1, "CHILLS", "Chills", NA, NA, "Y", "N", NA, NA, NA, NA, NA, NA, NA, NA,
"VACCINATION 1", "2021-10-07T12:48:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 2, "PAIN AT INJECTION SITE", "Injection site pain", "LEFT",
"DELTOID MUSCLE", "Y", "N", NA, NA, NA, NA, NA, NA, NA, NA, "VACCINATION 1",
"2021-10-07T12:48:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 3, "REDNESS", "Erythema", "LEFT", "DELTOID MUSCLE",
"Y", "Y", "MILD", "RELATED", "RECOVERED/RESOLVED", "VACCINATION 1", "2021-10-11", "2021-10-09",
"2021-10-09", "P1D", "VACCINATION 1", "2021-10-07T12:48:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 4, "SWELLING", "Swelling", "LEFT", "DELTOID MUSCLE", "Y", "N", NA,
NA, NA, NA, NA, NA, NA, NA, "VACCINATION 1", "2021-10-07T12:48:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 5, "DIARRHEA", "Diarrhoea", NA, NA, "Y", "N", NA, NA, NA, NA, NA, NA, NA,
NA, "VACCINATION 1", "2021-10-07T12:48:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 6, "FATIGUE", "Fatigue", NA, NA, "Y", "N", NA, NA, NA, NA, NA, NA, NA,
NA, "VACCINATION 1", "2021-10-07T12:48:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 7, "FEVER", "Pyrexia", NA, NA, "Y", "N", NA, NA, NA, NA, NA, NA, NA, NA,
"VACCINATION 1", "2021-10-07T12:48:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 8, "HEADACHE", "Headache", NA, NA, "Y", "Y", "MODERATE", "RELATED",
"RECOVERED/RESOLVED", "VACCINATION 1", "2021-10-13", "2021-10-11", "2021-10-11", "P1D",
"VACCINATION 1", "2021-10-07T12:48:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 9, "NEW OR WORSENED JOINT PAIN", "Arthralgia", NA, NA, "Y", "N", NA, NA,
NA, NA, NA, NA, NA, NA, "VACCINATION 1", "2021-10-07T12:48:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 10, "NEW OR WORSENED MUSCLE PAIN", "Myalgia", NA, NA, "Y", "N", NA, NA,
NA, NA, NA, NA, NA, NA, "VACCINATION 1", "2021-10-07T12:48:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 11, "VOMITING", "Vomiting", NA, NA, "Y", "N", NA, NA, NA, NA, NA, NA, NA,
NA, "VACCINATION 1", "2021-10-07T12:48:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 12, "CHILLS", "Chills", NA, NA, "Y", "N", NA, NA, NA, NA, NA, NA, NA, NA,
"VACCINATION 2", "2021-12-16T12:41:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 13, "PAIN AT INJECTION SITE", "Injection site pain", "LEFT",
"DELTOID MUSCLE", "Y", "Y", "MILD", "RELATED", "RECOVERED/RESOLVED", "VACCINATION 2",
"2021-12-21", "2021-12-16", "2021-12-19", "P4D", "VACCINATION 2", "2021-12-16T12:41:00",
"SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 14, "REDNESS", "Erythema", "LEFT", "DELTOID MUSCLE", "Y", "Y", "MILD",
"RELATED", "RECOVERED/RESOLVED", "VACCINATION 2", "2021-12-23", "2021-12-17", "2021-12-21", "P5D",
"VACCINATION 2", "2021-12-16T12:41:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 15, "SWELLING", "Swelling", "LEFT", "DELTOID MUSCLE", "Y", "Y", "MILD",
"RELATED", "RECOVERED/RESOLVED", "VACCINATION 2", "2021-12-21", "2021-12-17", "2021-12-19", "P3D",
"VACCINATION 2", "2021-12-16T12:41:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 16L, "DIARRHEA", "Diarrhoea", NA, NA, "Y", "N", NA, NA, NA, NA, NA, NA,
NA, NA, "VACCINATION 2", "2021-12-16T12:41:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 17L, "FATIGUE", "Fatigue", NA, NA, "Y", "N", NA, NA, NA, NA, NA, NA, NA,
NA, "VACCINATION 2", "2021-12-16T12:41:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 18L, "FEVER", "Pyrexia", NA, NA, "Y", "N", NA, NA, NA, NA, NA, NA, NA,
NA, "VACCINATION 2", "2021-12-16T12:41:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 19L, "HEADACHE", "Headache", NA, NA, "Y", "Y", "MILD", "RELATED",
"RECOVERED/RESOLVED", "VACCINATION 2", "2021-12-23", "2021-12-21", "2021-12-21", "P1D",
"VACCINATION 2", "2021-12-16T12:41:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 20L, "NEW OR WORSENED JOINT PAIN", "Arthralgia", NA, NA, "Y", "N", NA,
NA, NA, NA, NA, NA, NA, NA, "VACCINATION 2", "2021-12-16T12:41:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 21L, "NEW OR WORSENED MUSCLE PAIN", "Myalgia", NA, NA, "Y", "N", NA, NA,
NA, NA, NA, NA, NA, NA, "VACCINATION 2", "2021-12-16T12:41:00", "SINCE VACCINATION", NA, NA,
"ABC", "CE", "ABC-1002", 22L, "VOMITING", "Vomiting", NA, NA, "Y", "N", NA, NA, NA, NA, NA, NA,
NA, NA, "VACCINATION 2", "2021-12-16T12:41:00", "SINCE VACCINATION", NA, NA
)

## Create final CE dataset ----

vx_ce <- ce_t %>%
mutate(
CELNKGRP = paste(CETPTREF, "-", CETERM),
CECAT = "REACTOGENICITY",
CESCAT = ifelse(is.na(CELAT), "SYSTEMIC", "ADMINISTRATION SITE"),
CETPT = "DAY 7",
CETPTNUM = 7
) %>%
unite(
CELNKID, CETPTREF, CELOC, CELAT, CETERM,
sep = "-", na.rm = TRUE, remove = FALSE
) %>%
select(
STUDYID, DOMAIN, USUBJID, CESEQ, CELNKID, CELNKGRP, CETERM,
CEDECOD, CELAT, CELOC, CECAT, CESCAT, CEPRESP, CEOCCUR, CESEV, CEREL,
CEOUT, EPOCH, CEDTC, CESTDTC, CEENDTC, CEDUR, CETPT, CETPTNUM, CETPTREF,
CERFTDTC, CEEVINTX, CESTAT, CEREASND
)

ce_vaccine <- vx_ce %>% add_labels(
STUDYID = "Study Identifier",
DOMAIN = "Domain Abbreviation",
USUBJID = "Unique Subject Identifier",
CESEQ = "Sequence Number",
CELNKID = "Link ID",
CELNKGRP = "Link Group ID",
CETERM = "Reported Term for the Clinical Event",
CEDECOD = "Dictionary-Derived Term",
CELAT = "Laterality of Location of Clinical Event",
CELOC = "Location of Clinical Event",
CECAT = "Category for Clinical Event",
CESCAT = "Subcategory for Clinical Event",
CEPRESP = "Clinical Event Pre-Specified",
CEOCCUR = "Clinical Event Occurrence",
CESEV = "Severity/Intensity",
CEREL = "Causality",
CEOUT = "Outcome of Clinical Event",
EPOCH = "Epoch",
CEDTC = "Date/Time of Event Collection",
CESTDTC = "Start Date/Time of Clinical Event",
CEENDTC = "End Date/Time of Clinical Event",
CEDUR = "Duration of Clinical Event",
CETPT = "Planned Time Point Name",
CETPTNUM = "Planned Time Point Number",
CETPTREF = "Time Point Reference",
CERFTDTC = "Date/Time of Reference Time Point",
CEEVINTX = "Evaluation Interval Text",
CESTAT = "Completion Status",
CEREASND = "Reason Clinical Event Not Collected"
)

# Label CE dataset ----
attr(ce_vaccine, "label") <- "Clinical Events"

# Save dataset ----
usethis::use_data(ce_vaccine, overwrite = TRUE)
Loading
Loading