husk: Husk data.

View source: R/husk.R

huskR Documentation

Husk data.

Description

husk detects unwanted variation in the sample and removes it from the population.

Usage

husk(
  population,
  variables,
  sample,
  remove_outliers = TRUE,
  epsilon = 1e-06,
  remove_signal = TRUE,
  flatten_noise = TRUE
)

Arguments

population

tbl with grouping (metadata) and observation variables.

variables

character vector specifying observation variables.

sample

tbl containing sample that is used by the method to estimate husking parameters. sample has same structure as population. Typically, sample corresponds to controls in the experiment.

remove_outliers

optional boolean specifying whether to remove outliers. Default is TRUE.

epsilon

optional parameter used in husking to offset eigenvalues to avoid division by zero. Default is 1.

remove_signal

optional boolean specifying whether to husk the signal instead of only scaling it down. Default is TRUE.

flatten_noise

optional boolean specifying whether to flatten the noise instead of scaling it up. Default is TRUE. The parameter is ignored if remove_signal is FALSE.

Value

transformed data of the same class as population.

Examples

population <- tibble::tibble(
  Metadata_pert_name = c(NA, NA, NA, NA),
  Metadata_Well = c("A01", "A02", "B01", "B02"),
  Intensity_DNA = c(10, 20, 12, 32),
  Granularity_DNA = c(22, 20, NA, 32),
  Texture_DNA = c(5, 2, 43, 13)
)
variables <- c("Intensity_DNA", "Texture_DNA")
husk(population, variables, population, epsilon = 1, remove_signal = TRUE)
husk(population, variables, population, epsilon = 1e-5, remove_signal = TRUE)
husk(population, variables, population, epsilon = 1, remove_signal = FALSE)
husk(population, variables, population, epsilon = 1e-5, remove_signal = FALSE)

CellProfiler/cytominr documentation built on July 2, 2023, 6:19 p.m.