Affinity propagation clustering of FlyCircuit neurons

apclusterfc(gns, p = 0, ...,
  scoremat = getOption("flycircuit.scoremat"), FUN = NULL,
  maxneurons = 4000)

Arguments

gns

flycircuit identifiers (passed to fc_gene_name).

p

input preference (default 0).

...

additional parameters passed to apcluster.

scoremat

name of a file backed matrix containing raw scores.

FUN

an (optional) function to apply to the mean normalised scores returned by fc_subscoremat. Default NULL.

maxneurons

error out if we have more than this many neurons.

Value

An object of class APResult.

Details

Given a vector of gene_names/neuron names or neuronids use apcluster to carry out a hierarchical clustering. The default value of FUN will handle square distance matrices and R.

The default input preference of 0 has been chosen because an nblast2 score greater than 0 indicates that pair of neurons show some similarity.

Note that the distance matrix will be converted to a similarity matrix before use with apcluster by calculating 1-d.

maxneurons of 4000 has been chosen to prevent inadvertent clustering of huge numbers of neurons. 4000 is reasonable on a decent laptop.

See also

Examples

# NOT RUN {
apres <- apclusterfc(names(kcs20))

# Plot cluster exemplars
plot3d(apres, db=kcs20)

# compare affinity propagation clusters with manually defined types
apdf=as.data.frame(apres)
type_comparison=cbind(apdf['cluster'], kcs20[apdf$item,'type', drop=F])
table(type_comparison$cluster, type_comparison$type)

# Interactively step through clusters, with the examplar plotted in black
clear3d()
plot3d(apres, db=kcs20, plot='bycluster')
# }