diff --git a/.Rbuildignore b/.Rbuildignore index cda430b..6c2c110 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,4 @@ ^docs$ ^LICENSE.md$ ^CONTRIBUTING.md$ +^CRAN-RELEASE$ diff --git a/CRAN-RELEASE b/CRAN-RELEASE new file mode 100644 index 0000000..a3fdc71 --- /dev/null +++ b/CRAN-RELEASE @@ -0,0 +1,2 @@ +This package was submitted to CRAN on 2020-03-20. +Once it is accepted, delete this file and tag the release (commit 0bf3161347). diff --git a/DESCRIPTION b/DESCRIPTION index a7a15b9..eaa8d0c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Encoding: UTF-8 Package: cytominer Type: Package Title: Methods for Image-Based Cell Profiling -Version: 0.1.0.9000 +Version: 0.2.1 Authors@R: c(person("Tim", "Becker", email = "tbecker@broadinstitute.org", role = "aut"), person("Allen", "Goodman", email = "allen.goodman@icloud.com", role = "aut"), person("Claire", "McQuin", email = "mcquin@broadinstitute.org", role = "aut"), diff --git a/NEWS.md b/NEWS.md index 3e1bd44..478de75 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,17 @@ +# cytominer 0.2.1 + +This is a minor release but contains several new functions as well as a long-pending fix for incompatibility with the new (2018) tidyeval API. + +## New functions +- `whiten()` (#103) +- `extract_subpopulations()` (#107) +- `sparse_random_projection()` (#117) +- `svd_entropy()` (#123) +- `covariance()` (#114) + +## Bug fixes +- Fixed tidyeval incompatibilities reported in #131,#133,#134 (#135) + # cytominer 0.1.0 Hello world! diff --git a/R/replicate_correlation.R b/R/replicate_correlation.R index ae01607..026f9c4 100644 --- a/R/replicate_correlation.R +++ b/R/replicate_correlation.R @@ -88,6 +88,7 @@ replicate_correlation <- .strata <- rlang::syms(strata) } + result <- foreach::foreach(variable = variables, .combine = rbind) %dopar% { sample %>% @@ -111,4 +112,8 @@ replicate_correlation <- tidyr::gather_(replicate_by, "pearson", setdiff(names(.), "variable")) %>% dplyr::group_by(variable) %>% dplyr::summarize_at("pearson", c("median", "min", "max")) + + doParallel::stopImplicitCluster() + + result } diff --git a/R/svd_entropy.R b/R/svd_entropy.R index 919637c..2e9e08f 100644 --- a/R/svd_entropy.R +++ b/R/svd_entropy.R @@ -25,25 +25,6 @@ utils::globalVariables(c(".", "i")) svd_entropy <- function(variables, sample, cores = NULL) { doParallel::registerDoParallel(cores = cores) - singular_value_entropy <- function(A) { - singular_values <- svd(A, 0, 0)$d - - # normalize - singular_values <- singular_values / sum(singular_values) - - # entropy - -sum(singular_values * log10(singular_values)) - } - - entropy_score <- function(data) { - - # calculate contribution of each features to the entropy by leaving that feature out - sv_entropy <- - foreach::foreach(i = 1:ncol(data), .combine = c) %dopar% singular_value_entropy(data[-i, -i]) - - singular_value_entropy(data) - sv_entropy - } - sample %<>% dplyr::select(variables) %>% dplyr::collect() @@ -56,8 +37,30 @@ svd_entropy <- function(variables, sample, cores = NULL) { crossprod(., .) %>% entropy_score() + doParallel::stopImplicitCluster() + dplyr::tibble( variable = variables, svd_entropy = entropy_scores ) } + +singular_value_entropy <- function(A) { + singular_values <- svd(A, 0, 0)$d + + # normalize + singular_values <- singular_values / sum(singular_values) + + # entropy + -sum(singular_values * log10(singular_values)) +} + +entropy_score <- function(data) { + + # calculate contribution of each features to the entropy by leaving that feature out + sv_entropy <- + foreach::foreach(i = 1:ncol(data), .combine = c) %dopar% singular_value_entropy(data[-i, -i]) + + singular_value_entropy(data) - sv_entropy +} + diff --git a/cran-comments.md b/cran-comments.md index 43837c8..064e9c2 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,15 +1,22 @@ +## Note about two consecutive submissions +I mistakenly submitted to CRAN without saving cran-comments.md. +I am thus resubmitting, but have bumped up the version because I get the message +"The Server already contains a file with that name/version, please increase version number" + ## Test environments -* local OS X install, R 3.3.3 -* ubuntu 14.04.5 LTS (on travis-ci), R 3.4.1 -* win-builder +* local OS X install, R 3.6.1 +* Ubuntu 16.04.6 LTS (on travis-ci), R 3.6.2 +* win-builder (release and devel) ## R CMD check results There were no ERRORs or WARNINGs or NOTEs for OS X and ubuntu. There is 1 NOTE on winbuild: -- *New submission*: This is my first submission! - +- *New submission*: Because package was archived on CRAN +- *Misspelling*: Possibly mis-spelled words in DESCRIPTION: Caicedo (18:18, 19:27) -- I confirm no typo here +- *CRAN repository db overrides*: X-CRAN-Comment: Archived on 2019-05-08 as check problems were not corrected in time -- Correct. I just recovered from the shock of being bumped off CRAN. + ## Downstream dependencies There are currently no downstream dependencies for this package. diff --git a/docs/404.html b/docs/404.html index 3906e25..1c2b2a7 100644 --- a/docs/404.html +++ b/docs/404.html @@ -67,7 +67,7 @@
diff --git a/docs/CONTRIBUTING.html b/docs/CONTRIBUTING.html index 816b315..d8ff348 100644 --- a/docs/CONTRIBUTING.html +++ b/docs/CONTRIBUTING.html @@ -67,7 +67,7 @@ diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 92ee14b..c19efca 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -67,7 +67,7 @@ diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 2fe79a6..41c6ec3 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -67,7 +67,7 @@ diff --git a/docs/articles/cytominer-pipeline.html b/docs/articles/cytominer-pipeline.html index 087c219..202d21d 100644 --- a/docs/articles/cytominer-pipeline.html +++ b/docs/articles/cytominer-pipeline.html @@ -31,7 +31,7 @@ diff --git a/docs/articles/index.html b/docs/articles/index.html index 80fa2c3..8ea7680 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -67,7 +67,7 @@ diff --git a/docs/authors.html b/docs/authors.html index 9ae45d3..d2cea24 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -67,7 +67,7 @@ diff --git a/docs/index.html b/docs/index.html index fe003d3..017f6ec 100644 --- a/docs/index.html +++ b/docs/index.html @@ -38,7 +38,7 @@ diff --git a/docs/news/index.html b/docs/news/index.html index 07dd17b..bfd836d 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -67,7 +67,7 @@ @@ -122,6 +122,35 @@NEWS.md
+ This is a minor release but contains several new functions as well as a long-pending fix for incompatibility with the new (2018) tidyeval API.
+whiten()
(#103)extract_subpopulations()
(#107)sparse_random_projection()
(#117)svd_entropy()
(#123)covariance()
(#114)