R/flywire_tracing.R
flywire_tracing_sheet.RdThese 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"), ... )
| ws | character vector, tabs (i.e. work sheets) on the google sheet to query/read. This works with regex, if |
|---|---|
| regex | logical, use |
| open | logical, if |
| 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 |
| ... | methods passed to |
| query | a vector of data indicating flywire neurons. These can be a vector of flywire XYZ positions (readable by |
| 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 |
| cloudvolume.url | URL for CloudVolume to fetch segmentation image data. The default value of NULL choose |
| tab | the tab on |
| update | a |
| 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 |
| return | logical, whether or not to return the updated googlesheet tab as a |
| field | character, the the column in the google sheet that you wish to have unique,
when |
| selected_sheets | a character vector of multiple google sheet IDs, as for |
| 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 |
| remove.duplicates | logical, whether or not to remove duplicate rows from google sheet. Currently,
this will also trigger |
| main_sheet | a google sheet of flywire neurons with columns: |
| target_sheet | a sheet to which to add 'workflow' tabs. Workflow tabs are lists of flywire neurons up/downstream of neurons
entered into the |
| threshold | For |
| 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 |
| local | path to SQLite synapse data. Evaluated by
|
| 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.. |
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.
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.
# \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) }# }