Skip to contents

Package Help

fafbseg fafbseg-package
fafbseg: Support Functions for Analysis of FAFB EM Segmentation
dr_fafbseg()
Print information about fafbseg setup including tokens and python modules
choose_segmentation() with_segmentation()
Choose or (temporarily) use a FAFB autosegmentation
simple_python()
Simple Python installation for use with R/fafbseg/FlyWire

Released FlyWire data

Functions for interacting with the public release data of the FlyWire whole brain connectome. There are many other useful support / lower level functions but these are probably the key ones for interacting with release data.

download_flywire_release_data()
Download FlyWire connectivity and annotations from public release
flywire_partner_summary2()
Rapid flywire connectivity summaries using cached connectome data
flywire_adjacency_matrix2()
Fast adjacency matrices based on flywire connectome dumps
flywire_ids()
Flexible specification of flywire ids (including from flytable types)
add_celltype_info() flytable_meta()
Fetch flytable cell type information to a dataframe with flywire ids
flywire_sirepo_file() flywire_sirepo_file_memo()
Read or return path to FlyWire annotations manuscript supplementary file

Neuroglancer URLs

Support for generating/parsing Neuroglancer URLs and interconversion of with FAFB CATMAID URLs and https://flywire.ai

open_fafb_ngl()
Construct Neuroglancer URL based on 3D location data
ngl_encode_url() as.character(<ngscene>)
Encode scene information into a neuroglancer URL
ngl_decode_scene()
Decode and manipulate Neuroglancer scenes (from URLs or JSON blocks)
ngl_segments() `ngl_segments<-`()
Helper function to turn diverse inputs into neuroglancer segment ids
ngl_layers() `ngl_layers<-`() `+`(<ngscene>) `-`(<ngscene>)
Extract and manipulate layers in a neuroglancer scene
ngl_add_colours()
Add colours to the neuroglancer scene
ngl_blank_scene()
Return a blank neuroglancer scene based on a specified segmentation
flywire_shortenurl() flywire_expandurl()
Shorten or expand neuroglancer URLs
flywire_scene()
Return a sample Neuroglancer scene URL for FlyWire dataset
ngl_annotations()
Extract annotations from a neuroglancer scene into a dataframe
ngl_annotation_layers()
Construct one or more neuroglancer annotation layers
xform(<ngscene>)
Add a transformation to one or more layers in a neuroglancer scene
voxdims(<ngscene>)
Extract voxel dimensions from a neuroglancer scene

FlyWire Neurons

Functions for working with neuron ids, coordinate transforms and low level functions to talk to a graphene (FlyWire) server.

chunkedgraph_token() flywire_set_token()
Record (and if necessary create) a FlyWire chunkedgraph token
flywire2fafb() fafb2flywire()
Map points between FlyWire v1 and FAFB14 space (xyz nm)
flywire_voxdims() flywire_nm2raw() flywire_raw2nm()
Handle raw and nm calibrated flywire coordinates
flywire_xyz2id()
Find FlyWire root or supervoxel (leaf) ids for XYZ locations
flywire_rootid()
Find the root_id of a FlyWire segment / supervoxel.
flywire_latestid()
Find the most up to date FlyWire rootid for one or more input rootids
flywire_islatest()
Check that one or more FlyWire root ids have not been further edited
flywire_last_modified()
Check when a root id was last edited
flywire_updateids()
Update flywire root ids to any timestamp using XYZ position or supervoxel ids
flywire_leaves()
Find all the supervoxel (leaf) ids that are part of a FlyWire object
flywire_change_log()
Summarise edits for one or more FlyWire segment ids
flywire_fetch()
GET/POST from flywire (graphene) servers with appropriate authorisation token
flywire_cloudvolume()
Low level access to FlyWire data via Python cloudvolume module
flywire_l2ids()
Return level 2 supervoxel ids for neurons

FlyWire Synapses

Functions for working with predicted synapses/neurotransmitters for FlyWire neurons

flywire_partners() flywire_partner_summary()
Find the input/output partners for a flywire neuron
flywire_adjacency_matrix()
Fetch the synaptic adjacency matrix for a set of flywire neurons
flywire_ntpred() print(<ntprediction>)
Return raw neurotransmitter prediction results for output of flywire neuron
flywire_ntplot() flywire_ntplot3d()
Plot neurotransmitter prediction summaries or synapses in 3D
flywire_dcvs()
Get predicted dense core vesicle locations in the flywire dataset
flywire_neurons_add_synapses() flywire_synapse_annotations()
Attach synapses to flywire neuron skeletons
braincircuits_register() braincircuits_login() braincircuits_token()
Create and log into a braincircuits account
flywire_connectome_data() flywire_connectome_data_version()
Access precomputed flywire connectivity data

FlyWire Annotations

Functions for working with FlyWire’s own Connectome Annotation Versioning Engine which is the backend handling all annotations including synapses for FlyWire and other projects. Alternatively we have our own more flexible flytable system.

flywire_cave_client()
Low level access to the Flywire CAVE annotation system
flywire_cave_query()
Query the FlyWire CAVE annotation system
flywire_timestamp()
Find standard UTC timestamp for flywire materialisation version or timestamp
flywire_user_info()
Fetch information for one or more users
flywire_nuclei() flywire_nearest_nuclei()
Queries for information about flywire nuclei (helpful for finding somata)
flytable_login() flytable_set_token() flytable_base() flytable_alltables() flytable_columns()
Low level functions to access the flytable metadata service
flytable_list_rows() flytable_query()
Flytable database queries
flytable_update_rows() flytable_append_rows() flytable_nrow()
Update or append rows in a flytable database
flytable_list_selected()
List selected rows from flytable
tabify_coords()
Convert coordinates to tab separated values. Useful for copy/paste to Seatable
flytable_cell_types()
Fetch (memoised) flywire cell type information from flytable
flytable_set_celltype()
Set the flytable cell type and other columns for a set of root ids
fct2nginfo()
Convert flytable cell type information into a neuroglancer info file
write_nginfo()
Read and write neuroglancer annotation info json files

FlyWire Meshes and Skeletons

Functions for working with FlyWire neurons as meshes or skeletons

save_cloudvolume_meshes() read_cloudvolume_meshes()
Read meshes from chunked graph (graphene) server via CloudVolume
read_l2skel() read_l2dp()
Read L2 skeleton or dotprops for FlyWire data sources using fafbseg-py
meshparty_skeletonize()
Skeletonize neurons using meshparty python library
skeletor() reroot_hairball() download_neuron_obj()
Skeletonise neuron meshes using skeletor
fafb14_to_flywire_ids()
Get flywire IDs that map onto CATMAID neurons

Neuroglancer - CATMAID interconversion

High level approach to converting URLs, neurons etc to representations based on Neuroglancer / brainmaps data

catmaid2ngl()
Convert CATMAID things (eg neurons) into Neuroglancer equivalents

FAFB FFN1 segmentation skeletons

Read FAFB FFN1 segmentation skeletons (Peter Li, Google) from packaged zip files or over the web via brainmaps API.

read_segments() read_segments2()
Read skeletons for segments by extracting from the corresponding zip file(s)
read.neuron.brainmaps() read.neurons.brainmaps()
Read skeleton(s) from brainmaps API into a nat::neuron object
read_topn() find_topn()
Find and read the largest n segments from one or more skeleton zip files
skelsforsegment()
Find all skeleton fragments for one segment
swc2segmentid() segmentid2zip() zip2segmentstem()
Convert between filenames and neuroglancer ids

FAFB-FFN1 segmentation agglomeration (merge) information

These functions provide support for loading/using information from the agglomeration runs that identify candidate merge locations between indiviual raw segment objects. Some of these merge groups can contain hundreds or even thousands of segments. Most of the time you will only need find_merged_segments().

find_merged_segments()
Find all merged segment ids for a given starting google segment id
read_mergeinfo()
Read CSV files containing raw agglomeration (merge) information
make_merge_graph() merge_graph_components()
Graph representation of the agglomeration (merge) between raw segments
find_merged_segments_slow()
Find all merged segment ids for a given starting google segment id

Brainmaps API

Authentication and queries to the Google brainmaps API (what Neuroglancer talks to under the hood to get image data, segmentation etc).

brainmaps_auth()
Generate a token to enable access to brainmaps API
brainmaps_fetch() brainmaps_clear_cache()
GET/POST from brainmaps API with optional retry / cache
brainmaps_xyz2id()
Convert 3D x,y,z locations in brainmaps volumes to segmentation ids
brainmaps_listfragments()
Low level call to brainmaps API to list mesh fragment ids for segment ids
brainmaps_skeleton()
Low level function to fetch skeleton from brainmaps API
read_brainmaps_meshes()
Read 3D meshes via the brainmaps API
brainmaps_volume()
Extract brainmaps volume identifier

Low level support for Neuroglancer segment meshes

Functions for loading/processing/visualising 3D mesh (wireframe) information displayed in Neuroglancer. These are low level functions for working with raw Neuroglancer data. End users may be interested in compare_ng_neuron but otherwise are unlikely to use these.

compare_ng_neuron()
Compare a neuroglancer mesh object with a regular neuron
fetch_all_curl()
Fetch data specified by a set of curl shell commands (e.g. from Chrome)
read_ng_dump()
Read neuroglancer data dump from disk / web
read_ng_raw()
Read raw neuroglancer data - currently only supports mesh format
as.mesh3d(<ng_raw>) as.mesh3d(<ng_raw_list>)
Convert a raw neuroglancer mesh into a mesh3d object
xyzmatrix(<ng_raw>) xyzmatrix(<ng_raw_list>)
Extract the XYZ coordinates from neuroglancer mesh objects