From 48d9f86c47c28ceb9f0a2dcf7901b8fe79edd0e3 Mon Sep 17 00:00:00 2001 From: Dominik Krzeminski Date: Tue, 1 Jun 2021 12:43:05 +0100 Subject: [PATCH 1/4] [upd] so minor fix --- R/ngraph.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/ngraph.R b/R/ngraph.R index ccfbf97a..ca8ecbd4 100644 --- a/R/ngraph.R +++ b/R/ngraph.R @@ -394,6 +394,9 @@ strahler_order<-function(x){ roots=rootpoints(s, original.ids=FALSE) if(length(roots)>1) stop("strahler_order not yet defined for multiple subtrees") + # quick win for simplified neurons + if (summary(branchpoints)$branchpoints == 0) + return(rep(1, summary(nn)$nodes)) b=graph.bfs(s, root=roots, neimode = 'out', unreachable=F, father=T) From 0ce47cc3bad5a02f05757209b7e96bc5f83636e6 Mon Sep 17 00:00:00 2001 From: Dominik Krzeminski Date: Tue, 1 Jun 2021 12:44:13 +0100 Subject: [PATCH 2/4] [upd] so minor fix --- R/ngraph.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/ngraph.R b/R/ngraph.R index ca8ecbd4..2966f8f1 100644 --- a/R/ngraph.R +++ b/R/ngraph.R @@ -395,8 +395,8 @@ strahler_order<-function(x){ if(length(roots)>1) stop("strahler_order not yet defined for multiple subtrees") # quick win for simplified neurons - if (summary(branchpoints)$branchpoints == 0) - return(rep(1, summary(nn)$nodes)) + if (summary(x)$branchpoints == 0) + return(rep(1, summary(x)$nodes)) b=graph.bfs(s, root=roots, neimode = 'out', unreachable=F, father=T) From d4fb8e470d1c750eb00311a2ef49fa1b52dcc360 Mon Sep 17 00:00:00 2001 From: Dominik Krzeminski Date: Tue, 1 Jun 2021 12:50:08 +0100 Subject: [PATCH 3/4] [upd] so minor fix 2 --- R/ngraph.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/ngraph.R b/R/ngraph.R index 2966f8f1..928a3dd5 100644 --- a/R/ngraph.R +++ b/R/ngraph.R @@ -396,7 +396,8 @@ strahler_order<-function(x){ stop("strahler_order not yet defined for multiple subtrees") # quick win for simplified neurons if (summary(x)$branchpoints == 0) - return(rep(1, summary(x)$nodes)) + return(list(points=rep(1, summary(x)$nodes), + segments=rep(1, length(x$SegList)))) b=graph.bfs(s, root=roots, neimode = 'out', unreachable=F, father=T) From 0f5dfe35bd5134f32a0e639b2d02a478503da134 Mon Sep 17 00:00:00 2001 From: Dominik Krzeminski Date: Wed, 2 Jun 2021 09:52:11 +0100 Subject: [PATCH 4/4] [upd] strahleer_order handles simplified neurons now --- R/ngraph.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/ngraph.R b/R/ngraph.R index 928a3dd5..5e76ef60 100644 --- a/R/ngraph.R +++ b/R/ngraph.R @@ -394,9 +394,9 @@ strahler_order<-function(x){ roots=rootpoints(s, original.ids=FALSE) if(length(roots)>1) stop("strahler_order not yet defined for multiple subtrees") - # quick win for simplified neurons - if (summary(x)$branchpoints == 0) - return(list(points=rep(1, summary(x)$nodes), + # quick win for single branch neurons + if (length(x$BranchPoints) == 0) + return(list(points=rep(1, nrow(x$d)), segments=rep(1, length(x$SegList)))) b=graph.bfs(s, root=roots, neimode = 'out', unreachable=F, father=T)