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

Update modeling.R #203

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/modeling.R
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ computeCommunProbPathway <- function(object = NULL, net = NULL, pairLR.use = NUL
group <- factor(pairLR.use$pathway_name, levels = pathways)
prob.pathways <- aperm(apply(prob, c(1, 2), by, group, sum), c(2, 3, 1))
pathways.sig <- pathways[apply(prob.pathways, 3, sum) != 0]
prob.pathways.sig <- prob.pathways[,,pathways.sig]
prob.pathways.sig <- prob.pathways[,,pathways.sig, drop=FALSE]
idx <- sort(apply(prob.pathways.sig, 3, sum), decreasing=TRUE, index.return = TRUE)$ix
pathways.sig <- pathways.sig[idx]
prob.pathways.sig <- prob.pathways.sig[, , idx]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also change line 381 prob.pathways.sig <- prob.pathways.sig[, , idx] to prob.pathways.sig <- prob.pathways.sig[, , idx, drop=FALSE]

Expand Down