add_celltype_info: Fetch flytable cell type information to a dataframe with...

View source: R/flytable.R

add_celltype_infoR Documentation

Fetch flytable cell type information to a dataframe with flywire ids

Description

add_celltype_info will add information to an existing dataframe.

flytable_meta will fetch a data.frame of metadata from flytable for a given set of identifiers.

Usage

add_celltype_info(
  x,
  idcol = NULL,
  version = NULL,
  suffix = NULL,
  table = c("both", "info", "optic"),
  ...
)

flytable_meta(
  ids = NULL,
  version = NULL,
  table = c("both", "info", "optic"),
  unique = FALSE,
  ...
)

Arguments

x

a data.frame containing root ids or a neuronlist ()

idcol

Optional character vector specifying the column containing ids of the neurons for which cell type information should be provided.

version

Optional numeric CAVE version (see flywire_cave_query). The special signalling value of TRUE uses the current default data dump as returned by flywire_connectome_data_version.

suffix

A character suffix for the new columns (default value of NULL implies no suffix).

table

Which cell type information tables to use (info for brain, optic for optic lobes or both).

...

additional arguments passed to flytable_cell_types

ids

Flywire identifiers/query in any form understood by flywire_ids

unique

Whether to ensure that rows contain only unique identifiers. Default FALSE. When TRUE duplicate rows will be returned with a warning.

Details

the root ids must be in a column called one of "pre_id", "post_id", "root_id", "post_pt_root_id", "pre_pt_root_id". If you do not have exactly one of these columns present then you must specify your preferred column with the idcol argument.

Value

a data.frame with extra columns

See Also

flytable_cell_types

Examples


kcin=flywire_partner_summary("720575940626474889", partners = 'in',
  cleft.threshold = 50)
kcin
kcin2=add_celltype_info(kcin)
kcin2
library(dplyr)
kcin2 %>%
  group_by(cell_type) %>%
  summarise(wt = sum(weight),n=n()) %>%
  arrange(desc(wt))
kcin2 %>%
  count(cell_class, wt = weight)


## Not run: 
# read neuronlist containing "dotprops" for some olfactory projection neurons
da2=read_l2dps('DA2')
# add cell type details to that
da2=add_celltype_info(da2)

## End(Not run)

flytable_meta("class:MBON")
flytable_meta("type:MBON2%")
# the / introduces a regex query (small performance penalty, more flexible)
flytable_meta("/type:MBON2[0-5]")


natverse/fafbseg documentation built on Sept. 8, 2024, 5:43 p.m.