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

Close (#22) Created Obesity ADVS Vignette #26

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

Siddhesh2097
Copy link
Contributor

@Siddhesh2097 Siddhesh2097 commented Aug 25, 2024

Thank you for your Pull Request! We have developed this task checklist from the Development Process Guide to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral family codebase remains robust and consistent.

Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the main branch until you have checked off each task.

  • Place Closes #<insert_issue_number> into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update)
  • Code is formatted according to the tidyverse style guide. Run styler::style_file() to style R and Rmd files
  • Updated relevant unit tests or have written new unit tests, which should consider realistic data scenarios and edge cases, e.g. empty datasets, errors, boundary cases etc. - See Unit Test Guide
  • If you removed/replaced any function and/or function parameters, did you fully follow the deprecation guidance?
  • Update to all relevant roxygen headers and examples, including keywords and families. Refer to the categorization of functions to tag appropriate keyword/family.
  • Run devtools::document() so all .Rd files in the man folder and the NAMESPACE file in the project root are updated appropriately
  • Address any updates needed for vignettes and/or templates
  • Update NEWS.md under the header # admiral<ext> (development version) if the changes pertain to a user-facing function (i.e. it has an @export tag) or documentation aimed at users (rather than developers)
  • Build site pkgdown::build_site() and check that all affected examples are displayed correctly and that all new functions occur on the Reference page.
  • Address or fix all lintr warnings and errors - lintr::lint_package()
  • Run R CMD check locally and address all errors and warnings - devtools::check()
  • Link the issue in the Development Section on the right hand side.
  • Address all merge conflicts and resolve appropriately
  • Pat yourself on the back for a job well done! Much love to your accomplishment!

@Siddhesh2097 Siddhesh2097 linked an issue Aug 25, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Aug 25, 2024

Code Coverage

Package Line Rate Health
admiralmetabolic 100%
Summary 100% (3 / 3)

@AndersAskeland
Copy link
Member

Amazing job @Siddhesh2097 ! I noticed that the pull-request is still in draft mode though. Are you still working on it, or do you want a review?

@Siddhesh2097 Siddhesh2097 marked this pull request as ready for review August 26, 2024 12:24
@Siddhesh2097
Copy link
Contributor Author

@AndersAskeland Not able to resolve the pending two checks . Can you help ?

@AndersAskeland
Copy link
Member

AndersAskeland commented Aug 28, 2024

@Siddhesh2097 I just did a quick check, and it seems to be triggered by using the function derive_vars_crit_flag(). This function is currently only part of the development version of Admiral (i.e. it is not yet released). This is also the reason for the check passing on the development branch but failing on the release and old release branch.

I will check if I can find any good workarounds later today or tomorrow.

@AndersAskeland
Copy link
Member

AndersAskeland commented Aug 28, 2024

@Siddhesh2097 I just did a quick check, and it seems to be triggered by using the function derive_vars_crit_flag(). This function is currently only part of the development version of Admiral (i.e. it is not yet released). This is also the reason for the check passing on the development branch but failing on the release and old release branch.

I will check if I can find any good workarounds later today or tomorrow.

I am unsure how we proceed for these failed check. If we skip the CI checks for this pull request, we will encounter the same error in all new branches / pull requests from now on (until the function is released in admiral base). We don't want that.

The best alternative I can see would be to temporarily copy / paste derive_vars_crit_flag() from admiral into admiralmetabolic (perhaps in a file like R/temp_ derive_vars_crit_flag.R). Then, for us to remember to remove this function (and change the dependency back to admiral), we could slightly modify the function to check the admiral namespace for the derive_vars_crit_flag(). If it is found it could fail loudly - giving us an heads up to remove the function.

There might still be a potential problem with the checks for the old release of admiral though. However, I am unsure which version the CI check use, and how long until this function propagate down to an old release.

Do you have any other suggestions @manciniedoardo , and do you know how one usually handle the check for an old release in these extension packages?

@AndersAskeland
Copy link
Member

AndersAskeland commented Sep 2, 2024

While we are waiting to find out how to handle the failing tests, here are some other general comments :)

  • You can clean up the _pkgdown.yml file and add this new ADVS vingette to the articles. For some context, the _pkgdown.yml contains the actual structure of how the website will be built. See
    articles:
    text: User Guides
    menu:
    - text: Creating ADXX
    href: articles/adxx.html
  • There are various references to an adxx vingette. I assume that this is an example, and I would remove it now, when we have our first actual vingette.
  • The general workflow for vingettes are that they are automatically built on package release. Hence, we would not want people to be able to commit these vingettes (or other documentation) built locally. A way to avoid this is to add the doc and Meta folder to .gitignore. This can be automatically done by running devtools::build_vingettes(). You will also notice that this command updates the .Rbuildignore file with the doc folder. This is needed as the devtools::build_vingettes() function stores the built vingettes in this folder for you to view, and we don't want to include this in the source package.

@manciniedoardo
Copy link
Collaborator

manciniedoardo commented Sep 6, 2024

@Siddhesh2097 @AndersAskeland I've now fixed the failing checks (thanks @bundfussr for the support) - it was sort of my fault but I can try explain below.

Our CICD actions look for the staged_dependencies.yaml file and use that to install the development version of some packages ({admiral} included) rather than the version off of CRAN, precisely to allow us to use features from those packages while they are still in development (e.g. the criterion flag function).

staged_dependencies.yaml used to be part of {admiraltemplate} (the base repo we use to create our extension packages) before we erroneously removed it prior to creating {admiralmetabolic}. So, I manually re-added it to {admiralmetabolic} but in doing so named it staged_dependencies.yml rather than staged_dependencies.yaml. Because of this, the workflow wasn't finding the file and wasn't installing the right version of {admiral}, hence why it couldn't find the new function.

I've updated the file within this PR so that once merged we don't have this problem anymore.

NB: @AndersAskeland I believe these checks refer to R releases rather than {admiral} releases.
image

Copy link
Collaborator

@manciniedoardo manciniedoardo left a comment

Choose a reason for hiding this comment

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

Thanks @Siddhesh2097 - this is a super first draft!

Along with my review comments, as @AndersAskeland mentioned please could you update _pkgdown.yml to remove references to adxx and sub them with references to advs so that it is possible to navigate to the vignette from the website navbar.

Thanks!

vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
@manciniedoardo
Copy link
Collaborator

@kathrinflunkert can you also please review?

Copy link
Collaborator

@manciniedoardo manciniedoardo left a comment

Choose a reason for hiding this comment

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

Thanks @Siddhesh2097 - changes look good and i've given it a second pass.

vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
Copy link
Member

@AndersAskeland AndersAskeland left a comment

Choose a reason for hiding this comment

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

Sorry for this review being a bit late. I forgot to actually submit it :P

vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
_pkgdown.yml Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
Copy link
Collaborator

@manciniedoardo manciniedoardo left a comment

Choose a reason for hiding this comment

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

Some formatting/typo corrections

vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
vignettes/advs.Rmd Outdated Show resolved Hide resolved
Copy link
Contributor

@kathrinflunkert kathrinflunkert 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 in general! I was able to follow all steps in the vignette. I only added one comment on the PARAMN.

vignettes/advs.Rmd Outdated Show resolved Hide resolved
Add PARAMN for all parameters and not just for BMI.
Copy link
Collaborator

@manciniedoardo manciniedoardo left a comment

Choose a reason for hiding this comment

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

HI @Siddhesh2097 - one final review from me. We discussed in the {admiral} core team and with @AndersAskeland and have concluded that in order not to duplicate content, it's ok that the vignette is not completely executable, so if you could please hide the relevant sections that would be super.

Once this is done I think we are ready to merge and I will approve and merge in.


```{r eval=TRUE}
advs <- derive_var_chg(advs)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove empty line here

"TEMP", "TEMP", "Temperature (C)", 9, "Vital Sign", 2
)

attr(param_lookup$VSTESTCD, "label") <- "Vital Signs Test Short Name"
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to label here

The following steps are to merge `ADSL` variables with the source data and
derive the usual `ADVS` analysis variables. Note that only the sections required for this vignette are covered in the following steps. To get a detailed guidance on all the steps, refer the `{admiral}` [Creating a BDS Finding ADaM vignette](https://pharmaverse.github.io/admiral/articles/bds_finding.html).

Join `ADSL` to your `VS` domain. Only the `ADSL` variables used for derivations are selected at this step.
Copy link
Collaborator

Choose a reason for hiding this comment

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

From here to the end of the subsection, I would hide these chunks, remove the explanation and accept the vignette is not completely executable as otherwise we are just duplicating what is in the admiral advs vignette.

using `{admiral}` functions is the same. We focus on the most common
endpoints and their derivations mainly found in metabolic trials to
avoid repeating information and maintaining the same content in two
places.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
places.
places. As such, the code in this vignette is not completely executable; we recommend consulting the ADVS template script to view the full workflow.

@manciniedoardo
Copy link
Collaborator

@pharmaverse/admiralmetabolic - see my comment above regarding the executability of the vignette. Once @Siddhesh2097 addresses the final comments we should be ready to merge, so unless you have any final thoughts, please approve this PR 😄

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.

Vignettes: Creating an Obesity ADVS
5 participants