scale and transform score and output top markers for groups

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

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

# S4 method for class 'SummarizedExperiment'
top_markers(
  data,
  label,
  n = 10,
  use.glm = TRUE,
  batch = NULL,
  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

batch

a vector of batch labels, default NULL

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     X3    0.267 
#>  2 A     X7    0.132 
#>  3 A     X6    0.103 
#>  4 A     X4    0.0973
#>  5 A     X5    0.0963
#>  6 A     X8    0.0882
#>  7 A     X10   0.0603
#>  8 A     X2    0.0574
#>  9 A     X9    0.0525
#> 10 A     X1    0.0455
#> 11 B     X1    0.172 
#> 12 B     X9    0.149 
#> 13 B     X2    0.136 
#> 14 B     X10   0.129 
#> 15 B     X8    0.0886
#> 16 B     X5    0.0811
#> 17 B     X4    0.0803
#> 18 B     X6    0.0755
#> 19 B     X7    0.0593
#> 20 B     X3    0.0292