Skip to content

Commit

Permalink
Fix an issue of rankNet when using 'sources.use' and 'target.use'
Browse files Browse the repository at this point in the history
  • Loading branch information
sqjin authored Apr 14, 2024
1 parent 8525f78 commit 11cea6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,6 @@ rankNet <- function(object, slot.name = "netP", measure = c("weight","count"), m
if (measure == "count") {
prob <- 1*(prob > 0)
}
prob.list[[i]] <- prob
if (!is.null(sources.use)) {
if (is.character(sources.use)) {
if (all(sources.use %in% dimnames(prob)[[1]])) {
Expand All @@ -1161,6 +1160,7 @@ rankNet <- function(object, slot.name = "netP", measure = c("weight","count"), m
if (sum(prob) == 0) {
stop("No inferred communications for the input!")
}
prob.list[[i]] <- prob
pSum.original[[i]] <- apply(prob, 3, sum)
if (measure == "weight") {
pSum[[i]] <- -1/log(pSum.original[[i]])
Expand Down

0 comments on commit 11cea6e

Please sign in to comment.