sample_connections: Randomly sample synapses or connections of a neuron

Description Usage Arguments Value

View source: R/random_sampling.R


Assemble a data frame/csv for random sampling of a neuron's synapses or connections. The units sampled can be outgoing connections ("downstream), incoming connections ("upstream"), or outgoing synapses (connectors in CATMAID). Optionally, the sample can be limited to a certain number of connections or synapses, or constrained to the section of a neuron either within a neuropil or up-/downstream of a particular node.


sample_connections(neuron, number = NULL, type = c("downstream", "upstream",
  "connector"), fileout = NULL, = NULL,
  node.direction = c("downstream", "upstream"), volume = NULL,
  plot = FALSE)



Required; a CATMAID neuron object.


Optional; the number of units (connections or synapses) to return. Will return all if not specified.


The type of unit to sample. Options are "downstream" (samples outgoing connections), "upstream" (samples incoming connections), and "connector" (samples outgoing synapses). Defaults to "downstream".


Optional; the path to a CSV file where the result should be written.

Optional; the id of a treenode where the neuron should be cut, if limiting sample to up-/downstream portion of the neuron.


If is specfied, the section of cut neuron to retain. Options are "downstream" (i.e. distal to the cut point) or "upstream" (proximal to the cut point). Defaults to "downstream".


Optional; the name of a neuropil (in the FAFB brain, see that the sample should be constrained to.


Optional; whether or not to generate a 3D plot of the neuron highlighting the portion retained and which connectors are included in the sample. Defaults to FALSE.


A data frame containing the randomised connections or synapses, with a column of URLs to the items in CATMAID. Additional columns in the data frame will vary by type, but will include further information about the units sampled (e.g. CATMAID IDs, coordinates, etc.). If fileout is specified, this data frame will also be written to a CSV.

fmlove/tracerutils documentation built on Oct. 22, 2018, 1:09 p.m.