In [1]:
import pymaid
print('Last run with Pymaid version', pymaid.__version__)
In [4]:
# Create Catmaid instance
rm = pymaid.CatmaidInstance('server_url', 'api_token', 'http_user', 'http_password')
There are several API endpoints in CATMAID that allow you to fetch connector data. Which one to use is depending ultimately on what information you want. The examples below are rather simply and many of the function used let you pass parameters to further restrict your search. Please check out their documentation on readthedocs or use e.g. help(pymaid.get_connectors)
.
In [3]:
n = pymaid.get_neuron(2333007)
n.connectors.head()
Out[3]:
The connector table contains all the data necessary for plotting: position, type (relation
: 0 = presynaptic, 1 = postsynaptic, 2 = gap_junction; see also help(pymaid.get_neuron)
) and the treenode of this neuron it is connected to. It has, however, no information about tags, creator or edition/creation times.
In [4]:
# Retrieve all types of connectors for a single neuron
cn_table = pymaid.get_connectors(2333007)
print('Connectors retrieved: %i' % cn_table.shape[0] )
In [5]:
cn_table.head()
Out[5]:
This table gives you more detailed information. But what if you need even more details?
In [6]:
cn_details = pymaid.get_connector_details( n )
cn_details.head()
Out[6]:
This connector table now give you information about which neurons/treenodes are pre- and postsynaptic to a given connector.
In [7]:
cn_between = pymaid.get_connectors_between( 2049139, n )
cn_between.head()
Out[7]: