Skip to content

Commit ed8b38f

Browse files
committed
add same corr_type for scatter and benchmark
1 parent 58991ae commit ed8b38f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/cell_deconvolution.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,7 +2082,7 @@ compute.benchmark = function(deconvolution, groundtruth, cells_extra = NULL, cor
20822082
deconvolution_combinations = gsub("(BPRNACan3DProMet|BPRNACanProMet|BPRNACan)", "\\1_", deconvolution_combinations)
20832083

20842084
###Correlation function
2085-
corr_bench <- function(data, corr = "spearman", pval = 0.05) {
2085+
corr_bench <- function(data, corr, pval = 0.05) {
20862086
M <- Hmisc::rcorr(as.matrix(data), type = corr)
20872087

20882088
# Only keep the three matrix elements: r, P, n
@@ -2105,11 +2105,11 @@ compute.benchmark = function(deconvolution, groundtruth, cells_extra = NULL, cor
21052105
}
21062106

21072107
#####Scatter plot function
2108-
scatter_plots = function(deconv, ground, method){
2108+
scatter_plots = function(deconv, ground, corr_method){
21092109
for (i in 1:ncol(deconv)) {
21102110
data = cbind(deconv[,i], ground)
21112111
colnames(data) = c("x", "y")
2112-
cor_test <- stats::cor.test(data$x, data$y)
2112+
cor_test <- stats::cor.test(data$x, data$y, method = corr_method)
21132113
cor_value <- cor_test$estimate # Correlation coefficient
21142114
p_value <- cor_test$p.value # p-value
21152115

0 commit comments

Comments
 (0)