calculate group median, MAD or mean score and order genes based on scores

top_markers_abs(
  data,
  label,
  n = 10,
  pooled.sd = FALSE,
  method = c("median", "mad", "mean"),
  scale = TRUE,
  use.mgm = TRUE,
  softmax = TRUE,
  tau = 1
)

Arguments

data

matrix, features in row and samples in column

label

a vector of group label

n

integer, number of returned top genes for each group

pooled.sd

logical, if to use pooled SD for scaling

method

character, specify metric to compute, can be one of "median", "mad", "mean"

scale

logical, if to scale data by row

use.mgm

logical, if to scale data using scale_mgm()

softmax

logical, if to apply softmax transformation on output

tau

numeric, hyper parameter for softmax

Value

a tibble with feature names, group labels and ordered processed scores

Examples

data <- matrix(rgamma(100, 2), 10, dimnames = list(1:10))
top_markers_abs(data, label = rep(c("A", "B"), 5))
#> # A tibble: 20 × 3
#> # Groups:   .dot [2]
#>    .dot  Genes Scores
#>    <chr> <chr>  <dbl>
#>  1 A     8     0.282 
#>  2 A     4     0.101 
#>  3 A     3     0.0979
#>  4 A     7     0.0835
#>  5 A     5     0.0795
#>  6 A     10    0.0778
#>  7 A     2     0.0745
#>  8 A     1     0.0729
#>  9 A     9     0.0664
#> 10 A     6     0.0643
#> 11 B     1     0.151 
#> 12 B     9     0.137 
#> 13 B     4     0.123 
#> 14 B     3     0.119 
#> 15 B     6     0.0977
#> 16 B     5     0.0911
#> 17 B     10    0.0862
#> 18 B     7     0.0848
#> 19 B     2     0.0647
#> 20 B     8     0.0462