Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Probabilities not adjusted when computing centrality on "netP" #701

Open
ycl6 opened this issue Sep 28, 2023 · 0 comments
Open

Probabilities not adjusted when computing centrality on "netP" #701

ycl6 opened this issue Sep 28, 2023 · 0 comments

Comments

@ycl6
Copy link

ycl6 commented Sep 28, 2023

Based on the current netAnalysis_computeCentrality function, the prob values are adjusted if pval did not meet the thresh, i.e. set to 0 in L206.

CellChat/R/analysis.R

Lines 201 to 208 in 418b660

netAnalysis_computeCentrality <- function(object = NULL, slot.name = "netP", net = NULL, net.name = NULL, thresh = 0.05) {
if (is.null(net)) {
prob <- methods::slot(object, slot.name)$prob
pval <- methods::slot(object, slot.name)$pval
pval[prob == 0] <- 1
prob[pval >= thresh] <- 0
net = prob
}

However, pval is only provided and stored in net when running the computeCommunProb function.
The computeCommunProbPathway function only provides prob and not pval. Therefore methods::slot(object, "netP")$pval is NULL. The probabilities is not adjusted when slot.name = "netP".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant