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

Benchmark #15

Open
wants to merge 28 commits into
base: JOSS
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ae0144d
Document performance and benchmarks #13
PHS-Meantrix Oct 28, 2024
d3e9e4a
Document performance and benchmarks #13
PHS-Meantrix Oct 30, 2024
3b76b26
Document performance and benchmarks #13
PHS-Meantrix Oct 30, 2024
56725b5
Document performance and benchmarks #13
PHS-Meantrix Nov 1, 2024
b3514da
Document performance and benchmarks #13
PHS-Meantrix Nov 1, 2024
4c8d40c
Document performance and benchmarks #13
PHS-Meantrix Jan 7, 2025
c9d363c
Document performance and benchmarks #13
PHS-Meantrix Jan 8, 2025
2c4101d
Document performance and benchmarks #13
PHS-Meantrix Jan 8, 2025
87de5e9
Document performance and benchmarks #13
PHS-Meantrix Jan 8, 2025
4240c0c
Document performance and benchmarks #13
PHS-Meantrix Jan 8, 2025
6513712
General comments for review #27
PHS-Meantrix Jan 8, 2025
5f54645
General comments for review #27
PHS-Meantrix Jan 8, 2025
2af1634
General comments for review #27
PHS-Meantrix Jan 9, 2025
540e8d0
General comments for review #27
PHS-Meantrix Jan 9, 2025
1da1215
General comments for review #27
PHS-Meantrix Jan 9, 2025
639755d
General comments for review #27
PHS-Meantrix Jan 9, 2025
d564f1a
General comments for review #27
PHS-Meantrix Jan 9, 2025
12f03a2
General comments for review #27
PHS-Meantrix Jan 9, 2025
6732c58
General comments for review #27
PHS-Meantrix Jan 9, 2025
32c9668
General comments for review #27
PHS-Meantrix Jan 10, 2025
61c2214
General comments for review #27
PHS-Meantrix Jan 10, 2025
ca2369a
General comments for review #27
PHS-Meantrix Jan 10, 2025
aaaeeb2
General comments for review #27
PHS-Meantrix Jan 10, 2025
f1ad814
General comments for review #27
PHS-Meantrix Jan 10, 2025
f7eb8b6
General comments for review #27
PHS-Meantrix Jan 10, 2025
d06ad50
General comments for review #27
PHS-Meantrix Jan 10, 2025
6550e28
General comments for review #27
PHS-Meantrix Jan 10, 2025
a1a7218
General comments for review #27
PHS-Meantrix Jan 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ docs
renv.lock
.renvignore
.Rprofile
renv
renv
inst/doc
88 changes: 88 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@

# Contributing to `corrp`

Thank you for your interest in contributing to the `corrp` package!

. We welcome contributions and improvements from the community. To help make the process smooth, please follow the guidelines outlined below.

## How to Contribute

### Reporting Bugs

If you encounter a bug or issue, please follow these steps:
1. **Search for existing issues** to see if the bug has already been reported.
2. If not, **open a new issue** on the [GitHub Issues page](https://github.com/meantrix/corrp/issues).
3. Be sure to include the following details:
- A description of the issue.
- Steps to reproduce the issue.
- Any error messages or warnings.
- The version of the package you're using.
- The R version.
- Operating system if relevant.


### Submitting Code

To submit code changes, please follow these steps:
1. **Fork the repository**.
2. **Create a new branch** for your changes.
3. **Implement your changes**. Be sure to:
- Write clear and concise commit messages.
- Document new code and functions using `roxygen2` comments.
- Ensure your code follows the existing code style (e.g., indentation, naming conventions).

4. **Run tests** to ensure your changes work as expected. To do this, use the following command:

```R
rcmdcheck::rcmdcheck()
```

The result should show **one note** only, like this:

```
── R CMD check results ────────────────────────────────────────────────────────────────────────────────────────────────────────────────── corrp 0.5.0 ────
Duration: 57.5s

❯ checking installed package size ... NOTE
installed size is 5.9Mb
sub-directories of 1Mb or more:
libs 5.6Mb

0 errors ✔ | 0 warnings ✔ | 1 note ✖
```

Make sure there are **no errors** or **warnings** in the output. If there are, please resolve them before submitting your changes.

1. **Push your changes** to your fork and create a pull request to the main repository.

### Code Style Guidelines

- **Indentation**: Use 2 spaces for indentation.
- **Naming conventions**: Follow the existing naming conventions in the codebase.
- **Documentation**: Document all public functions with `roxygen2` comments.
- **Testing**: Ensure that your changes are covered by tests, especially if you're adding new functionality or fixing bugs.



### Running Tests

We use [testthat](https://cran.r-project.org/web/packages/testthat/index.html) for unit testing. To run the tests, use the following command:

```R
devtools::test()
```

Make sure all tests pass before submitting your changes.

### Documentation

If your changes introduce new functionality, make sure to:
- Update the relevant documentation using `roxygen2` comments.
- Update the `README.md` and any relevant vignettes.
- Update the `NEWS.md` with your changes.
- Update the version of the package.

### License

By contributing, you agree that your contributions will be licensed according to [license](LICENSE.md).

24 changes: 14 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,29 @@ Description: Compute multiple types of correlation analyses, including
the average correlation clustering algorithm and distance
correlation t-test.
Imports:
Rcpp (>= 1.0.4.6),
RcppArmadillo (>= 0.11.2.0.0),
lsr (>= 0.5),
parallel (>= 3.6.3),
stats (>= 3.6.3),
caret (>= 6.0-85),
minerva (>= 1.5.8),
checkmate (>= 2.0.0),
Rcpp (>= 1.0.13-1),
RcppArmadillo (>= 14.2.2-1),
corrplot (>= 0.95),
lsr (>= 0.5.2),
parallel (>= 4.4.1),
stats (>= 4.4.1),
caret (>= 7.0-1),
minerva (>= 1.5.10),
checkmate (>= 2.3.2),
ppsr (>= 0.0.2),
DescTools (>= 0.99.40)
Suggests:
corrplot,
energy,
knitr,
rmarkdown,
testthat
License: GPL (>= 3)
Encoding: UTF-8
LazyData: true
LinkingTo: Rcpp, RcppArmadillo
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
URL: https://github.com/meantrix/corrp,
https://meantrix.github.io/corrp/
BugReports: https://github.com/meantrix/corrp/issues
VignetteBuilder: knitr
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ S3method(corr_rm,matrix)
S3method(sil_acca,acca_list)
S3method(sil_acca,list)
export(acca)
export(assert_required_argument)
export(best_acca)
export(corr_fun)
export(corr_matrix)
export(corr_rm)
export(corrp)
export(dcorT_test)
export(ptest)
export(set_arguments)
export(sil_acca)
importFrom(Rcpp,evalCpp)
importFrom(RcppArmadillo,armadillo_version)
importFrom(corrplot,corrplot)
useDynLib(corrp, .registration=TRUE)
28 changes: 27 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# CHANGELOG


## 0.6.0

- Add `VignetteBuilder: knitr` to DESCRIPTION
- Add usefull error message for required parameters.
- Fix C++ `Astar` method.
- Run benchmarks, expand the paper to include statements on resource-intensive options, and incorporate an enhanced version of `energy::dcorT.test`. Also, change the data used in the paper.


### Methods Added

- Added method `set_arguments`: Assigns provided arguments from the `args_list` to the parent environment. If an argument is inside the arguments of the methods that calculate statistics, it assigns it on the parent environment, and removes the argument from the list.
- Added method `assert_required_argument`: Ensures that a required argument is provided. If the argument is missing, it throws an error with a clear message.

### Methods Altered

- Altered messages and make *.args lists be able to alter arguments (`p.value`, `comp`, "alternative", "num.s", "rk") of methods: `.corlm`, `.cramersvp`, `.dcorp`, `.corperp`, `.micorp`, `.uncorp`, `.corpps`.
- Update the `.corpps` method to support p-value testing (`p-test`), which is disabled by default due to its slow performance. When `p-test` is not performed, the `isig` value is set to `NA`. `p-test` can be run assigning an element `ptest = TRUE` to `pps.args` argument.

### Documentation

- Enhanced the documentation for `corrp` by including examples, refining the pair type section with additional details and references, and providing a more comprehensive explanation of the output format and its interpretation.
- Improved the documentation for `corr_rm` by adding examples and providing a clearer explanation of the `c` parameter.
- Added examples of usage in the documentation for: `acca`, `best_acca`, `corrp`, `corr_rm`, `corr_matrix`, `corr_fun`, `ptest`, `sil_acca`.


## 0.5.0

- Creates the package website with the command: `usethis::use_pkgdown_github_page`;
Expand All @@ -25,7 +51,7 @@
- p.value: p-value of the t-test.
- data.name: description of data.

### Changes
### Methods Altered
- `corr_fun`: Now uses C++ while using distance correlation.

## 0.3.0
Expand Down
15 changes: 11 additions & 4 deletions R/acca.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#' @useDynLib corrp, .registration=TRUE
#' @importFrom Rcpp evalCpp
#' @importFrom RcppArmadillo armadillo_version
#' @importFrom corrplot corrplot

#' @title Average correlation clustering algorithm
#'
Expand All @@ -16,13 +17,13 @@
#' @param maxrep \[\code{integer(1)}]\cr maximum number of
#' interactions without change in the clusters.
#' @param maxiter \[\code{integer(1)}]\cr maximum number of interactions.
#' @param ... Additional arguments (TODO).
#' @param ... Additional arguments .
#'
#' @return \[\code{acca_list(k)}]\cr A list with the
#' final result of the clustering method.
#' That is, the name of the variables belonging to each cluster k.
#'
#' @author Igor D.S. Siciliani
#' @author Igor D.S. Siciliani, Paulo H. dos Santos
#'
#' @keywords correlation , acca
#'
Expand All @@ -31,12 +32,18 @@
#' "Average correlation clustering algorithm (ACCA) for grouping of co-regulated
#' genes with similar pattern of variation in their expression values."
#' Journal of Biomedical Informatics 43.4 (2010): 560-568.
#'
#' @examples
#'
#'
#' x <- corrp::corrp(iris)
#' m <- corrp::corr_matrix(x)
#' corrp::acca(m, 2)
#'
#' @export
#'
acca <- function(m, ...) {
acca <- function(m, k, ...) {
assert_required_argument(m, "The 'm' argument must be a cmatrix object, which is the output from corr_matrix function, or it must be a matrix.")
assert_required_argument(m, "The 'k' argument must be the number of number of clusters considered.")
UseMethod("acca", m)
}

Expand Down
9 changes: 7 additions & 2 deletions R/best_acca.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
#' without change in the clusters in the ACCA method.
#' @param maxiter \[\code{integer(1)}]\cr maximum number
#' of interactions in the ACCA method.
#' @param ... Additional arguments (TODO).
#' @param ... Additional arguments.
#'
#' @return \[\code{list(3)}]\cr A list with:
#' silhouette average with per k `$silhouette.ave`;
#' the sequence of clusters tested `$k` and
#' the optimal number of clusters `$best.k`.
#' @seealso \code{\link{sil_acca}}
#'
#' @author Igor D.S. Siciliani
#' @author Igor D.S. Siciliani, Paulo H. dos Santos
#'
#' @keywords silhouette , acca , optimal , k
#'
Expand All @@ -35,11 +35,16 @@
#' "International Conference on Artificial Intelligence
#' and Soft Computing. Springer, Cham, 2015.
#'
#' @examples
#'
#' x <- corrp::corrp(iris)
#' m <- corrp::corr_matrix(x)
#' best_acca(m, 2, 6)
#'
#' @export
#'
best_acca <- function(m, ...) {
assert_required_argument(m, "The 'm' argument must be a cmatrix object, which is the output from corr_matrix function, or it must be a matrix.")
UseMethod("best_acca", m)
}

Expand Down
Loading
Loading