Skip to content

Commit

Permalink
changed name for new option, because its by scores, not just correlation
Browse files Browse the repository at this point in the history
  • Loading branch information
rmflight committed Jul 13, 2023
1 parent 0ad9c37 commit a5e2e71
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vsualizationQualityControl 0.4.11

* Added a new argument `only_low` to `determine_outliers` to only look at the low end of the score distribution for outliers, as sometimes `boxplot.stats` will pick up outliers at the high end as well.
* Added a new argument `only_high` to `determine_outliers` to only look at the high end of the score distribution for outliers, as sometimes `boxplot.stats` will pick up outliers at the low end as well.

# visualizationQualityControl 0.4.10

Expand Down
6 changes: 3 additions & 3 deletions R/correlations.R
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ outlier_fraction <- function(data, sample_classes = NULL, n_trim = 3,
#' @param outlier_fraction outlier fractions
#' @param cor_weight how much weight for the correlation score?
#' @param frac_weight how much weight for the outlier fraction?
#' @param only_low should only things at the low end of score be removed?
#' @param only_high should only things at the low end of score be removed?
#'
#' @details For outlier sample detection, one should
#' first generate median correlations using
Expand All @@ -827,7 +827,7 @@ outlier_fraction <- function(data, sample_classes = NULL, n_trim = 3,
#' @export
#' @return data.frame
determine_outliers = function(median_correlations = NULL, outlier_fraction = NULL,
cor_weight = 1, frac_weight = 1, only_low = TRUE){
cor_weight = 1, frac_weight = 1, only_high = TRUE){

if (!is.null(median_correlations) && !is.null(outlier_fraction)) {
full_data = dplyr::left_join(median_correlations, outlier_fraction, by = "sample_id", suffix = c(".cor", ".frac"))
Expand Down Expand Up @@ -867,7 +867,7 @@ determine_outliers = function(median_correlations = NULL, outlier_fraction = NUL
full_data$outlier = FALSE
full_data$outlier[full_data$sample_id %in% all_out] = TRUE

if (only_low) {
if (only_high) {
split_data = split(full_data, full_data$sample_class)
full_data = purrr::map(split_data, \(in_data){
mean_score = mean(in_data$score)
Expand Down
2 changes: 1 addition & 1 deletion docs/articles/quality_control.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/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ pkgdown_sha: ~
articles:
pca_testing: pca_testing.html
quality_control: quality_control.html
last_built: 2023-07-13T00:03Z
last_built: 2023-07-13T01:05Z

4 changes: 2 additions & 2 deletions docs/reference/determine_outliers.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/search.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions man/determine_outliers.Rd

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

0 comments on commit a5e2e71

Please sign in to comment.