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

Rename cluster to addCluster #502

Merged
merged 22 commits into from
Apr 10, 2024
Merged

Rename cluster to addCluster #502

merged 22 commits into from
Apr 10, 2024

Conversation

thpralas
Copy link
Collaborator

@thpralas thpralas commented Mar 5, 2024

Rename cluster to addCluster.
Fix indentation in calculateDMM and cluster files following Bioconductor best practices (indentation must be a multiple of 4 spaces).
Move deprecated functions from the calculateDMM file to deprecate file.

Merge branch 'master' of https://github.com/microbiome/mia into rename_cluster

# Conflicts:
#	R/deprecate.R
#	man/deprecate.Rd
Merge branch 'master' of https://github.com/microbiome/mia into rename_cluster

# Conflicts:
#	R/cluster.R
#	tests/testthat/test-9cluster.R
R/cluster.R Outdated Show resolved Hide resolved
Merge branch 'master' of https://github.com/microbiome/mia into rename_cluster

# Conflicts:
#	NEWS
R/deprecate.R Outdated
Comment on lines 3 to 16
#' @param x A
#' \code{\link[SummarizedExperiment:SummarizedExperiment-class]{SummarizedExperiment}}
#' object.
#'
#' @param clust.col A single character value indicating the name of the
#' \code{rowData} (or \code{colData}) where the data will be stored.
#'
#' @param exprs_values a single \code{character} value for specifying which
#' assay to use for calculation.
#' (Please use \code{assay.type} instead.)
#'
#' @param transposed Logical scalar, is x transposed with cells in rows?
#'
#' @param type the type of measure used for the goodness of fit. One of
Copy link
Contributor

Choose a reason for hiding this comment

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

This manual page should collect all deprecated functions. Some of them might have same parameter name but different meaning. So I'm wondering what happens then. --> I'm wondering if it is better to not list parameters for any of these functions since user's should not use them anyways (even though BIocCheck would tell otherwise)

R/deprecate.R Outdated
name = "clusters", clust.col = "clusters", ...){
.Deprecated(msg = paste0("'cluster' is deprecated. ",
"Use 'addCluster' instead."))
addCluster(x)
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not pass parameters. addCluster gets only x parameter. Not others. Moreover, you can skip listing parameters. Use ... and then pass them to addCluster with ...

Only x is needed to list since the method is chosen based on class of x

Copy link
Contributor

Choose a reason for hiding this comment

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

The idea is to keep these functions a hollow as possible. Just that they work but do not do anything but call the new function

R/calculateDMM.R Outdated
Comment on lines 143 to 155
setMethod("calculateDMN", signature = c(x = "SummarizedExperiment"),
function(x, assay.type = assay_name, assay_name = exprs_values, exprs_values = "counts",
transposed = FALSE, ...){
.Deprecated(old="calculateDMN", new="cluster",
"Now calculateDMN is deprecated. Use cluster with DMMParam parameter instead.")
mat <- assay(x, assay.type)
if(!transposed){
mat <- t(mat)
}
calculateDMN(mat, ...)
}
function(x, assay.type = assay_name, assay_name = exprs_values, exprs_values = "counts",
transposed = FALSE, ...){
.Deprecated(old="calculateDMN", new="cluster",
"Now calculateDMN is deprecated. Use cluster with DMMParam parameter instead.")
mat <- assay(x, assay.type)
if(!transposed){
mat <- t(mat)
}
calculateDMN(mat, ...)
}
)

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that the indentation is incorrect. Also lines are too long (80 characters is maximum)

Can you either fix these or revert the file? Maybe remove the changes, since this PR is about cluster function

Otherwise, this is ready to go. Thanks!

Copy link
Contributor

@TuomasBorman TuomasBorman left a comment

Choose a reason for hiding this comment

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

Looks good! @antagomir

@antagomir
Copy link
Member

There are unresolved comments, and one conflict. If those are resolved then this seems good to me at least?

Merge branch 'devel' of https://github.com/microbiome/mia into rename_cluster

# Conflicts:
#	NEWS
Copy link

codecov bot commented Apr 4, 2024

Codecov Report

Attention: Patch coverage is 1.38889% with 71 lines in your changes are missing coverage. Please review.

Project coverage is 72.90%. Comparing base (32d85c6) to head (6d978f5).

Files Patch % Lines
R/calculateDMM.R 0.00% 62 Missing ⚠️
R/deprecate.R 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel     #502      +/-   ##
==========================================
- Coverage   73.11%   72.90%   -0.21%     
==========================================
  Files          40       40              
  Lines        4630     4643      +13     
==========================================
  Hits         3385     3385              
- Misses       1245     1258      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TuomasBorman TuomasBorman merged commit 1d01162 into devel Apr 10, 2024
3 of 5 checks passed
@TuomasBorman TuomasBorman deleted the rename_cluster branch April 10, 2024 07:34
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.

3 participants