
Evaluate Cell-Type Deconvolution & Mixture Proportion Accuracy
Source:R/05_metrics_de_signal.R
calc_deconvolution_accuracy.RdEvaluates the accuracy of cell-type mixture proportion estimation / deconvolution methods between empirical reference and simulated cell populations (Chen et al., Bioinformatics 2021). Can accept precomputed proportion matrices OR cell-type vectors (and optional batch labels) to calculate proportion preservation across batches.
Usage
calc_deconvolution_accuracy(
true_proportions,
estimated_proportions,
batch_ref = NULL,
batch_sim = NULL
)Arguments
- true_proportions
Vector, matrix, or data.frame of reference cell-type proportions, or factor/vector of reference cell types.
- estimated_proportions
Vector, matrix, or data.frame of estimated / simulated cell-type proportions, or factor/vector of simulated cell types.
- batch_ref
Optional batch labels for reference cells (if true_proportions is a cell-type vector).
- batch_sim
Optional batch labels for simulated cells (if estimated_proportions is a cell-type vector).
Value
A list containing RMSE, MAE, Pearson correlation (r), Spearman correlation (rho), Jensen-Shannon Divergence (JSD), and Total Variation Distance (TVD).
Examples
data(example_scrna, package = "scSimEval")
calc_deconvolution_accuracy(example_scrna$ref, example_scrna$sim)
#> $deconvolution_rmse
#> [1] 0.01868796
#>
#> $deconvolution_mae
#> [1] 0.01333451
#>
#> $deconvolution_r
#> [1] 0.0225748
#>
#> $deconvolution_rho
#> [1] 0.02467383
#>
#> $deconvolution_jsd
#> [1] 0.3451674
#>
#> $deconvolution_tvd
#> [1] 0.5333803
#>
#> $sample_metrics
#> sample RMSE MAE Pearson_r Spearman_rho JSD TVD
#> 1 1 0.01879750 0.01313975 0.1990686095 0.0729599044 0.3096732 0.5255900
#> 2 2 0.01658911 0.01141375 0.0965188163 0.2472511630 0.2660463 0.4565500
#> 3 3 0.01908942 0.01307759 0.2009057841 0.1574202759 0.3209800 0.5231034
#> 4 4 0.01874845 0.01314248 0.0496287530 0.1964213242 0.3048037 0.5256992
#> 5 5 0.01879367 0.01360639 -0.1374603342 -0.1134687776 0.3459419 0.5442555
#> 6 6 0.01532453 0.01159813 0.2085828418 0.0787555585 0.2678479 0.4639254
#> 7 7 0.01377306 0.01049634 0.1706351997 0.1079372673 0.2399387 0.4198536
#> 8 8 0.01783403 0.01203226 -0.0559373758 0.0848391785 0.3020314 0.4812904
#> 9 9 0.01846004 0.01371598 0.0004621975 0.0344965758 0.3285293 0.5486393
#> 10 10 0.01654460 0.01261199 -0.0023548383 0.0247508599 0.2943519 0.5044798
#> 11 11 0.01933433 0.01422145 -0.0777891668 -0.0671560459 0.3340153 0.5688578
#> 12 12 0.02081813 0.01490608 -0.0987608718 -0.0497237976 0.3811025 0.5962434
#> 13 13 0.02004619 0.01211902 0.3145586011 0.3666397918 0.2955088 0.4847608
#> 14 14 0.02117231 0.01564485 -0.2198887377 -0.2894593593 0.4752018 0.6257941
#> 15 15 0.01752348 0.01228308 0.0715132295 0.1608141131 0.2878008 0.4913232
#> 16 16 0.01682886 0.01187238 -0.0061919261 0.0379708408 0.2855904 0.4748951
#> 17 17 0.01827977 0.01331404 0.0174091686 0.0468113646 0.3643439 0.5325616
#> 18 18 0.02069226 0.01408437 0.0193610221 0.1245271362 0.4043886 0.5633748
#> 19 19 0.02007644 0.01410003 0.0156715120 0.0814210648 0.3771235 0.5640010
#> 20 20 0.02084445 0.01583545 -0.2155624541 -0.2236393801 0.4315021 0.6334181
#> 21 21 0.01970461 0.01379832 0.1499209903 0.0873517725 0.3733791 0.5519326
#> 22 22 0.01876264 0.01406767 0.1087219512 0.0020755370 0.3946819 0.5627068
#> 23 23 0.01831942 0.01389127 -0.0256580654 0.0037051002 0.4014243 0.5556509
#> 24 24 0.01791208 0.01334817 0.0605909529 -0.0525019352 0.3307381 0.5339268
#> 25 25 0.01720825 0.01194280 0.0096315878 0.2160703815 0.2756634 0.4777120
#> 26 26 0.01779221 0.01276278 0.0922009192 0.1447002819 0.2751496 0.5105112
#> 27 27 0.01991231 0.01370069 0.0153997355 -0.0482956997 0.3750396 0.5480274
#> 28 28 0.02526773 0.01566469 -0.0798761310 -0.0859736026 0.4669307 0.6265876
#> 29 29 0.01612380 0.01217564 0.0242796106 0.0424636826 0.2785823 0.4870256
#> 30 30 0.01690323 0.01305108 0.0431890022 0.0302055565 0.3458534 0.5220432
#> 31 31 0.01962895 0.01397388 -0.0038408724 -0.0291843009 0.3690616 0.5589552
#> 32 32 0.01695899 0.01246094 0.0437180232 -0.0578645137 0.3055669 0.4984377
#> 33 33 0.01762494 0.01252998 -0.0404333684 0.0314239844 0.3080915 0.5011992
#> 34 34 0.02082979 0.01416453 0.0045679162 -0.0060025616 0.3878664 0.5665811
#> 35 35 0.01752584 0.01327023 0.1041401991 -0.0524833078 0.3440001 0.5308093
#> 36 36 0.02101002 0.01519686 0.0379270269 -0.0145938085 0.4352848 0.6078746
#> 37 37 0.01642962 0.01282458 0.0750016421 0.0562597653 0.3184961 0.5129832
#> 38 38 0.01836207 0.01384981 0.0141534942 -0.0233685695 0.3550222 0.5539926
#> 39 39 0.01957461 0.01325438 0.1380781643 0.1654615964 0.3732562 0.5301753
#> 40 40 0.01750330 0.01294600 -0.0077376676 -0.0616838068 0.3439855 0.5178399
#> 41 41 0.01685183 0.01216085 0.1275248543 0.0763696877 0.3164669 0.4864341
#> 42 42 0.01610217 0.01278602 -0.0038275607 -0.0288117294 0.3267968 0.5114408
#> 43 43 0.01826180 0.01308741 -0.0310144912 -0.0656507611 0.3387998 0.5234962
#> 44 44 0.02218710 0.01501348 0.0001677415 -0.0270627515 0.4276119 0.6005391
#> 45 45 0.01770235 0.01238732 0.1539246205 0.1425048968 0.3340062 0.4954926
#> 46 46 0.02318706 0.01610188 -0.1521560799 -0.0452150555 0.4415693 0.6440750
#> 47 47 0.01699360 0.01285401 0.1228120516 0.0578535439 0.3418060 0.5141605
#> 48 48 0.01710130 0.01317600 -0.0246831058 -0.1301783920 0.3250787 0.5270402
#> 49 49 0.02106753 0.01418410 -0.1248645021 -0.0327041392 0.4120814 0.5673639
#> 50 50 0.01661947 0.01189755 0.0402865415 0.1574041704 0.2691726 0.4759019
#> 51 51 0.01780454 0.01221097 0.1496021504 0.1169289139 0.2931541 0.4884388
#> 52 52 0.01829974 0.01350711 0.0900858709 0.0871254704 0.3407031 0.5402846
#> 53 53 0.01695661 0.01290305 -0.0063975535 0.0164402824 0.3145068 0.5161218
#> 54 54 0.01749580 0.01290788 -0.0220320414 -0.0869117832 0.3197937 0.5163154
#> 55 55 0.02092086 0.01392512 -0.0094984976 -0.0218238811 0.3616976 0.5570049
#> 56 56 0.01701629 0.01253156 -0.0240626750 -0.0174291465 0.3336154 0.5012622
#> 57 57 0.02125670 0.01380575 -0.1178589155 -0.0539826895 0.3696033 0.5522301
#> 58 58 0.01777139 0.01282716 -0.0588632769 0.0004933698 0.3468587 0.5130866
#> 59 59 0.02023905 0.01543336 -0.0042033028 -0.0449833568 0.4658437 0.6173345
#> 60 60 0.01811303 0.01428009 -0.0647991787 -0.0472712688 0.3560808 0.5712037
#>