determine_bin_cutoff: Determine a threshold for selecting bins of features based on...

Description Usage Arguments Details Value See Also Examples

View source: R/determine_bin_cutoff.R

Description

Takes the output of get_mean_median and decide until which window to keep based on background level and a threshold.

Usage

1
2
3
determine_bin_cutoff(metric_table, threshold = 2,
  selected_metric = c("mean", "median", "score"),
  random_function_summarisation = mean)

Arguments

metric_table

A data frame, usually the output of get_mean_median.

threshold

How many time higher than the background should the last bin be? Default to 2.

selected_metric

Which metric to use (i.e. which column from metric_table to work with). Default to mean.

random_function_summarisation

A function used to aggregate the randomised control across bin. Default to mean.

Details

Background level is estimated by averaging correlation coefficient obtained from the top window randomisations.

Bins (or windows) of features are kept until the mean (or median) correlation coefficient falls under a threshold value threshold x background level.

Value

A number, the first bin of features to discard.

See Also

get_mean_median, plot_metric

Examples

1
2
3
4
5
6
myData <- tibble::tibble(
    bin = rep(c(1, 2, 3), each = 3),
    window = rep(c("top_window", "shuffled_top_window_1", "shuffled_top_window_2"), 3),
    mean = c(0.8, 0.1, 0.11, 0.14, 0.12, 0.09, 0.10, 0.13, 0.08)
)
determine_bin_cutoff(myData)

scFeatureFilter documentation built on Nov. 8, 2020, 7:49 p.m.