Skip to contents

Fetch metadata for neurons from connectome datasets

Usage

cf_meta(
  ids,
  bind.rows = TRUE,
  integer64 = FALSE,
  keep.all = FALSE,
  use_superclass = getOption("coconatfly.use_superclass", FALSE),
  harmonise_class = getOption("coconatfly.harmonise_class", FALSE),
  MoreArgs = list(flywire = list(type = c("cell_type", "hemibrain_type")))
)

Arguments

ids

A list of ids named by the relevant datasets (see examples) or any other input that can be processed by the keys function (including a hclust dendrogram object.)

bind.rows

Whether to bind data.frames for each dataset together, keeping only the common columns (default TRUE for convenience but note that some columns will be dropped by unless keep.all=TRUE).

integer64

Whether ids should be character vectors (default) or 64 bit ints (more compact but a little fragile as they rely on the bit64 extension package.)

keep.all

Whether to keep all columns when processing multiple datasets rather than just those in common (default=FALSE only keeps shared columns).

use_superclass

If TRUE, rename class/subclass/subsubclass columns to superclass/class/subclass. Can also be set via the coconatfly.use_superclass option.

harmonise_class

If TRUE, harmonise class values to malecns style across all datasets. Can also be set via the coconatfly.harmonise_class option.

MoreArgs

A named list of arguments to be passed when fetching metadata for a given function. See details.

Details

The returned data frame includes these standard columns:

  • id, key: neuron identifiers (key is unique across datasets)

  • class, subclass, type: cell class hierarchy (harmonised to malecns style across datasets)

  • instance: summarises properties of individual neurons

  • side: normalised to L/R/M (left/right/midline) or NA

  • sex: M or F, from dataset registration

  • tissue: brain, vnc, or cns depending on dataset

  • group: numeric, defines related neurons within dataset

  • dataset: source dataset name

MoreArgs is structured as a list with a top layer naming datasets (using the same long names as cf_datasets). The second (lower) layer names the arguments that will be passed to dataset-specific functions.

See also

Examples

# \donttest{
da2meta=cf_meta(cf_ids(hemibrain='DA2_lPN'))
da2meta
#>           id pre post upstream downstream status    statusLabel    voxels
#> 1 1796817841 396  509      509       3275 Traced Roughly traced 726508881
#> 2 1796818119 511  818      818       4111 Traced Roughly traced 917547898
#> 3 1797505019 345  476      476       2932 Traced Roughly traced 450568345
#> 4 1827516355 391  548      548       3263 Traced Roughly traced 741928779
#> 5  818983130 409  562      562       3400 Traced Roughly traced 612641685
#>   cropped  instance    type lineage notes  soma side class subclass subsubclass
#> 1   FALSE DA2_lPN_R DA2_lPN   AVM02  <NA>  TRUE    R  <NA>     <NA>        <NA>
#> 2   FALSE DA2_lPN_R DA2_lPN   AVM02  <NA>  TRUE    R  <NA>     <NA>        <NA>
#> 3   FALSE DA2_lPN_R DA2_lPN   AVM02  <NA> FALSE    R  <NA>     <NA>        <NA>
#> 4   FALSE DA2_lPN_R DA2_lPN   AVM02  <NA>  TRUE    R  <NA>     <NA>        <NA>
#> 5   FALSE DA2_lPN_R DA2_lPN   AVM02  <NA> FALSE    R  <NA>     <NA>        <NA>
#>   group tissue sex   dataset           key
#> 1  <NA>  brain   F hemibrain hb:1796817841
#> 2  <NA>  brain   F hemibrain hb:1796818119
#> 3  <NA>  brain   F hemibrain hb:1797505019
#> 4  <NA>  brain   F hemibrain hb:1827516355
#> 5  <NA>  brain   F hemibrain  hb:818983130
# / introduces a regular expression
mbonmeta=cf_meta(cf_ids(hemibrain='/MBON.+'))
# }