-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
benoit
committed
Jul 10, 2023
1 parent
65724ad
commit 6056949
Showing
11 changed files
with
319 additions
and
13 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,7 @@ Collate: | |
'lbt06.R' | ||
'lbt07.R' | ||
'lbt14.R' | ||
'lbt15.R' | ||
'mht01.R' | ||
'mng01.R' | ||
'package.R' | ||
|
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
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
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
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,51 @@ | ||
# lbt15 ---- | ||
|
||
#' @describeIn lbt15 Main TLG function | ||
#' @source `lbt04.R` | ||
#' @export | ||
#' | ||
lbt15_main <- modify_default_args(lbt04_main, abn_range = "ATOXGR", baseline = "BTOXGR") | ||
|
||
#' @describeIn lbt15 Preprocessing | ||
#' | ||
#' @inheritParams gen_args | ||
#' | ||
#' @export | ||
#' | ||
lbt15_pre <- function(adam_db, ...) { | ||
format <- rule( | ||
"LOW" = c("-2", "-3", "-4"), | ||
"MODERATE/NORMAL" = c("-1", "0", "1"), | ||
"HIGH" = c("2", "3", "4") | ||
) | ||
|
||
adam_db$adlb <- adam_db$adlb %>% | ||
filter( | ||
.data$ONTRTFL == "Y", | ||
.data$PARCAT2 == "SI", | ||
!is.na(.data$ATOXGR) | ||
) %>% | ||
mutate( | ||
PARAM = with_label(.data$PARAM, "Laboratory Test"), | ||
ANRIND = with_label(.data$ANRIND, "Direction of Abnormality") | ||
) %>% | ||
mutate( | ||
ATOXGR = reformat(.data$ATOXGR, .env$format), | ||
BTOXGR = reformat(.data$BTOXGR, .env$format) | ||
) | ||
|
||
adam_db | ||
} | ||
|
||
#' `LBT15` Laboratory Test Shifts to NCI-CTCAE Grade 3-4 Post-Baseline Table. | ||
#' | ||
#' @include chevron_tlg-S4class.R | ||
#' @export | ||
#' | ||
#' @examples | ||
#' run(lbt15, syn_data) | ||
lbt15 <- chevron_t( | ||
main = lbt15_main, | ||
preprocess = lbt15_pre, | ||
postprocess = lbt04_post | ||
) |
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 |
---|---|---|
|
@@ -79,6 +79,7 @@ reference: | |
- lbt06 | ||
- lbt07 | ||
- lbt14 | ||
- lbt15 | ||
- mht01 | ||
- mng01 | ||
- pdt01 | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,126 @@ | ||
# lbt15 functions with default argument value return expected result with test data | ||
|
||
Code | ||
cat(export_as_txt(res, lpp = 100)) | ||
Output | ||
Laboratory Test A: Drug X B: Placebo C: Combination | ||
Analysis Toxicity Grade (N=134) (N=134) (N=132) | ||
————————————————————————————————————————————————————————————————————————————————————— | ||
CHEMISTRY | ||
Alanine Aminotransferase Measurement | ||
Low 6/47 (12.8%) 3/53 (5.7%) 3/65 (4.6%) | ||
High 2/47 (4.3%) 3/46 (6.5%) 1/63 (1.6%) | ||
C-Reactive Protein Measurement | ||
Low 5/55 (9.1%) 3/63 (4.8%) 4/53 (7.5%) | ||
High 5/56 (8.9%) 5/58 (8.6%) 1/48 (2.1%) | ||
Immunoglobulin A Measurement | ||
Low 3/46 (6.5%) 7/52 (13.5%) 5/54 (9.3%) | ||
High 3/43 (7.0%) 4/52 (7.7%) 6/55 (10.9%) | ||
COAGULATION | ||
Alanine Aminotransferase Measurement | ||
Low 3/54 (5.6%) 4/58 (6.9%) 5/50 (10.0%) | ||
High 7/55 (12.7%) 7/52 (13.5%) 2/50 (4.0%) | ||
C-Reactive Protein Measurement | ||
Low 5/57 (8.8%) 1/50 (2.0%) 4/52 (7.7%) | ||
High 7/54 (13.0%) 3/46 (6.5%) 2/50 (4.0%) | ||
Immunoglobulin A Measurement | ||
Low 5/54 (9.3%) 8/64 (12.5%) 0/56 | ||
High 5/49 (10.2%) 7/67 (10.4%) 1/56 (1.8%) | ||
HEMATOLOGY | ||
Alanine Aminotransferase Measurement | ||
Low 2/49 (4.1%) 3/48 (6.2%) 5/61 (8.2%) | ||
High 3/48 (6.2%) 6/45 (13.3%) 5/57 (8.8%) | ||
C-Reactive Protein Measurement | ||
Low 4/50 (8.0%) 5/48 (10.4%) 8/59 (13.6%) | ||
High 1/47 (2.1%) 3/46 (6.5%) 5/56 (8.9%) | ||
Immunoglobulin A Measurement | ||
Low 3/59 (5.1%) 6/57 (10.5%) 6/52 (11.5%) | ||
High 4/57 (7.0%) 3/59 (5.1%) 10/53 (18.9%) | ||
|
||
# lbt15 can handle all NA values | ||
|
||
Code | ||
cat(export_as_txt(res, lpp = 100)) | ||
Output | ||
———————————————————————————————————————————————————————————————————————————————————————— | ||
Null Report: No observations met the reporting criteria for inclusion in this output. | ||
|
||
# lbt15 can handle missing levels | ||
|
||
Code | ||
cat(export_as_txt(res, lpp = 100)) | ||
Output | ||
Laboratory Test A: Drug X B: Placebo C: Combination | ||
ATOXGR (N=134) (N=134) (N=132) | ||
———————————————————————————————————————————————————————————————————————————————— | ||
CHEMISTRY | ||
Alanine Aminotransferase Measurement | ||
Low 0/47 0/53 0/65 | ||
High 0/47 0/46 0/63 | ||
C-Reactive Protein Measurement | ||
Low 0/55 0/63 0/53 | ||
High 0/56 0/58 0/48 | ||
Immunoglobulin A Measurement | ||
Low 0/46 0/52 0/54 | ||
High 0/43 0/52 0/55 | ||
COAGULATION | ||
Alanine Aminotransferase Measurement | ||
Low 0/54 0/58 0/50 | ||
High 0/55 0/52 0/50 | ||
C-Reactive Protein Measurement | ||
Low 0/57 0/50 0/52 | ||
High 0/54 0/46 0/50 | ||
Immunoglobulin A Measurement | ||
Low 0/54 0/64 0/56 | ||
High 0/49 0/67 0/56 | ||
HEMATOLOGY | ||
Alanine Aminotransferase Measurement | ||
Low 0/49 0/48 0/61 | ||
High 0/48 0/45 0/57 | ||
C-Reactive Protein Measurement | ||
Low 0/50 0/48 0/59 | ||
High 0/47 0/46 0/56 | ||
Immunoglobulin A Measurement | ||
Low 0/59 0/57 0/52 | ||
High 0/57 0/59 0/53 | ||
|
||
# lbt15 can handle some NA values | ||
|
||
Code | ||
cat(export_as_txt(res, lpp = 100)) | ||
Output | ||
Laboratory Test A: Drug X B: Placebo C: Combination | ||
Analysis Toxicity Grade (N=134) (N=134) (N=132) | ||
————————————————————————————————————————————————————————————————————————————————————— | ||
CHEMISTRY | ||
Alanine Aminotransferase Measurement | ||
Low 6/47 (12.8%) 3/53 (5.7%) 3/65 (4.6%) | ||
High 2/47 (4.3%) 3/46 (6.5%) 1/63 (1.6%) | ||
C-Reactive Protein Measurement | ||
Low 5/55 (9.1%) 3/63 (4.8%) 4/53 (7.5%) | ||
High 5/56 (8.9%) 5/58 (8.6%) 1/48 (2.1%) | ||
Immunoglobulin A Measurement | ||
Low 3/46 (6.5%) 7/52 (13.5%) 5/54 (9.3%) | ||
High 3/43 (7.0%) 4/52 (7.7%) 6/55 (10.9%) | ||
COAGULATION | ||
Alanine Aminotransferase Measurement | ||
Low 3/54 (5.6%) 4/58 (6.9%) 5/50 (10.0%) | ||
High 7/55 (12.7%) 7/52 (13.5%) 2/50 (4.0%) | ||
C-Reactive Protein Measurement | ||
Low 5/57 (8.8%) 1/50 (2.0%) 4/52 (7.7%) | ||
High 7/54 (13.0%) 3/46 (6.5%) 2/50 (4.0%) | ||
Immunoglobulin A Measurement | ||
Low 5/54 (9.3%) 8/64 (12.5%) 0/56 | ||
High 5/49 (10.2%) 7/67 (10.4%) 1/56 (1.8%) | ||
HEMATOLOGY | ||
Alanine Aminotransferase Measurement | ||
Low 2/49 (4.1%) 3/48 (6.2%) 5/61 (8.2%) | ||
High 3/48 (6.2%) 6/45 (13.3%) 5/57 (8.8%) | ||
C-Reactive Protein Measurement | ||
Low 4/50 (8.0%) 5/48 (10.4%) 8/59 (13.6%) | ||
High 1/47 (2.1%) 3/46 (6.5%) 5/56 (8.9%) | ||
Immunoglobulin A Measurement | ||
Low 3/59 (5.1%) 6/57 (10.5%) 6/52 (11.5%) | ||
High 4/57 (7.0%) 3/59 (5.1%) 10/53 (18.9%) | ||
|
Oops, something went wrong.