pymaid.get_user_contributions¶
- pymaid.get_user_contributions(x, teams=None, remote_instance=None)[source]¶
Return number of nodes and synapses contributed by each user.
This is essentially a wrapper for
pymaid.get_contributor_statistics()
- if you are also interested in e.g. construction time, review time, etc. you may want to consider usingget_contributor_statistics()
instead.- Parameters:
x –
Which neurons to check. Can be either:
skeleton IDs (int or str)
neuron name (str, must be exact match)
annotation: e.g. ‘annotation:PN right’
CatmaidNeuron or CatmaidNeuronList object
dict (teams) –
Teams to group contributions for. Users must be logins:
{'teamA': ['user1', 'user2'], 'team2': ['user3'], ...]}
Users not part of any team, will be grouped as team
'others'
.optional –
Teams to group contributions for. Users must be logins:
{'teamA': ['user1', 'user2'], 'team2': ['user3'], ...]}
Users not part of any team, will be grouped as team
'others'
.remote_instance (CatmaidInstance, optional) – Either pass explicitly or define globally.
- Returns:
DataFrame in which each row represents a user:
user nodes presynapses postsynapses nodes_reviewed 0 1 ...
- Return type:
pandas.DataFrame
Examples
>>> import matplotlib.pyplot as plt >>> # Get contributors for a single neuron >>> cont = pymaid.get_user_contributions(2333007) >>> # Get top 10 (by node contribution) >>> top10 = cont.iloc[:10].set_index('user') >>> # Plot as bar chart >>> ax = top10.plot(kind='bar') >>> plt.show()
>>> # Plot relative contributions >>> cont = pymaid.get_user_contributions(2333007) >>> cont = cont.set_index('user') >>> # Normalize >>> cont_rel = cont / cont.sum(axis=0).values >>> # Plot contributors with >5% node contributions >>> ax = cont_rel[cont_rel.nodes > .05].plot(kind='bar') >>> plt.show()
See also
get_contributor_statistics()
Gives you more basic info on neurons of interest such as total reconstruction/review time.