read.neuron {nat}R Documentation

Read a single neuron from a file

Description

Read a single neuron from a file

Usage

read.neuron(f, format = NULL, class = c("neuron", "ngraph"), ...)

Arguments

f

Path to file. This can be a URL, in which case the file is downloaded to a temporary location before reading.

format

The file format of the neuron. When format=NULL, the default, read.neuron will infer the file format from the extension or file header (aka magic) using the fileformats registry.

class

The class of the returned object - presently either "neuron" or "ngraph"

...

additional arguments passed to format-specific readers

Details

This function will handle neuron and dotprops objects saved in R .rds or .rda format by default. Additional file formats can be registered using fileformats.

At the moment the following formats are supported using file readers already included with the nat package:

References

Schmitt, S. and Evers, J. F. and Duch, C. and Scholz, M. and Obermayer, K. (2004). New methods for the computer-assisted 3-D reconstruction of neurons from confocal image stacks. Neuroimage 4, 1283–98. doi:10.1016/j.neuroimage.2004.06.047

See Also

write.neuron, read.neurons, fileformats

Examples

## Not run: 
# note that we override the default NeuronName field
n=read.neuron(system.file("tests/testthat/testdata","neuron","EBT7R.CNG.swc",package='nat'),
  NeuronName="EBT7R")
# use a function to set the NeuronName field
n3=read.neuron(system.file("tests/testthat/testdata","neuron","EBT7R.CNG.swc",package='nat'),
  NeuronName=function(x) sub("\\..*","",x))
# show the currently registered file formats that we can read
fileformats(class='neuron', read=TRUE)

## End(Not run)

[Package nat version 1.8.24 Index]