pymaid icon indicating copy to clipboard operation
pymaid copied to clipboard

cluster_by_synapse_placement

Open ArefZarin opened this issue 6 years ago • 2 comments

Screen Shot 2019-08-12 at 3 27 50 PM Screen Shot 2019-08-12 at 3 38 29 PM

Hi Philip, I am trying to use this function: cluster_by_synapse_placement Please see the attached error (NameError: name 'core' is not defined), and let me know where things are wrong. I tried importing core using this line: from . import core, plotting, utils, config But it gives me the error which I have attached. Thanks for your help!

Aref

ArefZarin avatar Aug 12 '19 22:08 ArefZarin

Hi @ArefZarin,

You seem to be calling cluster_by_synapse_placement without the leading pymaid. - did you import the function explicitly by running from pymaid import cluster_by_synapse_placement or did you perhaps copy+paste the code in your Jupyter notebook?

Could you try running this minimal example in a fresh notebook?

import pymaid
import matplotlib.pyplot as plt

# Enter your server and credentials here
rm = pymaid.CatmaidInstance('https://YOURSERVER', 'HTTP_USER', 'HTTP_PW', 'API_TOKEN')

# Fetch your neurons
n = pymaid.get_neurons('annotation:ZarinMNs')

# Cluster by synapse placement
res = pymaid.cluster_by_synapse_placement(n)

# Plot distance matrix
res.plot_matrix()
plt.show()

schlegelp avatar Aug 13 '19 06:08 schlegelp

Hi Phillip, I ran your code in a fresh notebook and it worked. See attached cluster. please let me know how can I change the code to incorporate the skids (ideally neuron names) next to the dendrogram? Currently, I can not tell where a given neuron located in the dendrogram. I hope there is a way to get this info, as I like this function a lot!

Screen Shot 2019-08-14 at 9 37 26 PM

Regarding your first question, I had run the import pymaid line and also had done copy+paste the code in the same notebook. So it had messed up the things. Thanks for solving this issue. You are really good at troubleshooting. Aref

ArefZarin avatar Aug 15 '19 04:08 ArefZarin