Difference between "downstream" property and result of fetch_adjacencies()

43 views
Skip to first unread message

Sarah Pugliese

unread,
Oct 27, 2023, 7:37:48 PM10/27/23
to neuPrint
Hello,

What is the difference between what is measured by the "downstream" property of a neuron, and what is being queried with the fetch_adjacencies() function? For example, when I run the following for the MANC dataset, the value for nDownstreamSynapses is 20,026 and the value for nTargetSynapses is 6,649:

testId = 10126

neuronProperties, _ = neu.fetch_neurons(testId)
nDownstreamSynapses = neuronProperties["downstream"]
_, targets = neu.fetch_adjacencies(sources=testId)
nTargetSynapses = targets["weight"].sum()

Thank you for your help.

Best,
Sarah Pugliese


Berg, Stuart

unread,
Oct 27, 2023, 8:07:00 PM10/27/23
to Sarah Pugliese, neuPrint
Hi Sarah,

What is the difference between what is measured by the "downstream" property of a neuron, and what is being queried with the fetch_adjacencies() function? For example, when I run the following for the MANC dataset, the value for nDownstreamSynapses is 20,026 and the value for nTargetSynapses is 6,649:

In the neuprint data model, everything with synapses is a "Segment", but only a subset of those are significant enough to that they are given the additional label of "Neuron".  Many analyses will ignore the non-Neuron segments, considering only connections between the objects which are big enough to have cell types, etc.  If your queries were to capture all Segments, they would be slower and would return many results which aren't useful.

The 'downstream' property of a Neuron includes ALL downstream synaptic connections, even those to mere Segments.  But by default, the fetch_adjacencies() function will only return connections involving Neurons, not all Segments.  You can control this behavior by specifying the source/target criteria.

Try the following code:

from neuprint import Client, NeuronCriteria as NC, fetch_neurons, fetch_adjacencies
c = Client('neuprint.janelia.org', 'manc:v1.0')
neurons, syndist = fetch_neurons(10126)
_, segment_conn = fetch_adjacencies(10126, NC(label='Segment'))
_, neuron_conn = fetch_adjacencies(10126, NC(label='Neuron'))
_, default_conn = fetch_adjacencies(10126, None)

print('downstream:', neurons['downstream'].iloc[0])
print('total weight (to Segments):', segment_conn['weight'].sum())
print('total weight (to Neurons):', neuron_conn['weight'].sum())
print('total weight (default):', default_conn['weight'].sum())


...which results in the following output:

downstream: 20026
total weight (to Segments): 20026
total weight (to Neurons): 6649
total weight (default): 6649


Best regards,
Stuart

Reply all
Reply to author
Forward
0 new messages