nat
nat copied to clipboard
Implement a 'registry' of neurons
It would be useful to have some form of 'registry' where sets of neurons originating from the same dataset could be listed. This would allow a user to refer to a neuron by character vector, such as "DvGlutMARCM-F002528_seg001", while still allowing the requisite functions to know that this neuron corresponds to data from FlyCircuit. This would generalise the behaviour of the flycircuit package (and e.g. plot3dfc/pop3dfc) to handle multiple data sources.
Some form of prefix/suffix attached to the character vectors might be useful, especially when combining neurons from multiple datasets.
Something like:
#' @param x A neuronlist whose names will be registered as canonical identifiers for these neurons.
#' @param moreids A named character vector that maps additional identifiers
#' onto canonical identifiers. Perhaps also a function that can be applied to names(x)
#' @param prefix A character vector specifying a prefix to add to the identifier.
#' Defaults to name of x. (see details).
#' @param sep A character vector specifying a separator between prefix and identifier.
#' Defaults to ":" name of x.
register.neuronlist<-function(x, moreids=NULL, prefix=NULL, sep=":")
views @ajdm?
Of course register still seems like a less than ideal name for the generic given how much image registration we do ...
Looks good to me. Perhaps deposit
as an alternative to register
?
Looks good to me. Perhaps deposit as an alternative to register?
I wonder if deposit has the suggestion of putting the neurons into a location rather than telling someone about them.
The main change besides adding the register/deposit
function would be to update plot3d.character
to use it. Possibly there should be a separate function that fetches neurons by identifier.