Skip to content

Commit

Permalink
tweak docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeDMorgan committed Oct 16, 2024
1 parent a6b19d4 commit 2d97b68
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion R/plotNhoods.R
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,18 @@ plotNhoodGraphDA <- function(x, milo_res, alpha=0.05, res_column = "logFC", ...
g_atts <- names(vertex_attr(nhoodGraph(x)))
if(isFALSE(res_column %in% g_atts)){
message("Adding nhood effect sizes to neighbourhood graph attributes")
nhoodGraph(x) <- set_vertex_attr(nhoodGraph(x), name = res_column, value = signif_res[, res_column])

if(any(names(list(...)) %in% c("subset.nhoods"))){
nh.v <- V(nhoodGraph(x))
drop.v <- setdiff(nh.v, sub.indices)
nhgraph <- nhoodGraph(x)
nhgraph <- subgraph(nhgraph, sub.indices)
nhgraph <- set_vertex_attr(nhgraph,
name = res_column, value = signif_res[, res_column])
nhoodGraph(x) <- nhgraph
} else{
nhoodGraph(x) <- set_vertex_attr(nhoodGraph(x), name = res_column, value = signif_res[, res_column])
}
}

## Plot logFC
Expand Down

0 comments on commit 2d97b68

Please sign in to comment.