These functions can help you either go to or read the right tab (flywire_tracing_sheet) on a large google sheet, or read the whole sheet and all of its tabs ((flywire_tracing_sheets), note, memoised for 30 minutes). You can also see if a flywire neuron of interest in in a google sheet (flywire_in(fw.meta = flywire_tracing_sheets())), and see if a flywire neuron of interest is among the data stored on the hemibrainr drive, i.e. (flywire_in(fw.meta = flywire_meta())).

flywire_tracing_sheet(
  ws,
  regex = FALSE,
  open = FALSE,
  selected_sheet = options()$flywire_lineages_gsheets,
  Verbose = TRUE,
  ...
)

flywire_tracing_sheets(
  ws = NULL,
  selected_sheet = options()$flywire_lineages_gsheets
)

flywire_in(
  query,
  query.type = c("root_id", "flywire_xyz", "flywire_svid"),
  ws = NULL,
  fw.meta = flywire_meta(),
  cloudvolume.url = NULL,
  Verbose = TRUE
)

flywire_tracing_update(
  tab,
  selected_sheet,
  update,
  write.cols = colnames(update),
  by = "root_id",
  Verbose = TRUE,
  return = FALSE
)

flywire_tracing_standardise(
  ws = NULL,
  regex = FALSE,
  field = "root_id",
  selected_sheets = options()$flywire_lineages_gsheets,
  Verbose = TRUE,
  whimsy = FALSE,
  reorder = TRUE,
  remove.duplicates = TRUE
)

flywire_deploy_workflows(
  ws = "flywire",
  main_sheet,
  target_sheet = main_sheet,
  regex = FALSE,
  threshold = 10,
  cleft.threshold = 100,
  transmitters = FALSE,
  local = NULL,
  cloudvolume.url = NULL,
  Verbose = TRUE,
  work.flows = c("inputs", "outputs", "matches", "synapses"),
  nblast = NULL
)

flywire_dns(
  side = c("both", "right", "left"),
  gsheets = c(left = "1Gq_-L1tpvuSxYs5O-_PggiI2qdF52xoTG64WzSs9KTU", right =
    "10T0JE6nVSz_uUdoHGOpV2odO_k75-arRPKdOiBXlS80"),
  chosen.columns = c("root_id", "root_id", "flywire_xyz", "Tags"),
  ...
)

Arguments

ws

character vector, tabs (i.e. work sheets) on the google sheet to query/read. This works with regex, if regex==TRUE, so you only need to give the name partially. If set to NULL for flywire_tracing_sheets, the whole google sheet is read and all tabs are combined using plyr::rbind.fill.

regex

logical, use ws with regex.

open

logical, if TRUE the relevant google sheet tab is opened in your browser. Else, a data.frame of the tab is returned.

selected_sheet

character indicating the a flywire tracing google sheet. This defaults to the master 'lineage' tracing sheet used by the Drosophila Connectomics Group to store annotations on flywire neurons in different developmental lineages. Note: You may not have access.

Verbose

logical, if TRUE then hemibrainr communicates what it has found.

...

methods passed to googlesheets4 functions. .

query

a vector of data indicating flywire neurons. These can be a vector of flywire XYZ positions (readable by nat::xyzmatrix), flywire root IDs or flywire supervoxel IDs. These are used to get the most up to date root IDs from FlyWire, which are then matched to the results from flywire_tracing_sheets.

query.type

whether the query is a vector of xyz positions, flywire supervoxel IDs or flywire IDs ("flywire_xyz"/"flywire_svid"/"root_id").

fw.meta

a data.frame of meta data on flywire neurons, e.g. as produced by flywire_tracing_sheets.or read by flywire_meta.

cloudvolume.url

URL for CloudVolume to fetch segmentation image data. The default value of NULL choose

tab

the tab on selected_sheet to update.

update

a data.frame to use to update columns or add rows to the google sheet tab specified. This item must have at least the same number of entries as the google sheet tab.

write.cols

character vector, the columns from update that will be used to replace the column in the google sheet.

by

character, the column by which to join the old google sheet tab and update using dplyr::inner_join. This column must be in both the google sheet tab and update.

return

logical, whether or not to return the updated googlesheet tab as a data.frame.

field

character, the the column in the google sheet that you wish to have unique, when remove.duplicates is TRUE.

selected_sheets

a character vector of multiple google sheet IDs, as for selected_sheet.

whimsy

logical. If TRUE then a column with randomly generated 'whimsical' names is generated (unless there is already a name in this column).

reorder

logical, if TRUE then the googlesheet is reordered by cell_type, connection weight and users.

remove.duplicates

logical, whether or not to remove duplicate rows from google sheet. Currently, this will also trigger reorder even if it is set to FALSE.

main_sheet

a google sheet of flywire neurons with columns: workflow, whimsy, root_id. See standard_workflow. This sheet is read, and a separate tab in target_sheet is made for each workflow.

target_sheet

a sheet to which to add 'workflow' tabs. Workflow tabs are lists of flywire neurons up/downstream of neurons entered into the main_sheet. Accepted workflows: inputs, outputs, matches.

threshold

For flywire_partner_summary only return partners with greater than this number of connections to the query neuron(s) (default of 0 returns all connections)

cleft.threshold

A threshold for the cleft score calculated by Buhmann et al 2019 (default 0, we have used 30-100 to increase specificity)

transmitters

logical, if TRUE then inputs/outputs workflows include transmitter predictions for partners.

local

path to SQLite synapse data. Evaluated by fafbseg:::local_or_google. Work in progress. Default is to download this data and place it in ~/projects/JanFunke.

work.flows

a workflow for a flywire neuron. Either we want to trace upstream of it, downstream of it, or match it to a hemibrain neuron.

side

logical. The side of the brain these neurons are manually annotated, as being on.

gsheets

character, google sheet codes for google sheets independently containing flywire IDs for right and left DNs.

chosen.columns

character, which columns to read from the chosen google sheets..

Value

a data.frame with columns from the right tab, chosen using regex, from the given google sheet(s) selected_sheet, specified using the argument chosen.columns.

Details

flywire tracing google sheets should have the columns: flywire_xyz (a single cardinal position for each neuron in raw FlyWire voxel space), flywire_svid (the supervoxel ID for this position) and root_id (the flywire root ID for the neuron that can be found at this position). Additional, informative columns are encouraged. A sheet in this format can be updated using flywire_ids_update. This updates the 'unstable' root_id column based on the stable flywire_xyz column, and also provides stable flywire_svid column if it is empty.

See also

Examples

# \donttest{ if (FALSE) { # Quick look at what we have on the google sheet sheetlist=googlesheets4::sheet_properties( "1QyuHFdqz705OSxXNynD9moIsLvZGjjBjylx5sGZP2Yg") View(sheetlist) # Go to specific tab of lineage google sheet flywire_tracing_sheet("AOTUv1_v", open = TRUE) flywire_tracing_sheet("CREa1_v.*_r", open = TRUE) # Get this tab as a data frame flywire.lineage.sheet = flywire_tracing_sheet("CREa1_v.*_l") # Get the whole sheet as a data frame flywire.lineage.sheet = flywire_tracing_sheets() ## Note, the memoisation lasts for 30 minutes. ## I.e. this takes a long time to run but is saved for ## 30 mins on yuor computer. So if the function is called again ## with the same arguments, the sheets are not read again. # See if we have a certain flywire neuron in our sheets in.lin = flywire_in(query = "111437.5,21121.25,2661", query.type = "flywire_xyz", Verbose = TRUE, fw.meta = flywire_tracing_sheets()) # And in the meta data for neurons on the google drive in.meta = flywire_in(query = "111437.5,21121.25,2661", query.type = "flywire_xyz", Verbose = TRUE) }# }