calculate group mean score using glm and order genes based on scores difference

top_markers_glm(
  data,
  label,
  n = 10,
  family = gaussian(),
  batch = NULL,
  scale = TRUE,
  use.mgm = TRUE,
  pooled.sd = FALSE,
  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

family

family for glm, details in stats::glm()

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()

pooled.sd

logical, if to use pooled SD for scaling

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_glm(data, label = rep(c("A", "B"), 5))
#> # A tibble: 20 × 3
#> # Groups:   .dot [2]
#>    .dot  Genes Scores
#>    <chr> <chr>  <dbl>
#>  1 A     X7    0.179 
#>  2 A     X4    0.167 
#>  3 A     X2    0.159 
#>  4 A     X8    0.111 
#>  5 A     X1    0.100 
#>  6 A     X5    0.0887
#>  7 A     X6    0.0629
#>  8 A     X3    0.0575
#>  9 A     X10   0.0384
#> 10 A     X9    0.0369
#> 11 B     X9    0.201 
#> 12 B     X10   0.194 
#> 13 B     X3    0.129 
#> 14 B     X6    0.118 
#> 15 B     X5    0.0838
#> 16 B     X1    0.0741
#> 17 B     X8    0.0668
#> 18 B     X2    0.0469
#> 19 B     X4    0.0446
#> 20 B     X7    0.0415