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

top_markers_glm(
  data,
  label,
  n = 10,
  family = gaussian(),
  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()

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     X6    0.252 
#>  2 A     X5    0.137 
#>  3 A     X2    0.116 
#>  4 A     X10   0.111 
#>  5 A     X8    0.105 
#>  6 A     X1    0.0939
#>  7 A     X7    0.0666
#>  8 A     X3    0.0453
#>  9 A     X9    0.0382
#> 10 A     X4    0.0353
#> 11 B     X4    0.201 
#> 12 B     X9    0.186 
#> 13 B     X3    0.157 
#> 14 B     X7    0.107 
#> 15 B     X1    0.0757
#> 16 B     X8    0.0675
#> 17 B     X10   0.0643
#> 18 B     X2    0.0610
#> 19 B     X5    0.0520
#> 20 B     X6    0.0283