You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a not a fix. I didn't come up with a quick fix since the edges around the multiple-edge nodes are flowing in opposite directions. But at least this makes the graph acyclic (albeit not fully connected in LH) and good enough for me to do calyx operations. Most multiple edges are in LH, except 1 in mALT around StartPoint.
Just want to post it here in case there are other users.
library(igraph)
library(magrittr)
library(nat)
load("MyNeurons.rda")
n = MyNeurons[["TKA7R"]]
g = as.ngraph(n)
# return FALSE
is.dag(g)
# looks like it has multiple edges
multi = as.undirected(g, mode='each') %>%
which_multiple %>%
which %>%
print
# print the duplicate edges and delete the extra ones
exclude = c()
for (node in multi) {
inc = ego(g, order=2, nodes=node, mode='in')[[1]] %>% print
out = ego(g, order=2, nodes=node, mode='out')[[1]] %>% print
# certainly not a good logic, but length(inc) and length(out) won't be 2 at the same time,
# so should be fine here
if (length(inc)==2) eds = inc
if (length(out)==2) eds = out
exclude = c(exclude, paste(as_ids(eds), collapse="|"))
}
# Observed from the 3D skeleton that these 2 edges are needed to cut an internal loop
exclude = c(exclude, "745|746", "640|641")
dg = g - edges(exclude)
# This is the edge list necessary to turn the neurons into a dag
# "3|1" "486|485" "575|574" "685|684" "766|765" "822|821" "745|746" "640|641"
# return TRUE
is.dag(dg)
MyNeurons[["TKA7R"]] = as.neuron(as.ngraph(dg))
The text was updated successfully, but these errors were encountered:
This is a not a fix. I didn't come up with a quick fix since the edges around the multiple-edge nodes are flowing in opposite directions. But at least this makes the graph acyclic (albeit not fully connected in LH) and good enough for me to do calyx operations. Most multiple edges are in LH, except 1 in mALT around StartPoint.
Just want to post it here in case there are other users.
The text was updated successfully, but these errors were encountered: