pymaid
pymaid copied to clipboard
cluster_by_synapse_placement

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
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()
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!
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