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

Add ADAL01 #116

Merged
merged 26 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1f34733
Add ADAL01 - missing 4 columns
edelarua Sep 8, 2023
b573710
Update tlg-c index
edelarua Sep 8, 2023
7500ccf
Revert index changes for now to avoid cluttering this PR
edelarua Sep 8, 2023
3d5a5d9
Remove unnecessary columns
edelarua Sep 8, 2023
195d4ad
Merge branch 'main' into 37_adal01@main
edelarua Sep 8, 2023
dd18638
Merge branch 'main' into 37_adal01@main
Melkiades Sep 19, 2023
8f9b155
Merge branch 'main' into 37_adal01@main
edelarua Sep 20, 2023
f75239a
Merge branch 'main' into 37_adal01@main
edelarua Sep 20, 2023
1f047fe
Comment out broken columns
edelarua Sep 20, 2023
1b12da8
Convert 0 AVAL_pk values to NA
edelarua Sep 20, 2023
0ba5d01
Merge 1b12da89622ea55ff8b8478aca269265f3a807fd into 41f1d79448d1ba76e…
edelarua Sep 20, 2023
96ffa5d
[skip actions] Restyle files
github-actions[bot] Sep 20, 2023
f60e542
Empty commit
edelarua Sep 20, 2023
b93be66
Merge branch 'main' into 37_adal01@main
shajoezhu Jan 9, 2024
1325ae3
Update adal01
Sep 28, 2024
d00ea5d
Merge branch 'main' into 37_adal01@main
shajoezhu Sep 28, 2024
aedbeef
Remove comment out
Sep 28, 2024
151d846
Update book/listings/pharmacokinetic/adal01.qmd
shajoezhu Sep 28, 2024
7ae83c4
[skip style] [skip vbump] Restyle files
github-actions[bot] Sep 28, 2024
70c5077
Update snapshot
edelarua Sep 30, 2024
34a1304
Update snap
edelarua Sep 30, 2024
46302eb
Empty-Commit
shajoezhu Oct 10, 2024
29ac7fe
Update book/listings/pharmacokinetic/adal01.qmd
shajoezhu Oct 10, 2024
abcb9bf
Update book/listings/pharmacokinetic/adal01.qmd
shajoezhu Oct 10, 2024
9dc6188
Update rbmit01.qmd
shajoezhu Oct 10, 2024
c34f282
Merge branch 'main' into 37_adal01@main
shajoezhu Oct 10, 2024
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
120 changes: 120 additions & 0 deletions book/listings/pharmacokinetic/adal01.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
title: ADAL01
subtitle: Listing of Anti-Drug Antibody Data for Patients with At Least One ADA Sample Datum by Treatment
---

------------------------------------------------------------------------

{{< include ../../test-utils/envir_hook.qmd >}}
shajoezhu marked this conversation as resolved.
Show resolved Hide resolved

::: panel-tabset
## Data Setup

```{r setup, message=FALSE}
#| code-fold: show

library(dplyr)
library(rlistings)
library(scda)

adpc <- synthetic_cdisc_dataset("latest", "adpc")
adab <- synthetic_cdisc_dataset("latest", "adab")
shajoezhu marked this conversation as resolved.
Show resolved Hide resolved

trt <- "A: Drug X"
min_titer_ada <- 1.10
min_titer_nab <- 0
min_conc <- 0

adpc_f <- adpc %>% filter(PARAM == "Plasma Drug X")

if (unique(adab$RELTMU) == "day") adab$NFRLT <- adab$NFRLT * 24

drug_a <- unique(adab$PARCAT1)[1]
drugcd <- unique(adab$PARAMCD[adab$PARAM == "Antibody titer units"])[1]
conc_u <- unique(adab$AVALU[adab$PARAM == "Antibody titer units"])[1]

adpc_f <- adpc_f %>% select(USUBJID, NFRLT, AVAL)
adab_f <- adab %>%
filter(ARM == trt) %>%
select(-PARAMCD, -PARCAT1, -AVALC, -AVALU) %>%
left_join(
adpc_f,
by = c("USUBJID", "NFRLT"),
suffix = c("_ab", "_pk")
) %>%
filter(!is.na(AVAL_ab))

adab_f <- adab_f %>%
tidyr::pivot_wider(
names_from = PARAM,
values_from = AVAL_ab
) %>%
rename(
RES_ADA = `ADA interpreted per sample result`,
TU_ADA = `Antibody titer units`,
RES_NAB = `NAB interpreted per sample result`,
TU_NAB = `Neutralizing Antibody titer units`
)

out <- adab_f %>%
mutate_at(
c("NFRLT", "TU_ADA", "TU_NAB", "AVAL_pk"),
~ ifelse(is.na(.), replace(., is.na(.), "N/A"), format(round(., 2), nsmall = 2))
) %>%
mutate(NFRLT = as.numeric(NFRLT)) %>%
mutate(
RES_ADA = ifelse(RES_ADA == 1, "Positive", "Negative"),
RES_NAB = ifelse(RES_NAB == 1, "Positive", "Negative"),
TU_ADA = ifelse(TU_ADA <= min_titer_ada, "BLQ", TU_ADA),
TU_NAB = ifelse(TU_NAB <= min_titer_nab, "BLQ", TU_NAB),
AVAL_pk = ifelse(AVAL_pk <= min_conc, "BLQ", AVAL_pk)
) %>%
select(
USUBJID, VISIT, ISTPT, NFRLT, RES_ADA, TU_ADA, RES_NAB, TU_NAB,
AVAL_pk
)

var_labels(out) <- names(out)

out <- out %>%
var_relabel(
USUBJID = "Subject ID",
VISIT = "Visit",
ISTPT = "Timepoint",
NFRLT = "Nominal\nTime\n(hr)",
RES_ADA = "Sample\nADA\nResult",
TU_ADA = "ADA\nTiter\nUnits\n(1)",
RES_NAB = "Sample\nNeutralizing\nAntibody\n(NAb) Result",
TU_NAB = "NAb\nTiter\nUnits\n(2)",
AVAL_pk = paste0("Drug\nConcentration\n(", conc_u, ") (3)")
) %>%
edelarua marked this conversation as resolved.
Show resolved Hide resolved
arrange(USUBJID, VISIT, desc(ISTPT), NFRLT)
```

## Standard Listing

```{r lsting, test = list(lsting = "lsting")}
lsting <- as_listing(
out,
key_cols = c("USUBJID", "VISIT"),
disp_cols = names(out),
main_title = paste0(
"Listing of Anti-", drugcd, " Antibody Data for Patients with At Least One ADA Sample Datum by Treatment, ",
"PK Population\nProtocol: ", drug_a
),
subtitles = paste("\nTreatment Group:", trt),
main_footer = "(1) Minimum reportable titer = 1.10 (example only)
(2) Minimum reportable titer = 0 (example only)
(3) Minimum reportable concentration = 0 (example only)
BLQ = Below Limit of Quantitation, LTR = Lower than Reportable, N/A = Not Applicable, N.C. = Not Calculable,
ADA = Anti-Drug Antibodies (is also referred to as ATA, or Anti-Therapeutic Antibodies)
ROXXXXXXX is also known as [drug]"
)

tail(lsting, 50)[1:24, ]
```

{{< include ../../test-utils/save_results.qmd >}}
shajoezhu marked this conversation as resolved.
Show resolved Hide resolved

{{< include ../../repro.qmd >}}
:::
21 changes: 21 additions & 0 deletions package/tests/testthat/_snaps/adal01/markdown-snaps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# lsting

```
Code
print(data_snap[[i]])
Output
# A tibble: 24 × 9
USUBJID VISIT ISTPT NFRLT RES_ADA TU_ADA RES_NAB TU_NAB AVAL_pk
<lstng_ky> <lstng_ky> <fct> <dbl> <chr> <chr> <chr> <chr> <chr>
1 AB12345-RUS-16-id-165 Day 2 24H 24 Negative N/A NA N/A 0.00
shajoezhu marked this conversation as resolved.
Show resolved Hide resolved
2 AB12345-RUS-16-id-165 Day 2 24H 24 NA N/A Negative N/A 0.00
3 AB12345-RUS-18-id-359 Day 1 Predose 0 NA BLQ Positive 1.07 0.00
4 AB12345-RUS-18-id-359 Day 1 Predose 0 Positive N/A NA N/A 0.00
5 AB12345-RUS-18-id-359 Day 2 24H 24 Negative N/A NA N/A 0.00
6 AB12345-RUS-18-id-359 Day 2 24H 24 NA N/A Negative N/A 0.00
7 AB12345-RUS-6-id-77 Day 1 Predose 0 Negative N/A NA N/A 0.00
8 AB12345-RUS-6-id-77 Day 1 Predose 0 NA N/A Negative N/A 0.00
9 AB12345-RUS-6-id-77 Day 2 24H 24 NA 1.16 Positive 1.16 0.00
10 AB12345-RUS-6-id-77 Day 2 24H 24 Positive N/A NA N/A 0.00
# i 14 more rows
```