-
Notifications
You must be signed in to change notification settings - Fork 19
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
[r] Change default insertion mode for macs peak calling, rename function #143
Conversation
change default insertion mode
01ad225
to
09fb104
Compare
call_macs_peaks <- function(...) { | ||
rlang::warn("`call_macs_peaks()` is deprecated. Please use `call_peaks_macs()` instead.") | ||
return(call_peaks_macs(...)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this an adequate way of deprecating an interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been using the lifecycle
package for this. Function rename deprecation messages would use something like this:
lifecycle::deprecate_warn("0.2.0", "draw_trackplot_grid()", "trackplot_combine()")
Another nice detail could be keeping a bit more docs on the old function's docstring. This helps for if people run ?call_macs_peaks
or if they access an old URL for the function docs. e.g.
#' Call peaks using MACS2/3
#'
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' This function has been renamed to `call_peaks_macs()`
#' @export
#' @keywords internal
This way it won't be indexed in the list of functions, but it will be possible to access the function docs directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, just a couple small comments below. I'm assuming that we'll save working on the Windows C++ threading for another PR?
call_macs_peaks <- function(...) { | ||
rlang::warn("`call_macs_peaks()` is deprecated. Please use `call_peaks_macs()` instead.") | ||
return(call_peaks_macs(...)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been using the lifecycle
package for this. Function rename deprecation messages would use something like this:
lifecycle::deprecate_warn("0.2.0", "draw_trackplot_grid()", "trackplot_combine()")
Another nice detail could be keeping a bit more docs on the old function's docstring. This helps for if people run ?call_macs_peaks
or if they access an old URL for the function docs. e.g.
#' Call peaks using MACS2/3
#'
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' This function has been renamed to `call_peaks_macs()`
#' @export
#' @keywords internal
This way it won't be indexed in the list of functions, but it will be possible to access the function docs directly
Co-authored-by: Ben Parks <[email protected]>
Cool, I'll make the changes with the better way of styling! I think it would make sense to do the multithreading as a separate PR as that requires work more on the internal logic, rather than interface/documentation |
Styling changes from deprecation finished! |
Overall, this looks quite good and is ready to merge. Something we should discuss separately: do we knew why we missed the default argument issue initially despite comparing outputs against ArchR. Do you think our checks didn't cover this or weren't running with insertion_mode set to the default? |
Yup, so the results were compared in this file . I passed in the argument for |
Deprecating
call_macs_peaks()
tocall_peaks_macs()
as discussed previously. Note, is this how we should be handling deprecated APIs?