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

Documentation: create_single_dose_dataset() example creates duplicates #2426

Closed
tuiaj opened this issue May 6, 2024 · 9 comments · Fixed by #2445
Closed

Documentation: create_single_dose_dataset() example creates duplicates #2426

tuiaj opened this issue May 6, 2024 · 9 comments · Fixed by #2445
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@tuiaj
Copy link

tuiaj commented May 6, 2024

Please select a category the issue is focused on?

Other

Let us know where something needs a refresh or put your idea here!

Was trying out the ADPPK Template but found that the create_single_dose_dataset() under the "Expand Dosing Records" section was creating duplicates within the variable NFRLT.

ex_exp |> # dataset derived from create_single_dose_dataset in the above linked example
  filter(USUBJID == "01-701-1028")  |> # filters for the first subject as an example
  count(NFRLT, sort = T)  #shows  nominal times which are repeated

which gives:
image

It seems the duplicates happen for the day of individual visits. Like during the process of unnesting each visit to a dose day/unit, it calculates the visit day twice rather than moving on.

image

Unsure if this is an actual coding/workflow issue or just specific to the example. In the previous step, "Get Dosing Information" - it creates the original NFRLT variable by NFRLT = 24 * (VISITDY - 1). This NFRLT is then used in the create_single_dose_dataset() to create the nominal time where the duplicates occur. In the other examples, I couldn't find this occuring.

However, when I reformatted the ex data before the create_single_dose_dataset() to have the first visit VISITDY be equal to 0 without altering any of the other visits, it allowed the logic of the function to proceed as intended.

reformatted <- ex_dates |> 
  filter(USUBJID == "01-701-1028")  |> #sets subject as an example
   mutate(VISITDY = if_else(VISITDY == 1, 0, VISITDY),
          NFRLT =VISITDY * 24) 

#shows the duplicates have decreased
reformatted |> 
  create_single_dose_dataset(dose_freq = EXDOSFRQ,
    start_date = ASTDT,
    start_datetime = ASTDTM,
    end_date = AENDT,
    end_datetime = AENDTM,
    nominal_time = NFRLT,
    lookup_table = dose_freq_lookup,
    lookup_column = CDISC_VALUE,
    keep_source_vars = exprs(
      STUDYID, USUBJID, EVID, EXDOSFRQ, EXDOSFRM,
      NFRLT, EXDOSE, EXDOSU, EXTRT, ASTDT, ASTDTM, AENDT, AENDTM,
      VISIT, VISITNUM, VISITDY,
      TRT01A, TRT01P, DOMAIN, EXSEQ, !!!adsl_vars)) |> 
  count(NFRLT, sort = T)

There is still duplicates in this reformatted example due to the misalignment of the VISITDY and the actual days between visits. I have the derived days between the first visit 2013-07-19 and last visit 2014-01-07 as 172 days ( 24.57 weeks) not the 168 listed. See attached excel for my visual breakdown: example_doseSchedule.xlsx

Overall, unsure how specific this problem is to the example data set (or my handling of it), or if it is something else. I am happy to help out wherever I can, but I am very new (this is my first issue on Github!)

@tuiaj tuiaj added the documentation Improvements or additions to documentation label May 6, 2024
@bms63
Copy link
Collaborator

bms63 commented May 7, 2024

Hi @jeffreyad do you have time to look into and respond to this issue?

@jeffreyad jeffreyad self-assigned this May 7, 2024
@jeffreyad
Copy link
Collaborator

Hi @jeffreyad do you have time to look into and respond to this issue?

@bms63 sure, I'll take a look

@jeffreyad
Copy link
Collaborator

Hi @tuiaj thanks for adding the issue. I had not noticed that before. I don't think it affects the final ADPPK data since the PC data are only at the baseline visit.

I think you are correct that the VISITDY may not match the VISIT value listed, and the WEEK 2 visit should have VISITDY = 14 instead of 13.

Congrats on your first issue!

@bms63
Copy link
Collaborator

bms63 commented May 8, 2024

@tuiaj would you like to try and make this update?

Congrats on your first issue and providing an excellent write-up!!

This dummy issue can help onboard you to our proccess, it has a video linked to it - #1839

@tuiaj
Copy link
Author

tuiaj commented May 9, 2024

Yes - I can try!

@jeffreyad
Copy link
Collaborator

@tuiaj Thanks! Feel free to reach out with any questions you have.

@jeffreyad
Copy link
Collaborator

Hi @tuiaj any update on this?

@bms63
Copy link
Collaborator

bms63 commented May 24, 2024

@jeffreyad I think they are not around right now - they were trying to do the dummy issue but went AFK. do you mind taking this on or we can ask others on the team?

@jeffreyad
Copy link
Collaborator

@bms63 sure I can take it

jeffreyad pushed a commit that referenced this issue May 24, 2024
@jeffreyad jeffreyad linked a pull request May 24, 2024 that will close this issue
15 tasks
bms63 pushed a commit that referenced this issue May 28, 2024
* #2426 Update NFRLT to reduce duplicates

* Update vignettes/pk_adnca.Rmd

Co-authored-by: Edoardo Mancini <53403957+manciniedoardo@users.noreply.github.com>

---------

Co-authored-by: Jeffrey Dickinson <dickinson.jeffrey@gene.com>
Co-authored-by: Edoardo Mancini <53403957+manciniedoardo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Development

Successfully merging a pull request may close this issue.

3 participants