Calculate score for each feature in each cell

cal_score_init(
  expr,
  tf = c("logtf", "tf"),
  idf = "prob",
  iae = "prob",
  par.idf = NULL,
  par.iae = NULL,
  return.intermediate = FALSE
)

Arguments

expr

a count matrix, features in row and cells in column

tf

a character, specify the TF method to use, can be "tf" or "logtf"

idf

a character, specify the IDF method to use. Available methods can be accessed using idf_iae_methods()

iae

a character, specify the IAE method to use. Available methods can be accessed using idf_iae_methods()

par.idf

other parameters for specified IDF methods

par.iae

other parameters for specified IAE methods

return.intermediate

logical, if TRUE the returned list also contains the intermediate tf, idf and iae objects. Default FALSE keeps only the combined score to avoid the memory overhead of three extra feature-by-cell matrices on large inputs.

Value

a list always containing score; when return.intermediate = TRUE the list additionally contains tf, idf and iae.

Examples

data <- matrix(rpois(100, 2), 10, dimnames = list(1:10))
label <- sample(c("A", "B"), 10, replace = TRUE)
smartid:::cal_score_init(data,
  par.idf = list(label = label),
  par.iae = list(label = label)
)
#> $score
#>    [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> 1     0    0    0    0    0    0    0    0    0     0
#> 2     0    0    0    0    0    0    0    0    0     0
#> 3     0    0    0    0    0    0    0    0    0     0
#> 4     0    0    0    0    0    0    0    0    0     0
#> 5     0    0    0    0    0    0    0    0    0     0
#> 6     0    0    0    0    0    0    0    0    0     0
#> 7     0    0    0    0    0    0    0    0    0     0
#> 8     0    0    0    0    0    0    0    0    0     0
#> 9     0    0    0    0    0    0    0    0    0     0
#> 10    0    0    0    0    0    0    0    0    0     0
#>