scale and transform score and output top markers for groups

top_markers(
  data,
  label,
  n = 10,
  use.glm = TRUE,
  scale = TRUE,
  use.mgm = TRUE,
  softmax = TRUE,
  slot = "score",
  ...
)

# S4 method for AnyMatrix
top_markers(
  data,
  label,
  n = 10,
  use.glm = TRUE,
  scale = TRUE,
  use.mgm = TRUE,
  softmax = TRUE,
  slot = "score",
  ...
)

# S4 method for SummarizedExperiment
top_markers(
  data,
  label,
  n = 10,
  use.glm = TRUE,
  scale = TRUE,
  use.mgm = TRUE,
  softmax = TRUE,
  slot = "score",
  ...
)

Arguments

data

an expression object, can be matrix or SummarizedExperiment

label

a vector of group label

n

integer, number of returned top genes for each group

use.glm

logical, if to use stats::glm() to compute group mean score, if TRUE, also compute mean score difference as output

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

slot

a character, specify which slot to use when data is se object, optional, default 'score'

...

params for top_markers_abs() or top_markers_glm()

Value

A tibble with top n feature names, group labels and ordered scores

Examples

data <- matrix(rgamma(100, 2), 10, dimnames = list(1:10))
top_markers(data, label = rep(c("A", "B"), 5))
#> # A tibble: 20 × 3
#> # Groups:   .dot [2]
#>    .dot  Genes Scores
#>    <chr> <chr>  <dbl>
#>  1 A     X4    0.200 
#>  2 A     X3    0.183 
#>  3 A     X7    0.163 
#>  4 A     X2    0.156 
#>  5 A     X1    0.0692
#>  6 A     X10   0.0632
#>  7 A     X8    0.0594
#>  8 A     X9    0.0588
#>  9 A     X6    0.0294
#> 10 A     X5    0.0182
#> 11 B     X5    0.312 
#> 12 B     X6    0.193 
#> 13 B     X9    0.0965
#> 14 B     X8    0.0955
#> 15 B     X10   0.0899
#> 16 B     X1    0.0821
#> 17 B     X2    0.0364
#> 18 B     X7    0.0348
#> 19 B     X3    0.0311
#> 20 B     X4    0.0284