Learn R Programming

nat (version 1.0.1)

ngraph: ngraph: a graph to encode a neuron's connectivity

Description

ngraph: a graph to encode a neuron's connectivity

as.ngraph converts an object to an ngraph

as.ngraph.dataframe construct ngraph from a data.frame containing SWC format data

as.ngraph.neuron construct ngraph from a neuron

Usage

ngraph(el, vertexlabels, xyz = NULL, directed = TRUE,
  graph.attributes = NULL)

as.ngraph(x, ...)

## S3 method for class 'data.frame': as.ngraph(x, directed = TRUE, ...)

## S3 method for class 'neuron': as.ngraph(x, directed = TRUE, method = c("swc", "seglist"), ...)

Arguments

el
A two columm matrix (start, end) defining edges
vertexlabels
Integer labels for graph - the edge list is specified using these labels.
xyz
3D coordinates of vertices (optional, Nx3 matrix)
directed
Whether the resultant graph should be directed (default TRUE)
graph.attributes
List of named attributes to be added to the graph
x
Object to convert (see method descriptions)
...
Arguments passed to methods
method
Whether to use the swc data (x$d) or the seglist to define neuronal connectivity to generate graph.

Value

  • an igraph object with additional class ngraph, having a vertex for each entry in vertexlabels, each vertex having a label attribute. All vertices are included whether connected or not.

Details

We make the following assumptions about neurons coming in
  • They have an integer vertex label that need not start from 1 and that may have gaps
  • The edge list which defines connectivity specifies edges using pairs of vertex labels, _not_ raw vertex ids.

Note that this method always keeps the original vertex labels (a.k.a. PointNo) as read in from the original file.

See Also

igraph

Other neuron: as.neuron, as.neuron.data.frame, as.neuron.default, as.neuron.ngraph, is.neuron, neuron