Open stuarteberg opened 2 years ago
To be a little more explicit, here's the documentation for GET .../count
. I want addtional options for the <index type>
argument. And so on for the other labelsz endpoints.
GET <api URL>/node/<UUID>/<data name>/count/<label>/<index type>
Returns the count of the given annotation element type for the given label.
The index type may be any annotation element type ("PostSyn", "PreSyn", "Gap", "Note"),
the catch-all for synapses "AllSyn", or the number of voxels "Voxels".
For synapse indexing, the labelsz data instance must be synced with an annotations instance.
(future) For # voxel indexing, the labelsz data instance must be synced with a labelvol instance.
Example:
GET <api URL>/node/3f8c/labelrankings/size/21847/PreSyn
Returns:
{ "Label": 21847, "PreSyn": 81 }
Might be nice to have synweight
, too (upstream + downstream
).
Here's a pure-python function that achieves the same thing, but with the full synapse list from the synapses
instance.
[This is a low-priority request, but it might be relatively easy to implement.]
In addition to returning the number of
PreSyn
orPostSyn
on a body, it would be good to know how many "relationships" thosePreSyn
orPostSyn
have. ForPreSyn
, the number of relationships indicates the total downstream synapse partners. The number of relationships on thePostSyn
indicates the total upstream synapse partners.(Okay, in our data, every
PostSyn
has only one relationship, so technicallyupstream
will be redundant with the PostSyn count itself. But forPreSyn
, it's not redundant -- typicallydownstream
will be much larger than thePreSyn
count. And it's nice to have both for symmetry's sake.)FWIW, neuprint includes
downstream
andupstream
counts, too.Edit: Maybe instead of
upstream
anddownstream
, you should just pluck the keys from the JSON:PreSynTo
andPostSynTo
.Just for illustration, here's a sample of synapse annotation data. Counting the items in the
Rels
list gives you thedownstream
count orupstream
count, depending on whether the annotation kind isPreSyn
orPostSyn
.