Learn R Programming

nat (version 1.0.1)

neuron: neuron: class to represent traced neurons

Description

neuron makes a neuron object from appropriate variables.

is.neuron will check if an object looks like a neuron.

as.neuron will convert a suitable object to a neuron

as.neuron.data.frame expects a block of SWC format data

as.neuron.ngraph converts a graph (typically an ngraph object) to a neuron

as.neuron.default will add class "neuron" to a neuron-like object.

Usage

neuron(d, NumPoints = nrow(d), StartPoint, BranchPoints = integer(),
  EndPoints, SegList, SubTrees = NULL, InputFileName = NULL,
  NeuronName = NULL, ..., MD5 = TRUE)

is.neuron(x, Strict = FALSE)

as.neuron(x, ...)

## S3 method for class 'data.frame': as.neuron(x, ...)

## S3 method for class 'ngraph': as.neuron(x, vertexData = NULL, origin = NULL, Verbose = FALSE, ...)

## S3 method for class 'default': as.neuron(x, ...)

Arguments

d
matrix of vertices and associated data in SWC format
NumPoints
Number of points in master subtree
StartPoint,BranchPoints,EndPoints
Nodes of the neuron
SegList
List where each element contains the vertex indices for a single segments of the neuron, starting at root.
SubTrees
List of SegLists where a neuron has multiple unconnected trees (e.g. because the soma is not part of the graph, or because the neuronal arbour has been cut.)
...
Additional fields to be included in neuron. Note that if these include CreatedAt, NodeName, InputFileStat or InputFileMD5, they will override fields of that name that are calculated automatically.
InputFileName
Character vector with path to input file
NeuronName
Character vector containing name of neuron
MD5
Logical indicating whether to calculate MD5 hash of input
x
A neuron or other object to test/convert
Strict
Whether to check class of neuron or use a more relaxed definition based on object being a list with a SegList component.
vertexData
A dataframe with SWC fields especially X,Y,Z,W,PointNo, Parent.
origin
Root vertex, matched against labels (aka PointNo) when available (see details)
Verbose
Whether to be verbose (default: FALSE)

Value

  • A list with elements: (NumPoints,StartPoint,BranchPoints,EndPoints,nTrees,NumSegs,SegList, [SubTrees]) NB SubTrees will only be present when nTrees>1.

Details

neuron objects consist of a list containing multiple fields describing the 3D location and connectivity of points in a traced neuron. The critical fields of a neuron, n, are n$d which contains a dataframe in SWC format and n$SegList which contains a representation of the neuron's topology used for most internal calculations. For historical reasons, n$SegList is limited to a single fully-connected tree. If the tree contains multiple unconnected subtrees, then these are stored in n$SubTrees and nTrees will be >1; the "master" subtree (typically the one with the most points) will then be stored in n$SegList and n$NumPoints will refer to the number of points in that subtree, not the whole neuron.

StartPoint,BranchPoints,EndPoints are indices matching the rows of the vertices in d not arbitrary point numbers typically encoded in d$PointNo.

Columns will be ordered c('PointNo','Label','X','Y','Z','W','Parent')

Uses a depth first search on the tree to reorder using the given origin.

See Also

neuronlist

graph.dfs, as.seglist

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