flywire_synapse_simplify: Collapse Buhmann predicted flywire synapses into smaller...

View source: R/flywire_synapses.R

flywire_synapse_simplifyR Documentation

Collapse Buhmann predicted flywire synapses into smaller units

Description

Many predicted Buhmann synapses may be located at one real synapse. Collapse Buhmann predicted flywire synapses into smaller units using a hierarchical clustering based on the Euclidean distances between predicted 'presynapses'.

Usage

flywire_synapse_simplify(
  x,
  method = c("cleft_scores", "scores", "mean"),
  collapse = TRUE,
  fast = TRUE
)

Arguments

x

a data.frame of synapses for FlyWire neurons, as generated by, for example, fafbseg::flywire_partners.

method

when synapses are collapsed, they are either represented by the predicted synapse amongst them with the best score, cleft_score or a mean of the meat data for each of these predicted synapses.

collapse

logical, whether or not to collapse synapses in the same cluster to a single synapse. If FALSE then cluster groupings are given in the returned data.frame.

fast

logical, whether or not to use fastcluster::hclust rather than stats::hclust to cluster synapses.

Value

a data.frame of collapsed synapses.

See Also

flywire_googledrive_data

Examples


## Not run: 
syns=fafbseg::flywire_partners("720575940621039145")
syns.simp = flywire_synapse_simplify(syns)

## End(Not run)

natverse/hemibrainr documentation built on Nov. 27, 2024, 9:01 p.m.