Skip to content

Commit

Permalink
fix bug from igraph changes in dfs order
Browse files Browse the repository at this point in the history
* looks like it now returns 0 rather than NA for unreachables
  • Loading branch information
jefferis committed Apr 18, 2024
1 parent 0519743 commit 5ca4f7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/info.R
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ neuprint_ROI_hierarchy <- function(root=NULL, rval=c("edgelist","graph"),
if(!is.null(root)) {
if(isFALSE(root%in%names(igraph::V(g))))
stop("Requested root does not seem to be a valid node of ROI hierarchy!")
selnodes=na.omit(igraph::dfs(g, root, unreachable = F)$order)
ord=igraph::dfs(g, root, unreachable = F)$order
selnodes=na.omit(ord[ord>0])
g <- igraph::induced_subgraph(g, selnodes)
el <- as.data.frame(igraph::as_edgelist(g), stringsAsFactors=FALSE)
colnames(el)=colnames(roi.edgelist)
Expand Down

0 comments on commit 5ca4f7b

Please sign in to comment.