pymaid.get_connectivity_counts

pymaid.get_connectivity_counts(x, source_relations=['presynaptic_to'], target_relations=['postsynaptic_to'], count_partner_links=True, remote_instance=None)[source]

Fetch number of connections of a given type for a set of neurons.

Parameters:
  • x (list-like | CatmaidNeuron/List) – Skeleton IDs for which to get cable lengths.

  • source_relations (str | list of str, optional) – A list of pre-connector relations.

  • target_relations (str | list of str, optional) – A list of post-connector relations. Default settings count the number of outgoing connections for the input neurons.

  • count_partner_links (bool, optional) – Whether to count partner links or links to a connector.

  • remote_instance (CatmaidInstance) – If not passed directly, will try using global.

Examples

# Get the count of all outgoing connections (default):

>>> counts = pymaid.get_connectivity_counts('annotation:glomerulus DA1')

# Get both incoming and outgoing connections:

>>> counts = pymaid.get_connectivity_counts('annotation:glomerulus DA1',
...                                         source_relations=['presynaptic_to',
...                                                           'postsynaptic_to'],
...                                         target_relations=['postsynaptic_to',
...                                                           'presynaptic_to'])
Returns:

Dictionary with server response.

{‘connectivity’: {skid1: {relation_ID: count},

skid2: {relation_ID: count}},

’relations’: {relation_ID: relation_name}}

Return type:

dict