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

Harmonization tab error #93

Closed
cristinamullin opened this issue Sep 5, 2023 · 2 comments
Closed

Harmonization tab error #93

cristinamullin opened this issue Sep 5, 2023 · 2 comments

Comments

@cristinamullin
Copy link
Collaborator

cristinamullin commented Sep 5, 2023

This bug is possibly related to the harmonization template and implementation of transformations to "NA" when populated.

See TADA_HarmonizeSynonyms, line 246 in Transformations.R in TADA R Package:
!is.na(TADA.ResultSampleFractionText) & is.na(Target.TADA.ResultSampleFractionText) & !is.na(TADA.FractionAssumptions) ~ Target.TADA.ResultSampleFractionText,

Also line 217, where targets are only assigned if NA. # find places where metadata will be changed and add targets
harm.ref$TADA.Harmonized.Flag <- ifelse(!is.na(harm.ref$Target.TADA.CharacteristicName) | !is.na(harm.ref$Target.TADA.ResultSampleFractionText) | !is.na(harm.ref$Target.TADA.MethodSpecificationName) | !is.na(harm.ref$Target.TADA.ResultMeasure.MeasureUnitCode), TRUE, FALSE)

My guess is that we may need to update the logic to deal with scenarios where the target is actually NA.

Warning in Shiny:

Warning: Error in dplyr::mutate: ℹ In argument: TADA.ResultSampleFractionText = dplyr::case_when(...).
Caused by error in dplyr::case_when():
! Failed to evaluate the left-hand side of formula 2.
Caused by error:
! object 'TADA.FractionAssumptions' not found
3: runApp
2: print.shiny.appobj
1:

image

@elisehinman
Copy link
Contributor

elisehinman commented Sep 6, 2023

@cristinamullin Line 246 should convert the fraction to NA if the target is NA and the Target.Assumption column is NOT NA (i.e. there are some notes about why it is being converted to NA). Do you remember what dataset you used in this instance and the steps you took on the harmonization tab? The error says that TADA.FractionAssumptions is not found. I'm wondering if perhaps the dataset had no overlap with the default harmonization table and thus the TADA.FractionAssumptions column did not end up in the harmonization reference table? Or, did this column get renamed somewhere or removed? It looks like the harmonization functions were reworked a little bit. This may be the root of this issue. I have tried to download both TADA and TADAShiny (remotes::install_github()) on my personal machine and run the app, but I'm running into different errors on the harmonize tab. These errors suggest that there might be some changes to the columns supplied by the harmonization reference table.

Screenshot 2023-09-06 at 7 02 49 PM

EDIT: Just submitted a pull request that may resolve this issue (Harmonization tab error), but more likely to resolve issue I was having in troubleshooting the problem.

@cristinamullin
Copy link
Collaborator Author

Thank you for looking into this! I ran into this error before I made any changes to the TADA package. I did make some changes to the synonym function, and missed this needed edit on the Shiny side so this is a new error you found (thank you!). However, I have not run into this error (TADA.FractionAssumptions not found) again from your Shiny branch (ran locally).

Query: Organization "FTBLKNAP" for time period "2021-09-05" to "2023-09-05". I was originally using the web app.

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

No branches or pull requests

2 participants