compute TF (term/feature frequency), IDF (inverse document/cell frequency), IAE (inverse average expression of features) and combine the the final score
cal_score(
data,
tf = c("logtf", "tf"),
idf = "prob",
iae = "prob",
slot = "counts",
new.slot = "score",
par.idf = NULL,
par.iae = NULL
)
# S4 method for class 'AnyMatrix'
cal_score(
data,
tf = c("logtf", "tf"),
idf = "prob",
iae = "prob",
par.idf = NULL,
par.iae = NULL
)
# S4 method for class 'SummarizedExperiment'
cal_score(
data,
tf = c("logtf", "tf"),
idf = "prob",
iae = "prob",
slot = "counts",
new.slot = "score",
par.idf = NULL,
par.iae = NULL
)an expression object, can be matrix or SummarizedExperiment
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()
a character, specify which slot to use when data is se object, optional, default 'counts'
a character, specify the name of slot to save score in se object, optional, default 'score'
other parameters for specified IDF methods
other parameters for specified IAE methods
A list of matrices or se object containing combined score
data <- matrix(rpois(100, 2), 10, dimnames = list(1:10))
cal_score(
data,
par.idf = list(label = sample(c("A", "B"), 10, replace = TRUE)),
par.iae = list(label = sample(c("A", "B"), 10, replace = TRUE))
)
#> $score
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7]
#> 1 0.03555433 0.00000000 0.06027762 0.02006606 0.05802131 0.02579872 0.03555433
#> 2 0.02499215 0.03361014 0.02266750 0.04239873 0.07118866 0.05419123 0.02499215
#> 3 0.00000000 0.05067647 0.15691490 0.06392766 0.00000000 0.08170807 0.05786661
#> 4 0.03316612 0.04339864 0.08401588 0.05474678 0.15728761 0.10224446 0.01699760
#> 5 0.07905196 0.03644158 0.00000000 0.06753852 0.06862084 0.03019427 0.18452892
#> 6 0.03500818 0.00000000 0.04153034 0.09349667 0.20663120 0.07418647 0.06830878
#> 7 0.12184689 0.02300790 0.04454123 0.01482751 0.09175342 0.00000000 0.08318166
#> 8 0.11256531 0.44511307 0.19466347 0.06480233 0.01272246 0.08331565 0.03938317
#> 9 0.11511103 0.02779684 0.00000000 0.05151691 0.08666342 0.06548760 0.06029911
#> 10 0.03229887 0.12224146 0.02929459 0.05479445 0.02766444 0.03598997 0.03229887
#> [,8] [,9] [,10]
#> 1 0.00000000 0.02894580 0.06559501
#> 2 0.06505173 0.04512607 0.11824044
#> 3 0.03988300 0.04494137 0.07659344
#> 4 0.00000000 0.13327131 0.06169001
#> 5 0.05448442 0.04416477 0.05268263
#> 6 0.09112232 0.07006230 0.12278569
#> 7 0.16134360 0.11950488 0.00000000
#> 8 0.05296359 0.00000000 0.02822365
#> 9 0.08043760 0.50523378 0.14394317
#> 10 0.08407030 0.03441099 0.09016453
#>
#> $tf
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7]
#> 1 0.10003336 0.00000000 0.13347190 0.04443201 0.07693142 0.05712575 0.10003336
#> 2 0.05126699 0.06894529 0.04649838 0.08697351 0.07693142 0.11116375 0.05126699
#> 3 0.00000000 0.06894529 0.21348256 0.08697351 0.00000000 0.11116375 0.10003336
#> 4 0.10003336 0.06894529 0.13347190 0.08697351 0.11328584 0.16243074 0.05126699
#> 5 0.10003336 0.06894529 0.00000000 0.12777885 0.11328584 0.05712575 0.23350525
#> 6 0.05126699 0.00000000 0.09093039 0.20471027 0.21503399 0.16243074 0.10003336
#> 7 0.14653174 0.06894529 0.13347190 0.04443201 0.18225491 0.00000000 0.10003336
#> 8 0.14653174 0.30519380 0.13347190 0.04443201 0.03920533 0.05712575 0.05126699
#> 9 0.19096375 0.06894529 0.00000000 0.12777885 0.07693142 0.16243074 0.10003336
#> 10 0.05126699 0.19403005 0.04649838 0.08697351 0.03920533 0.05712575 0.05126699
#> [,8] [,9] [,10]
#> 1 0.00000000 0.04876637 0.08697351
#> 2 0.13344217 0.04876637 0.12777885
#> 3 0.06894529 0.09526475 0.12777885
#> 4 0.00000000 0.18223826 0.04443201
#> 5 0.06894529 0.04876637 0.08697351
#> 6 0.13344217 0.04876637 0.12777885
#> 7 0.19403005 0.09526475 0.00000000
#> 8 0.06894529 0.00000000 0.08697351
#> 9 0.13344217 0.29997502 0.12777885
#> 10 0.13344217 0.04876637 0.12777885
#>
#> $idf
#> A B B B B B A
#> 1 0.5158132 0.6554068 0.6554068 0.6554068 0.6554068 0.6554068 0.5158132
#> 2 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472
#> 3 0.5158132 0.6554068 0.6554068 0.6554068 0.6554068 0.6554068 0.5158132
#> 4 0.4462871 0.8472979 0.8472979 0.8472979 0.8472979 0.8472979 0.4462871
#> 5 0.7884574 0.5273549 0.5273549 0.5273549 0.5273549 0.5273549 0.7884574
#> 6 0.7884574 0.5273549 0.5273549 0.5273549 0.5273549 0.5273549 0.7884574
#> 7 0.9162907 0.3677248 0.3677248 0.3677248 0.3677248 0.3677248 0.9162907
#> 8 0.4462871 0.8472979 0.8472979 0.8472979 0.8472979 0.8472979 0.4462871
#> 9 0.7884574 0.5273549 0.5273549 0.5273549 0.5273549 0.5273549 0.7884574
#> 10 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472
#> A A B
#> 1 0.5158132 0.5158132 0.6554068
#> 2 0.6931472 0.6931472 0.6931472
#> 3 0.5158132 0.5158132 0.6554068
#> 4 0.4462871 0.4462871 0.8472979
#> 5 0.7884574 0.7884574 0.5273549
#> 6 0.7884574 0.7884574 0.5273549
#> 7 0.9162907 0.9162907 0.3677248
#> 8 0.4462871 0.4462871 0.8472979
#> 9 0.7884574 0.7884574 0.5273549
#> 10 0.6931472 0.6931472 0.6931472
#>
#> $iae
#> A A A A B A A
#> 1 0.6890572 0.6890572 0.6890572 0.6890572 1.1507283 0.6890572 0.6890572
#> 2 0.7032995 0.7032995 0.7032995 0.7032995 1.3350011 0.7032995 0.7032995
#> 3 1.1214781 1.1214781 1.1214781 1.1214781 0.9145799 1.1214781 1.1214781
#> 4 0.7429087 0.7429087 0.7429087 0.7429087 1.6386371 0.7429087 0.7429087
#> 5 1.0022812 1.0022812 1.0022812 1.0022812 1.1486227 1.0022812 1.0022812
#> 6 0.8660710 0.8660710 0.8660710 0.8660710 1.8221569 0.8660710 0.8660710
#> 7 0.9075059 0.9075059 0.9075059 0.9075059 1.3690526 0.9075059 0.9075059
#> 8 1.7213078 1.7213078 1.7213078 1.7213078 0.3829923 1.7213078 1.7213078
#> 9 0.7645182 0.7645182 0.7645182 0.7645182 2.1361369 0.7645182 0.7645182
#> 10 0.9089167 0.9089167 0.9089167 0.9089167 1.0180083 0.9089167 0.9089167
#> A B B
#> 1 0.6890572 1.1507283 1.1507283
#> 2 0.7032995 1.3350011 1.3350011
#> 3 1.1214781 0.9145799 0.9145799
#> 4 0.7429087 1.6386371 1.6386371
#> 5 1.0022812 1.1486227 1.1486227
#> 6 0.8660710 1.8221569 1.8221569
#> 7 0.9075059 1.3690526 1.3690526
#> 8 1.7213078 0.3829923 0.3829923
#> 9 0.7645182 2.1361369 2.1361369
#> 10 0.9089167 1.0180083 1.0180083
#>