View source: R/hemibrain_reroot.R
remove_bad_synapses | R Documentation |
With the hemibrain projects somas and their tracts were not separately and explicitly detected. Some false synapse assignment has happened, adding synapses to soma and primary neurite locations, that should not exist based on an examination of the greyscale EM data. This function removes 'out-of-mesh' synapses, you might want to use all ROIs or the hemibrain mesh to remove these 'bad' synapses. In addition, synapses are removed if they are too near the soma / along the primary neurite.
remove_bad_synapses(
x,
meshes = NULL,
soma = TRUE,
min.nodes.from.soma = 100,
min.nodes.from.pnt = 5,
primary.branchpoint = 0.25,
method = c("unsplit", "split"),
wipe = TRUE,
...
)
x |
a |
meshes |
a list/a single object of class |
soma |
logical, if TRUE it is assumed that the neuron being given has the soma as its route and an intact primary neurite tract. Synapses will then be pruned from both. |
min.nodes.from.soma |
the minimum number of nodes (geodesic distance) a
synapse can be from the soma. Synapses closes than this will be removed.
For comparable results across neurons, recommended to use
|
min.nodes.from.pnt |
the minimum number of nodes (geodesic distance) a synapse can be from a point along the primary neurite. Synapses closes than this will be removed. |
primary.branchpoint |
the proportion of the maximum branchpoint score
needed for a point to be assigned as the primary branchpoint. Used only
when |
method |
whether to estimate the primary neurite tract ('unsplit') or use the results from flow_centrality. |
wipe |
logical, whether or not to remove previous flags left on synapses by this function. |
... |
methods sent to |
a nat::neuronlist
or nat::neuron
object
hemibrain_reroot
# Read in a problematic neuron
neuron = neuprint_read_neurons(5813020793)
## Not run:
library(nat)
plot3d(neuron)
points3d(xyzmatrix(neuron[[1]]$connectors))
## End(Not run)
# remove any synapses outside of this surface (or on the cell body fibre)
neuron.fixed = remove_bad_synapses(neuron, meshes=hemibrain.surf)
## Not run:
# previously we used all the individual hemibrain meshes. This may produce
# slightly different results but using *hemibrain.surf* is much faster
neuron.fixed = remove_bad_synapses(neuron, meshes=hemibrain_roi_meshes())
## End(Not run)
## Not run:
library(nat)
# Let's check that this worked
plot3d(neuron.fixed)
points3d(xyzmatrix(neuron.fixed[[1]]$connectors), size = 5, col = "green")
## End(Not run)
## Not run:
# Now an example with flywire neurons.
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.