Skip to contents

Low level access to the Flywire CAVE annotation system

Usage

flywire_cave_client(
  datastack_name = getOption("fafbseg.cave.datastack_name", "flywire_fafb_production")
)

Arguments

datastack_name

defaults to the value selected by choose_segmentation and to "flywire_fafb_production" when that is missing. See https://global.daf-apis.com/info/ for other options.

Value

The caveclient.frameworkclient.CAVEclientFull Python module wrapped by reticulate.

Details

This depends on installation of the Python caveclient library. See flywire_cave_query for more details.

Examples

# \donttest{
fac <- flywire_cave_client()
fac$annotation$get_tables()
#>  [1] "synapses_v2"                         
#>  [2] "synapses_v2_neuropil_v6"             
#>  [3] "fly_synapses_neuropil_v2"            
#>  [4] "synaptic_clefts"                     
#>  [5] "hierarchical_neuron_annotations"     
#>  [6] "fly_synapses_neuropil_v6"            
#>  [7] "neuron_information_v2"               
#>  [8] "cambridge_celltypes_v2"              
#>  [9] "fly_synapses_neuropil_v5"            
#> [10] "neuron_information_vtest"            
#> [11] "proofreading_status_public_v1"       
#> [12] "synapses_nt_v1"                      
#> [13] "fly_synapses_neuropil"               
#> [14] "proofreading_review_public_vtest"    
#> [15] "braincircuits_annotation_test"       
#> [16] "valid_synapses_nt_vtest"             
#> [17] "neuron_information_v1"               
#> [18] "nuclei_v1"                           
#> [19] "valid_synapses_nt_v2"                
#> [20] "valid_synapses_nt_v1"                
#> [21] "fly_synapses_neuropil_v4"            
#> [22] "hemilineages"                        
#> [23] "braincircuits_annotation_test2"      
#> [24] "hemibrain_matched_types"             
#> [25] "neuron_representative_coordinates_v1"
#> [26] "hierarchical_cell_types_v1"          
#> [27] "cambridge_celltypes"                 
#> [28] "fly_synapses_neuropil_v3"            
#> [29] "proofreading_review_public_v1"       
#> [30] "proofread_neurons"                   
fac$annotation$get_table_metadata('nuclei_v1')
#> $id
#> [1] 8
#> 
#> $schema_type
#> [1] "nucleus_detection"
#> 
#> $table_name
#> [1] "nuclei_v1__fly_v31"
#> 
#> $valid
#> [1] TRUE
#> 
#> $created
#> [1] "2021-08-13T18:01:55.211016"
#> 
#> $deleted
#> NULL
#> 
#> $user_id
#> [1] "2"
#> 
#> $description
#> [1] "\nFlyWire nucleus description\nNucleus version: 20210322\n\nNuclei in this table consist of center points (in nm), volume (in μm3), and bounding boxes (in nm).\n\nThe nucleus segmentation was generated by Shang Mu (smu@princeton.edu, Seung Lab at Princeton University) using a 2D convolutional neural network (CNN) and heuristic interpolations. The training data was assembled from annotations by Selden Koolman, Merlin Moore, Sarah Morejohn, Ben Silverman, Kyle Willie, Ryan Willie, Szi-chieh Yu and Shang Mu.\n\nAs this data was generated using a 2D, rather than 3D, neural network, defects are present in the detected nuclei, particularly where there are large defects in section alignment or a number of consecutive missing sections.\n\nFalse positive fragments, nucleus fragments and partial nuclei are the most common type of defects. A simple, rudimentary method for cleaning up is to disregard small fragments by thresholding by segment size or by the z-dimension of the bounding boxes. A size threshold of 2000 voxels (0.08 μm3) was already applied in producing this segmentation.\n\nA minimal number of nucleus merger instances have been observed, caused by section alignment defects or close nuclei appositions in certain non-neuronal cell clusters.\n\nWhen using the nucleus annotations, please acknowledge Shang Mu and let him know about your use case.\n\nWe encourage making (and using) improvements to this data based on the information provided (for example, utilizing bounding box dimensions and/or the segmentation to find and merge incorrectly split partial nuclei), and such improvements should be discussed with Shang. Data derived solely from this work should be similarly made available on this platform at the time of use in any publication.\n"
#> 
#> $notice_text
#> NULL
#> 
#> $reference_table
#> NULL
#> 
#> $flat_segmentation_source
#> [1] "precomputed://gs://neuroglancer/drosophila_v0/nucleus/v5_z_intp_intp/seg"
#> 
#> $write_permission
#> [1] "PRIVATE"
#> 
#> $read_permission
#> [1] "PUBLIC"
#> 
#> $last_modified
#> [1] "2022-10-25T19:49:21.621037"
#> 
#> $segmentation_source
#> [1] ""
#> 
#> $pcg_table_name
#> [1] "fly_v31"
#> 
#> $last_updated
#> [1] "2024-11-10T17:00:00.202814"
#> 
#> $annotation_table
#> [1] "nuclei_v1"
#> 
#> $voxel_resolution
#> [1] 1 1 1
#> 

# annotation tables that have been materialised in order to map XYZ
# points onto current root ids (and immutable supervoxel ids)
# typically the same as fac$annotation$get_tables()
fac$materialize$get_tables()
#>  [1] "synapses_v2_neuropil_v6"             
#>  [2] "fly_synapses_neuropil_v3"            
#>  [3] "proofreading_review_public_v1"       
#>  [4] "proofread_neurons"                   
#>  [5] "synapses_v2"                         
#>  [6] "fly_synapses_neuropil_v2"            
#>  [7] "synaptic_clefts"                     
#>  [8] "hierarchical_neuron_annotations"     
#>  [9] "fly_synapses_neuropil_v6"            
#> [10] "neuron_information_v2"               
#> [11] "cambridge_celltypes_v2"              
#> [12] "fly_synapses_neuropil_v5"            
#> [13] "neuron_information_vtest"            
#> [14] "proofreading_status_public_v1"       
#> [15] "synapses_nt_v1"                      
#> [16] "fly_synapses_neuropil"               
#> [17] "proofreading_review_public_vtest"    
#> [18] "braincircuits_annotation_test"       
#> [19] "valid_synapses_nt_vtest"             
#> [20] "nuclei_v1"                           
#> [21] "valid_synapses_nt_v2"                
#> [22] "valid_synapses_nt_v1"                
#> [23] "fly_synapses_neuropil_v4"            
#> [24] "hemilineages"                        
#> [25] "neuron_representative_coordinates_v1"
#> [26] "cambridge_celltypes"                 

info=fac$info$get_datastack_info()
# the default synapse table for the dataset
info$synapse_table
#> [1] "synapses_nt_v1"
# }

if (FALSE) { # \dontrun{
# get help on python cave client
reticulate::py_help(fac$info$get_datastack_info)
} # }