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

[r] Change default insertion mode for macs peak calling, rename function #143

Merged
merged 7 commits into from
Oct 26, 2024

Conversation

immanuelazn
Copy link
Collaborator

@immanuelazn immanuelazn commented Oct 22, 2024

Deprecating call_macs_peaks() to call_peaks_macs() as discussed previously. Note, is this how we should be handling deprecated APIs?

@immanuelazn immanuelazn force-pushed the ia/macs-default-insertion-mode branch from 01ad225 to 09fb104 Compare October 22, 2024 22:07
@immanuelazn immanuelazn marked this pull request as ready for review October 22, 2024 22:13
call_macs_peaks <- function(...) {
rlang::warn("`call_macs_peaks()` is deprecated. Please use `call_peaks_macs()` instead.")
return(call_peaks_macs(...))
}
Copy link
Collaborator Author

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?

Copy link
Owner

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

Copy link
Owner

@bnprks bnprks left a 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(...))
}
Copy link
Owner

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]>
@immanuelazn
Copy link
Collaborator Author

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

@immanuelazn
Copy link
Collaborator Author

Styling changes from deprecation finished!

@bnprks
Copy link
Owner

bnprks commented Oct 25, 2024

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?

@immanuelazn
Copy link
Collaborator Author

Yup, so the results were compared in this file . I passed in the argument for both in insertion_mode within this test case but didn't change the default param on the macs, and bedfile themselves.

@immanuelazn immanuelazn merged commit c039d07 into main Oct 26, 2024
4 checks passed
@immanuelazn immanuelazn deleted the ia/macs-default-insertion-mode branch January 11, 2025 00:38
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.

2 participants