Skip to contents

Rapid flywire connectivity summaries using cached connectome data

Usage

flywire_partner_summary2(
  ids,
  partners = c("outputs", "inputs"),
  add_cell_types = TRUE,
  by.roi = FALSE,
  summarise = FALSE,
  threshold = 0,
  version = NULL
)

Arguments

ids

Root ids to query (passed to flywire_ids)

partners

Whether to fetch input or output synapses or both.

add_cell_types

Whether to add cell type information to the result

by.roi

Whether to break the connectivity down into rows for each neuropil region containing synapses.

summarise

Whether to collapse down the results for multiple query neurons into a single entry for each partner neuron.

threshold

For flywire_partner_summary only return partners with greater than this number of connections to the query neuron(s) (default of 0 returns all connections)

version

Optional CAVE version. The default value of NULL uses the latest data dump available unless options(fafbseg.flywire_connectome_data_version) has been set (which you can conveniently do using flywire_connectome_data_version()).

Value

A data.frame

Details

Note that the threshold is applied to each row left after any grouping operations. Therefore when by.roi=TRUE only neuropil regions exceeding this threshold will be returned.

CAVE specifies versions (effectively timestamps) for the connectome data. Every so often Sven makes a dump of the connectivity and synapse information for all proofread neurons. In order to use the data

Examples

if (FALSE) { # \dontrun{
flywire_partner_summary2('DA2_lPN', partners='out')
flywire_partner_summary2('DA2_lPN', partners='out', summarise=T)
flywire_partner_summary2('DA2_lPN', partners='out', summarise=T, by.roi=T)

flywire_partner_summary2('DA2_lPN', partners='out', summarise=T,
  by.roi=T, add_cell_types=F) %>%
  filter(!grepl("AL", neuropil)) %>%
  group_by(post_pt_root_id) %>%
  summarise(weight = sum(weight), top_np = neuropil[1]) %>%
  arrange(desc(weight)) %>%
  # nb version = TRUE will use ensure that ids match the default CAVE version
  add_celltype_info(version=TRUE)
} # }