Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancies in synapse count #61

Open
msayr opened this issue Sep 23, 2024 · 0 comments
Open

Discrepancies in synapse count #61

msayr opened this issue Sep 23, 2024 · 0 comments

Comments

@msayr
Copy link

msayr commented Sep 23, 2024

Hi there,

I've noticed some discrepancies in neuron connectivity counts and after looking through the documentation I'm still unsure as to why this might be.

In the example below, I'm querying an EPG neuron (bodyId = 387364605).

import neuprint as neu 
...

flywire.set_default_dataset("public")

client = neu.Client(
    "https://neuprint.janelia.org/",
    token=("xxxx"), 
    dataset="hemibrain:v1.2.1"
)
epg_l3_df, epg_l3_conn = neu.fetch_neurons(387364605)
epg_l3_df
returns:
 bodyId             instance         type  pre  post    downstream  upstream  mito  \
0  387364605  EPG(PB08)_L3  EPG  645  4350        3725             4350   295   
   ...

My first question is regarding the value for 'upstream'. When I check the neuprint explorer, this cell has ~372 identified upstream partners, 527 including orphans and untyped, but here 'upstream' is returned as 4350, the same value as for 'post' (upstream==post quantity is true for all cells I've checked so far).

(cypher query:
MATCH (m:hemibrain_Meta) WITH m.superLevelRois AS rois MATCH (m:hemibrain_Neuron)-[e:ConnectsTo]->(n:hemibrain_Segment) WHERE m.bodyId = 387364605 RETURN m.instance AS Neuron1, m.type AS Neuron1Type, n.instance AS Neuron2, n.type AS Neuron2Type, n.bodyId AS Neuron2Id, e.weight AS Weight, m.bodyId AS Neuron1Id, n.status AS Neuron2Status, n.roiInfo AS Neuron2RoiInfo, n.size AS Neuron2Size, n.pre AS Neuron2Pre, n.post AS Neuron2Post, rois, e.weightHP AS WeightHP ORDER BY m.type, m.bodyId, e.weight DESC)

Is 'upstream' meant to be the total number of neurons that are upstream of my queried neuron or am I misunderstanding?

My second question is regarding a discrepancy in synapse counts when using fetch_neurons vs. fetch_adjacencies:

epg_l3_df, epg_l3_conn = neu.fetch_neurons(387364605)
epg_l3_conn[epg_l3_conn['roi']=='PB']
returns:
          bodyId	      roi      pre	    post     downstream     upstream	mito
19	387364605	PB	213	     265	       1412	            265	         41

If I understand correctly, this neuron has 265 postsynaptic synapses (ie., upstream/input) and 213 presynaptic synapses (downstream/output) within the PB, which is a main ROI. However, when I use fetch_adjacencies for all postsynaptic neurons and again for all presynaptic neurons within the PB, the post and pre counts differ from 265 and 213, respectively:

epg_l3_pbPost_df, epg_l3_pb_postConn = neu.fetch_adjacencies(targets=387364605, rois='PB')

epg_l3_pb_postConn['weight'].sum()
returns:
248
epg_l3_pbPre_df, epg_l3_pb_preConn = neu.fetch_adjacencies(sources=387364605, rois='PB')

epg_l3_pb_preConn['weight'].sum()
returns:
997

Why is this? And apologies ahead of time if I missed something in documentation.

Thanks for any input!
Marcel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant