This function is used to tabulate and compare different combinations of similarity threshold and method to calculate the noise threshold for a given expression matrix.

calculate_noise_threshold_method_statistics(
  expression,
  similarity.threshold.sequence = 0.25,
  method.chosen.sequence = noisyr::get_methods_calculate_noise_threshold(),
  dump.stats = NULL,
  ...
)

Arguments

expression

either an expression summary (as calculated by calculate_expression_similarity_counts or calculate_expression_similarity_transcript), which should be a list with 3 slots: expression.matrix, expression.levels, expression.levels.similarity; alternatively, just an expression matrix; only density based methods are available for the latter case

similarity.threshold.sequence

similarity (correlation or inverse distance) threshold(s) to be used to find corresponding noise threshold; can be a single value or a numeric vector; the default, 0.25 is usually suitable for the Pearson correlation (the default similarity measure)

method.chosen.sequence

methods to use to calculate the noise thresholds, must be a subset of get_methods_calculate_noise_threshold; defaults to all

dump.stats

name of csv to export different thresholds calculated (optional)

...

other arguments (for the boxplot methods) passed to calculate_noise_threshold

Value

A tibble containing information on noise thresholds calculated using the input similarity thresholds and methods (optionally written in a csv file). The columns list the chosen method and similarity threshold, the minimum, mean, coefficient of variation, and maximum of the noise thresholds, and all the noise thresholds concatenated as a string.

See also

Examples

expression.summary <- calculate_expression_similarity_counts( expression.matrix = matrix(1:100, ncol=5), method = "correlation_pearson", n.elements.per.window = 3)
#> The input matrix has 20 rows and 5 cols
#> number of genes: 20
#> number of samples: 5
#> the number of elements per window is 3
#> the step size is 1
#> the selected similarity metric is correlation_pearson
#> Working with sample 1
#> Working with sample 2
#> Working with sample 3
#> Working with sample 4
#> Working with sample 5
calculate_noise_threshold_method_statistics(expression.summary)
#> # A tibble: 10 x 8 #> approach method similarity.thres~ noise.threshold.~ noise.threshold.~ #> <chr> <chr> <dbl> <dbl> <dbl> #> 1 Density_b~ No_normalis~ 0.25 0 0 #> 2 Density_b~ RPM_normali~ 0.25 0 0 #> 3 Density_b~ Quantile_no~ 0.25 0 0 #> 4 Line_plot No_smoothing 0.25 2 42 #> 5 Line_plot loess10_smo~ 0.25 2 42 #> 6 Line_plot loess25_smo~ 0.25 2 42 #> 7 Line_plot loess50_smo~ 0.25 2 42 #> 8 Boxplot Median 0.25 1 1 #> 9 Boxplot IQR 0.25 1 1 #> 10 Boxplot Quant5 0.25 1 1 #> # ... with 3 more variables: noise.threshold.coefficient.of.variation <dbl>, #> # noise.threshold.max <dbl>, noise.thresholds.all <chr>