This function retrieves neuron matches (hemibrain_matches
) from a master-matching google sheet. If then
can update other google sheets, specified by the user to update neuron-match information.
Just columns giving the match, match quality and cell_type are updated.
matches_update( matching_sheet = options()$hemibrainr_matching_gsheet, priority = c("FAFB", "hemibrain"), selected_sheets, id = c("root_id", "bodyid", "skid", "id"), match.field = c("hemibrain", "CATMAID", "flywire", "LM", "FAFB.hemisphere"), chosen.columns = c("cell_type", "flywire_xyz", "side", "ito_lee_hemilineage", "hartenstein_hemilineage") )
matching_sheet | the master matching sheet. Cannot be in |
---|---|
priority | whether to use FAFB->hemibrain_matches (FAFB) or hemibrain->FAFB matches (hemibrain) in order to ascribe cell_type names to FAFB neurons. In both cases, cell_type names are attached to hemibrain bodyids, and propagated to their FAFB matches. |
selected_sheets | character vector. the google sheet(s) to update. Each entry is a unique google sheet ID. You can find these in a sheet's URL.
If |
id | the ID specifying unique neuron identity for each row, for each tab of the google sheets specified with |
match.field | which match to record. E.g. if |
chosen.columns | as well as writing column updates to the specified google sheets, this function returns a |
a data.frame
with columns from the given google sheet(s), specified using the argument chosen.columns
.
For this function to work, the specified google sheet(s) must have either the column specified with the argument id
,
which gives the ID of a neuron from the FAFB (CATMAID or flywire) data set, or the hemibrain data set.
Each tab of each specified google sheet is read in turn. The data set match (specified with the argument match.field
). A match is recovered
using hemibrain_matching(selected_file = matching_sheet, priority=priority)
. If the right columns exist in the google sheet, i.e. 'hemibrain_match'
and 'hemibrain_match_quality' for a hemibrain_match, then this column in the google sheet is wiped and updated. If not, no update takes place.
# \donttest{ if (FALSE) { # Update flywire_ids in the sheet: ## https://docs.google.com/spreadsheets/d/ ## 1spGSuhUX6Hhn-8HH0U_ArIWUuPpMBFNjIjeSSh_MFVY ## /edit#gid=603762040 lineage.gsheet.meta = matches_update(id = "root_id", match.field = "hemibrain", selected_sheets = "1spGSuhUX6Hhn-8HH0U_ArIWUuPpMBFNjIjeSSh_MFVY") }# }