neuprint_cosine_matrix | R Documentation |
Calculate a cosine similarity matrix for neuprint neurons
neuprint_cosine_matrix(
ids,
...,
threshold = 5,
partners = c("outputs", "inputs"),
group = FALSE,
groupfun = NULL,
details = NULL,
conn = NULL
)
ids |
Passed to |
... |
Optional filter expression defining which partners to include |
threshold |
An integer threshold (connections >= this will be returned) |
partners |
Whether to cluster based on connections to input or output partner neurons (default both). |
group |
Whether to group by cell |
groupfun |
A function which receives the metadata for all partner neurons and returns a single grouping vector (see the details section). |
details |
Optional character vector naming metadata columns to fetch for partner neurons. |
conn |
optional, a neuprintr connection object, which also specifies the
neuPrint server. If NULL, the defaults set in your
|
For most purposes you can use neuprint_cosine_plot
directly, but it can sometimes be useful to use
neuprint_cosine_matrix
to have more control over how partner neurons
are grouped (see e.g. groupfun
) or which partner neurons are
included in the results (.
The groupfun
argument can be a powerful way to construct flexible
grouping strategies for partner neurons. It was added in order to use
information present in fields such as the group, serial or instance/name
columns in the male VNC/CNS datasets. It will receive as input a dataframe
and expects to receive a single vector of length matching the number of
rows in the input dataframe. The input dataframe will contain the standard
columns returned by neuprint_connection_table
but you can
request extra columns if necessary by naming them in the group
argument.
matrix or list of two matrices (input and output)
neuprint_cosine_plot
# NB the second (unnamed argument) filters the partner neurons
# so that only those with type containing the regular expression ORN are used
neuprint_cosine_matrix("/DA[1-3].*PN", grepl("ORN",type), partners='in')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.