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

neuprint_connection_table returns different values as on neuprint website #117

Closed
istvantaisz opened this issue Apr 29, 2020 · 2 comments
Closed
Labels
wontfix This will not be worked on

Comments

@istvantaisz
Copy link

istvantaisz commented Apr 29, 2020

Synapse numbers retrieved are different from the ones found on https://neuprint.janelia.org/ for neuron 580227374.
Input: 5176 vs 4908, Output: 2133 vs 6498

library(neuprintr)
M_inputs  = neuprint_connection_table(580227374, prepost = c("PRE"))
nrow(M_inputs)
[1] 854
sum(M_inputs$weight)
[1] 4908
M_outputs  = neuprint_connection_table(580227374, prepost = c("POST"))
nrow(M_outputs)
[1] 1368
sum(M_outputs$weight)
[1] 6498

My dataset version matches the online one: neuprint_dataset = "hemibrain:v1.0.1"

Related to #63 and #67

@romainFr
Copy link
Collaborator

Hi @istvantaisz ,

The numbers reported on the website are the total numbers of pre and post synaptic sites respectively. In neuprintr, those would be the pre and post columns returned by neuprint_get_meta. neuprint_connection_table differs in two ways:

  • by default, it only returns connections to neurons (and not unidentified fragments). This is controlled by the all_segments option. This explains the first discrepancy you see
  • it reports the weights, which in neuprint are always correspond to the number of postsynaptic sites between two neurons. That explains the second discrepancy

In other words:

  • neuprint_connection_table(580227374, prepost = c("PRE"),all_segments=TRUE) will sum to the same number as the #post column on the neuprint website
  • neuprint_connection_table cannot sum to the #pre column because it is reporting weights, not number of presynaptic sites (the same way that on the neuprint website, were you to sum the #connections column, you wouldn't get the #pre column of the parent neuron)

Let me know if that helps, and thanks for reporting!

@istvantaisz
Copy link
Author

istvantaisz commented Apr 29, 2020

Hi Romain,
thanks for your response.
I missed the all_segments option.

And indeed when I exported all outputs I got a third number for all outputs, which matches with nrows from neuprint_connection_table(580227374, prepost = c("POST"), all_segments = T)

@jefferis jefferis added the wontfix This will not be worked on label May 2, 2020
@jefferis jefferis closed this as completed May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants