Skip to content

Commit

Permalink
Prepare for release (#138)
Browse files Browse the repository at this point in the history
* Update version, fix errors on windows

* News

* rebuild website

* Updated cran-comments

* Post submission

* Update

* Update version because cran comments were wrong

* Clarify

* Update
  • Loading branch information
shntnu authored Mar 20, 2020
1 parent 3ab20fb commit 475eeb9
Show file tree
Hide file tree
Showing 35 changed files with 115 additions and 53 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
^docs$
^LICENSE.md$
^CONTRIBUTING.md$
^CRAN-RELEASE$
2 changes: 2 additions & 0 deletions CRAN-RELEASE
Original file line number Diff line number Diff line change
@@ -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).
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]", role = "aut"),
person("Allen", "Goodman", email = "[email protected]", role = "aut"),
person("Claire", "McQuin", email = "[email protected]", role = "aut"),
Expand Down
14 changes: 14 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
5 changes: 5 additions & 0 deletions R/replicate_correlation.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ replicate_correlation <-
.strata <- rlang::syms(strata)
}

result <-
foreach::foreach(variable = variables, .combine = rbind) %dopar%
{
sample %>%
Expand All @@ -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
}
41 changes: 22 additions & 19 deletions R/svd_entropy.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
}

17 changes: 12 additions & 5 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/cytominer-pipeline.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 31 additions & 1 deletion docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/aggregate.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/correlation_threshold.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/count_na_rows.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/covariance.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/drop_na_columns.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/drop_na_rows.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/extract_subpopulations.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/generalized_log.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/generate_component_matrix.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/normalize.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/replicate_correlation.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/sparse_random_projection.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/svd_entropy.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/transform.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 475eeb9

Please sign in to comment.