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
)a count matrix, features in row and cells in column
a character, specify the TF method to use, can be "tf" or "logtf"
a character, specify the IDF method to use. Available methods can
be accessed using idf_iae_methods()
a character, specify the IAE method to use. Available methods can
be accessed using idf_iae_methods()
other parameters for specified IDF methods
other parameters for specified IAE methods
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.
a list always containing score; when return.intermediate = TRUE
the list additionally contains tf, idf and iae.
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
#>