flywire_annotations_for_synapses: Generate a CSV of neuron synapses to import to a flywire...

View source: R/flywire_tracing.R

flywire_annotations_for_synapsesR Documentation

Generate a CSV of neuron synapses to import to a flywire annotation layer

Description

Generate a CSV of neuron synapses to import to a flywire annotation layer

Usage

flywire_annotations_for_synapses(
  fw.ids,
  direction = c("inputs", "outputs", "both"),
  partners = NULL,
  db = flywire_neurons(WithConnectors = TRUE),
  keep.dist.nm = 500,
  cleft_scores.thresh = 75,
  sample = 250,
  write.csv = TRUE,
  csv.path = getwd(),
  volume = NULL,
  ...
)

flywire_annotation_csv(
  xyz,
  write.csv = TRUE,
  csv.path = getwd(),
  description = "top_nt",
  csv.name = "flywire_points_annotations.csv"
)

flywire_verified_synapses(
  fw.ids,
  direction = c("inputs", "outputs", "both"),
  partners = NULL,
  csv.path = getwd(),
  csv.name = "annotations.csv",
  write.csv = TRUE
)

Arguments

fw.ids

character vector, a vector of valid flywire IDs

direction

whether to get presynapses, postsynapses or both.

partners

character vector else not used i NULL. A vector of valid flywire IDs for postsynaptic neurons to keep. Synapses to other postsynaptic targets are filtered out.

db

a neuronlist of flywire neurons with synapses attached

keep.dist.nm

numeric, minimum distance in nm that one synapse can be from another. One random synapse is chosen from groups of proximal synapses. To deactivate, enter NULL.

cleft_scores.thresh

numeric, cleft_score threshold for synapse inclusion

sample

numeric, the number of synapses to choose from both the dendrite and axon of each neuron in fw.ids

write.csv

logical, whether or not to write a .csv output file, ready for import into flywire for each neuron. They will be named using the pattern "flywire_<fw.id>_synapse_annotations.csv" and written to csv.path.

csv.path

Output path for CSV files (defaults to current working directory)

volume

if NLLL there is no subsetting. If a mesh3d object, only points inside this volume are chosen.

...

further arguments passed to fafbseg::flywire_partners, when db is NULL.

xyz

a data.frame of xyz coordinates in flywire voxel space -to write as a flywire annotation .csv file. Can contains other columns.

description

the column in xyz to use for the Description field of the final .csv.

csv.name

the name of the .csv file to be saved

Examples

## Not run: 
csv = flywire_annotations_for_synapses(fw.id = "720575940616046363",
direction = "inputs",
partners = c("720575940628113292",
"720575940610903062",
"720575940611661805",
"720575940628115084",
"720575940612337575",
"720575940618976297",
"720575940619059497",
"720575940616852894",
"720575940629359076",
"720575940632437856",
"720575940624804248",
"720575940613725708"),
db = NULL, keep.dist.nm = NULL, cleft_scores.thresh = 0, sample = NULL)

## End(Not run)

natverse/hemibrainr documentation built on Nov. 27, 2024, 9:01 p.m.