segmentgraph: Return a simplified segment graph for a neuron

View source: R/ngraph.R

segmentgraphR Documentation

Return a simplified segment graph for a neuron

Description

Return a simplified segment graph for a neuron

Usage

segmentgraph(
  x,
  weights = TRUE,
  segids = FALSE,
  exclude.isolated = FALSE,
  include.xyz = FALSE,
  reverse.edges = FALSE
)

Arguments

x

neuron

weights

Whether to include the original segment lengths as edge weights in the graph.

segids

Whether to include the integer segment ids as an edge attribute in the graph

exclude.isolated

Whether to eliminate isolated nodes

include.xyz

Whether to include 3D location as vertex attribute

reverse.edges

Whether to reverse the direction of each edge in the output graph to point towards (rather than away from) the root (default FALSE)

Details

The resultant graph will contain all branch and endpoints of the original neuron. This will be constructed from the SegList field, or where present, the SubTrees field (containing multiple SegLists for each isolated graph in the neuron). Each edge in the output graph will match one segment in the original SegList.

Value

igraph object containing only nodes of neuron keeping original labels (x$d$PointNo => V(g)$label) and vertex indices (1:nrow(x$d) => V(g)$vid).

Examples

sg=segmentgraph(Cell07PNs[[1]])
str(sg)
library(igraph)
plot(sg, edge.arrow.size=.4, vertex.size=10)

nat documentation built on May 29, 2024, 10:36 a.m.