Skip to content

Commit 51de791

Browse files
committed
doc additions/tweaks for manc_set_lrgroup
1 parent 56a69b1 commit 51de791

File tree

3 files changed

+110
-18
lines changed

3 files changed

+110
-18
lines changed

R/dvidtools.R

+54-9
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,16 @@ manc_set_dvid_instance <- function(bodyid, instance, user=getOption("malevnc.dvi
9999

100100
#' Check if group is complete
101101
#'
102-
#' In other words in all neurons from group are represented in \code{body_ids}
103-
#' vector.
102+
#' In other words if the \code{body_ids} argument contains all neurons in the
103+
#' group.
104104
#'
105105
#' @param group_id numeric/character with group id
106106
#' @param body_ids vector with body ids to compare
107107
#' @param conn Optional, a \code{\link{neuprint_connection}} object, which also
108108
#' specifies the neuPrint server. Defaults to \code{\link{manc_neuprint}()} to
109109
#' ensure that query is against the VNC dataset.
110110
#'
111-
#' @return logical with \code{TRUE} if group is complete
111+
#' @return logical \code{TRUE} if group is complete, \code{FALSE} otherwise.
112112
#'
113113
#' @importFrom glue glue
114114
manc_check_group_complete <- function(group_id, body_ids,
@@ -123,15 +123,60 @@ manc_check_group_complete <- function(group_id, body_ids,
123123

124124
#' Set LR matching groups for neurons in DVID and optionally Clio
125125
#'
126-
#' @param ids A set of ids belonging to the same group
127-
#' @param dryrun When \code{TRUE}, the default, show what will
128-
#' happen rather than applying the annotations.
126+
#' @details One important process in reviewing and annotating neurons is to
127+
#' compare neurons on the left and right side of the malevnc dataset. This can
128+
#' identify neurons that need further proof-reading fixes as well as grouping
129+
#' neurons that may eventually form agreed cell types. At the time of writing
130+
#' (21 Aug 2021) group information is stored in two locations: the DVID
131+
#' instance field and the Clio group field. DVID instance information is being
132+
#' periodically copied to Clio, but for the time being this is not automated.
133+
#' Furthermore it is not trivial to reconcile the two locations if they get
134+
#' out of sync. Therefore we have agreed that DVID will remain the master
135+
#' source of information for the time being.
136+
#'
137+
#' DVID left-right groupings are stored in the instance field (for the
138+
#' hemibrain this was more specific than the type field and typically included
139+
#' side of brain information). The convention has been to store the lowest
140+
#' body id in a group followed by an underscore and then the side (L or R) or
141+
#' a letter U to indicate that the neuron is unpaired (sometimes this is UNP).
142+
#' In contrast the Clio group column just contains the lowest bodyid. At this
143+
#' point we assume that the selected bodyid will \emph{not} change if neurons
144+
#' are added to the group. \code{manc_set_lrgroup} will choose the lowest
145+
#' bodyid as the default when setting the group for a set of ids unless a
146+
#' specific \code{group} argument is passed.
147+
#'
148+
#' Grouping neurons remains a subjective process: while many cases are
149+
#' obvious, there are always edge cases where experts disagree. Therefore it
150+
#' is not necessarily productive to spend extensive amounts of discussion once
151+
#' a designation has been made. Therefore \code{manc_set_lrgroup} tries to
152+
#' avoid overriding previous designations unless the user insists. This
153+
#' behaviour can be changed using the \code{Force} or \code{Partial}. As you
154+
#' might expect \code{Force=TRUE} just does what you ask regardless of any
155+
#' existing annotations. Use this sparingly and with caution.
156+
#'
157+
#' \code{Partial=TRUE} is more nuanced and tries to do the right thing when
158+
#' extending a group for which some members already have annotations. The main
159+
#' limitation is that you must pass \emph{all} the members of the group in
160+
#' your call so that \code{manc_set_lrgroup} knows that you are trying to make
161+
#' a compatible annotation.
162+
#'
163+
#' Here are some examples of group annotations: \itemize{
164+
#'
165+
#' \item \code{10000_R}, \code{10000_L} for bodyids \code{10000, 10002} (the
166+
#' giant fibers)
167+
#'
168+
#' \item \code{13083_U} an unpaired neuron.
169+
#'
170+
#' }
171+
#' @param ids A set of body ids belonging to the same group
172+
#' @param dryrun When \code{TRUE}, the default, show what will happen rather
173+
#' than applying the annotations.
129174
#' @param Force Whether to update DVID instances (and clio group) even when
130175
#' there is existing DVID instance information.
131-
#' @param Partial Assigns only partial annotations to DVID instances
176+
#' @param Partial Assigns group annotations (via DVID instances) only to neurons
132177
#' that do not yet have annotation.
133-
#' @param group Set a specific group id.
134-
#' @param clio Whether push to Clio or not.
178+
#' @param group Set a specific group id rather than accepting the default.
179+
#' @param clio Whether to set the Clio group field in addition to DVID.
135180
#'
136181
#' @export
137182
#' @examples

man/manc_check_group_complete.Rd

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/manc_set_lrgroup.Rd

+53-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)