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

Widget updates #103

Merged
merged 3 commits into from
Mar 20, 2022
Merged

Widget updates #103

merged 3 commits into from
Mar 20, 2022

Conversation

jwildfire
Copy link
Contributor

Overview

image

This should wrap up the updates for v0.3! Once this is merged I'll work on getting this to CRAN and then try to finalize safetyGraphics v2.1.

Test Notes

  • For hep-explorer, confirm functionality listed above is present and no other obvious bugs are found.
  • Test code for aeTimeline:
#Confirm that new metadata mappings for severity and seriousness work as expected in aetimelines

customSevSer <- safetyData::adam_adae %>%
rename(sev=AESEV) %>%
rename(ser=AESER) 

safetyGraphicsApp(
    domainData = list(aes=customSevSer),
    mapping=list(aes=list(severity_col="sev", serious_col="ser"))
)

# Extra color added when new category added. Not 100% ideal, but ok. 
customSevSer <- safetyData::adam_adae %>%
rename(sev=AESEV) %>%
rename(ser=AESER) %>%
mutate(sev = if_else(sev=="MILD","WILD!",sev))


safetyGraphicsApp(
    domainData = list(aes=customSevSer),
    mapping=list(aes=list(severity_col="sev", serious_col="ser"))
)

Copy link
Contributor

@xni7 xni7 left a comment

Choose a reason for hiding this comment

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

Looks great @jwildfire ! a couple of minor comments

  • hepExplorer

     # enable mDish plot example
     mapping_baseline <- list(
         measure_col = "PARAM",
         measure_values = list(
             ALT = "Alanine Aminotransferase (U/L)",
             AST = "Aspartate Aminotransferase (U/L)",
             TB = "Bilirubin (umol/L)",
             ALP = "Alkaline Phosphatase (U/L)"
         ),
         ## mDish does not work with this mapping
         # baseline_flag_col = "ABLFL",
         # baseline_flag_values = "Y",
         ## mDish works with a baseline list, 
         baseline = list(
             value_col = "ABLFL",
             values = "Y"
         ),
         analysis_flag_col = "",
         analysis_flag_values = "",
         id_col = "USUBJID",
         value_col = "AVAL",
         normal_col_low = "A1LO",
         normal_col_high = "A1HI",
         studyday_col = "ADY",
         visit_col = "VISIT",
         visitn_col = "VISITNUM",
         unit_col = ""
     )
     
     hepExplorer(df = safetyData::adam_adlbc, mapping = mapping_baseline)
  • aeTimelines. Looks great! Only comment is the ASTDY has huge negative values in safetyData::adam_adae. Perhaps can filter out in vignette for better viewing experience.

    # Extra color added when new category added. Not 100% ideal, but ok.
    customSevSer <- safetyData::adam_adae %>%
        filter(ASTDY > -50) %>% # add a filter to make the timeline more viewable
        rename(sev = AESEV) %>%
        rename(ser = AESER) %>%
        mutate(sev = if_else(sev == "MILD", "WILD!", sev))
    
    
    safetyGraphicsApp(
        domainData = list(aes = customSevSer),
        mapping = list(aes = list(severity_col = "sev", serious_col = "ser"))
    )

@jwildfire
Copy link
Contributor Author

suggest adding reference to R and nR ratio somewhere (ideally in the widget), e.g.

Good idea - filed SafetyGraphics/hep-explorer#335

@jwildfire
Copy link
Contributor Author

  • baseline and analysis mapping in hepExplorer() do not match hepexplorer.js parameterization

I updated the docs a bit in #104 on Friday and cleaned this up.

FWIW, the default mapping was pasted from the safetyGraphicsApp() export which includes baseline_flag_X and analysis_flag_X. As you noted, they're not currently used in hepExplorer though. Should probably write a little hepexplorer_init to set them up in the safetyGraphics app. That actually obfuscates the new the hepExplorer function a bit though, so maybe we should just delete those non-standard mappings. Not sure ... Will file an issue and leave it for a future release.

@jwildfire
Copy link
Contributor Author

Actually going to just delete those options. See #105.

@jwildfire
Copy link
Contributor Author

jwildfire commented Mar 20, 2022

  • Only comment is the ASTDY has huge negative values in safetyData::adam_adae. Perhaps can filter out in vignette for better viewing experience.

Yeah, I've been meaning to do this in the hosted example. Added a comment here as a reminder.

@jwildfire jwildfire merged commit 8bfd83f into dev Mar 20, 2022
@jwildfire jwildfire deleted the widget-updates branch March 23, 2022 13:18
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.

AESER is an undocumented requirement for safetyTimeline widget Update htmlwidgets to use latest releases
2 participants