This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Hacking the connectome

Tutorials from the Virtual Fly Brain “Hacking the connectome” workshop that was run in collaboration with the Drosophila Connectomics Group based at the Dept of Zoology, University of Cambridge.

Below you can watch the recorded introduction session of our workshop and follow along with the workshop notebooks we work through to show examples of how you can use the available {{ ref “tools.md” tools }} to explore and analyse the published connectomes available on VFB.

1 - Introduction to connectomic data and tools

Introduction session from the Virtual Fly Brain “Hacking the connectome” workshop that was run in collaboration with the Drosophila Connectomics Group based at the Dept of Zoology, University of Cambridge.

2 - Tool landscape

There are multiple tools to query the various data sources. Fortunately they play together nicely. Here is a quick overview

Below are brief descriptions of the libraries/packages. For details, I defer to their respective (excellent) documentations.

Querying VFB

Queries against VFB’s REST API are easiest with vfb_connect for Python. For R there is a vfb_connect wrapper, vfbconnectr. See also David’s presentation for details.

R

In R, the natverse is your one-stop-shop for all things neuron: it’s a collection of various R packages that are built on top of the neuroanatomy toolbox, nat. Of particular relevance for this workshop:

  1. nat is a general purpose library for working with morphological neuron data. In this workshop, we make heavy use of nat’s plotting capabilities but its capabilities extend far beyond that. If you want to run any morphological analysis, I highly recommend you have a look at the “Articles” in nat’s doc.
  2. neuprintr and hemibrainr provide an interface with neuprint and the Janelia hemibrain dataset (link). The former lets you run queries against neuprint’s neo4j database while the latter contains meta data and various convenience functions to work with the hemibrain dataset.
  3. rcatmaid provides an interface with CATMAID servers such as those the VFB uses to host published from the FAFB or larval fruit fly dataset. rcatmaid is built on top of nat and you can use nat functions with neurons pulled via rcatmaid.

Python

In Python, we find packages analogous to those in R:

  1. navis is nat’s serpentine sibling: a general purpose neuron library for visualization and analysis of neuronal morphologies. It also features interfaces e.g. with Blender 3D and the natverse via rpy2.
  2. python-neuprint is a Python library to interface with neuprint maintained by Janelia. Note that navis wraps this library and adds some convenience functions. See this tutorial.
  3. pymaid lets you interface with CATMAID servers. Critically, it’s built on top of navis and you can natively use navis functions with pymaid neurons. Note that due to a name clash the library is called python-catmaid on PyPI.

Noteworthy mentions

There are a few more packages/functions that you might hear of over the course of the workshop.

NBLAST

NBLAST is an algorithm that computes morphological similarity between neurons (Costa et al., 2016). This has proven incredibly useful to find similar neurons across datasets but also to cluster neurons into cell types.

On the R side the algorithm is implemented in nat.nblast and in Python it is part of navis (see this tutorial).

Transforms

You will note that neurons pulled from VFB are typically in the same template space which makes co-visualization of neurons from different datasets a breeze. If you want to transform spatial data between template brains, e.g. from FAFB (“FAFB14”) to hemibrain (“JRCFIB2018F”), you should look for nat.flybrains & nat.jrcbrains in R and navis-flybrains in Python.

3 - Discovery

Required packages: vfb-connect and python-catmaid (pymaid & navis)

!pip install vfb-connect --upgrade
!pip install python-catmaid --upgrade

A note on using these notebooks

This is designed as an interactive tutorial. Feel free to add code cells below each example to try out variations of your own.

How to find neurons across datasets

VirtualFlyBrain integrates images and connectomics profiles of neurons from many sources. It classifies and records their properties using a standard, queryable classification (The Drosophila Anatomy Ontology). This standardises the names of neuron types across sources, so you don’t need to worry about differences in nomenclature uses and supports queries for neurons by their classification.

# Import libs and initialise API objects
from vfb_connect.cross_server_tools import VfbConnect
import pandas as pd
vc = VfbConnect()

import pymaid
import navis

navis.set_pbars(jupyter=False)
pymaid.set_pbars(jupyter=False)

# Connect to the VFB CATMAID server hosting the FAFB data
rm = pymaid.connect_catmaid(server="https://fafb.catmaid.virtualflybrain.org/", api_token=None, max_threads=10)

# Test call to see if connection works 
print(f'Server is running CATMAID version {rm.catmaid_version}')

WARNING: Could not load OpenGL library.
INFO  : Global CATMAID instance set. Caching is ON. (pymaid)
Server is running CATMAID version 2020.02.15-905-g93a969b37

Finds neurons by type (classification) across datasets

We can use the vc.get_instances method in combination with the name of a neuron type on VFB to find individual neurons from multiple sources.

Use the search tool on VFB to find neuron types by name or synonym:

Use either the full name or the Symbol to query for neurons:

DA3adPN = vc.get_instances("adult Drosulfakinin neuron", summary=True)
pd.DataFrame.from_records(DA3adPN)

label symbol id tags parents_label parents_id data_source accession templates dataset license
0 DSKMP3_R - 327937328 VFB_jrchjti6 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult Drosulfakinin neuron FBbt_00048999 neuprint_JRC_Hemibrain_1point1 327937328 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
1 DSKMP1A(PVM02)_L - 1260833150 VFB_jrchjti3 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult Drosulfakinin neuron FBbt_00048999 neuprint_JRC_Hemibrain_1point1 1260833150 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
2 DSKMP3_R - 328559607 VFB_jrchjti7 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult Drosulfakinin neuron FBbt_00048999 neuprint_JRC_Hemibrain_1point1 328559607 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
3 DSKMP1B_R - 1352077058 VFB_jrchjti4 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult Drosulfakinin neuron FBbt_00048999 neuprint_JRC_Hemibrain_1point1 1352077058 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
4 DSKMP1B(PVM02)_L - 1011184205 VFB_jrchjti5 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult Drosulfakinin neuron FBbt_00048999 neuprint_JRC_Hemibrain_1point1 1011184205 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
5 DSKMP1A_R - 1135837629 VFB_jrchjti2 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult Drosulfakinin neuron FBbt_00048999 neuprint_JRC_Hemibrain_1point1 1135837629 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...

Find neurons by location

We can use the same method to search for neurons by location, using simple queries.

# Find neurons by location. The following query works across multiple data sources and both sides of the brain.  
# Results may be incomplete & may include minor overlap inferred from low synapse counts

neurons_in_DA3 = vc.get_instances("'neuron' that 'overlaps' some 'antennal lobe glomerulus DA3'", summary=True)
neurons_in_DA3_tab = pd.DataFrame.from_records(neurons_in_DA3)
neurons_in_DA3_tab[0:5]

Running query: FBbt:00005106 that RO:0002131 some FBbt:00003934
Query URL: http://owl.virtualflybrain.org/kbs/vfb/instances?object=FBbt%3A00005106+that+RO%3A0002131+some+FBbt%3A00003934&prefixes=%7B%22FBbt%22%3A+%22http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FFBbt_%22%2C+%22RO%22%3A+%22http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FRO_%22%2C+%22BFO%22%3A+%22http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FBFO_%22%7D&direct=False
Query results: 158

label symbol id tags parents_label parents_id data_source accession templates dataset license
0 lLN2T_a(Tortuous)_R - 5813056598 VFB_jrchk8bi Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2T FBbt_00049816 neuprint_JRC_Hemibrain_1point1 5813056598 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
1 ORN_DL3_R - 1671625186 VFB_jrchk1hj Entity|has_image|Adult|Anatomy|has_neuron_conn... adult olfactory receptor neuron Or65 FBbt_00067011 neuprint_JRC_Hemibrain_1point1 1671625186 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
2 DA4m_adPN_R - 574037266 VFB_jrchjtdq Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe projection neuron DA4m adPN FBbt_00047714 neuprint_JRC_Hemibrain_1point1 574037266 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
3 Uniglomerular mALT DA3 adPN#L1 (FAFB:2449792) VFB_0010123h Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe projection neuron DA3 adPN FBbt_00100384 catmaid_fafb 2449792 JRC2018Unisex BatesSchlegel2020 https://creativecommons.org/licenses/by-sa/4.0...
4 lLN2T_e(Tortuous)_R - 1699974843 VFB_jrchk8br Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2T FBbt_00049816 neuprint_JRC_Hemibrain_1point1 1699974843 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
# Find local interneurons (intrinsic neurons) of the AL, overlapping DA3:

local_in_DA3 = vc.get_instances("'local interneuron of adult antennal lobe' that 'overlaps' some 'antennal lobe glomerulus DA3'",
                                summary=True)
local_in_DA3_tab = pd.DataFrame.from_records(local_in_DA3)
local_in_DA3_tab
Running query: FBbt:00007390 that RO:0002131 some FBbt:00003934
Query URL: http://owl.virtualflybrain.org/kbs/vfb/instances?object=FBbt%3A00007390+that+RO%3A0002131+some+FBbt%3A00003934&prefixes=%7B%22FBbt%22%3A+%22http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FFBbt_%22%2C+%22RO%22%3A+%22http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FRO_%22%2C+%22BFO%22%3A+%22http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FBFO_%22%7D&direct=False
Query results: 53

label symbol id tags parents_label parents_id data_source accession templates dataset license
0 lLN16b_R - 1887168462 VFB_jrchk89w Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 1887168462 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
1 lLN1_c_R - 5813047691 VFB_jrchk8ae Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 5813047691 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
2 lLN2S(Star)_R - 1670627928 VFB_jrchk8bb Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2S FBbt_00049815 neuprint_JRC_Hemibrain_1point1 1670627928 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
3 lLN2F_b(Full)_R - 5813024698 VFB_jrchk8an Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2F FBbt_00049812 neuprint_JRC_Hemibrain_1point1 5813024698 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
4 lLN2T_c(Tortuous)_R - 1671292719 VFB_jrchk8bo Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2T FBbt_00049816 neuprint_JRC_Hemibrain_1point1 1671292719 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
5 lLN1_c_R - 5813062199 VFB_jrchk8af Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 5813062199 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
6 lLN1_a_R - 5813130064 VFB_jrchk8a4 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 5813130064 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
7 lLN1_c_R - 1702651358 VFB_jrchk8aj Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 1702651358 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
8 lLN2T_e(Tortuous)_R - 1640922516 VFB_jrchk8bs Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2T FBbt_00049816 neuprint_JRC_Hemibrain_1point1 1640922516 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
9 lLN11_R - 1670278227 VFB_jrchk89e Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 1670278227 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
10 lLN2P_c(Patchy)_R - 2105086391 VFB_jrchk8b0 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2P FBbt_00049813 neuprint_JRC_Hemibrain_1point1 2105086391 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
11 lLN2T_b(Tortuous)_R - 1640572741 VFB_jrchk8bl Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2T FBbt_00049816 neuprint_JRC_Hemibrain_1point1 1640572741 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
12 lLN1_c_R - 1578826464 VFB_jrchk8ah Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 1578826464 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
13 lLN2P_a(Patchy)_R - 2041621893 VFB_jrchk8ao Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2P FBbt_00049813 neuprint_JRC_Hemibrain_1point1 2041621893 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
14 lLN2S(Star)_R - 1762359683 VFB_jrchk8bc Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2S FBbt_00049815 neuprint_JRC_Hemibrain_1point1 1762359683 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
15 lLN1_b_R - 5813054622 VFB_jrchk8a8 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 5813054622 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
16 lLN2F_a(Full)_R - 1670287030 VFB_jrchk8al Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2F FBbt_00049812 neuprint_JRC_Hemibrain_1point1 1670287030 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
17 lLN12a_R - 1826445251 VFB_jrchk89g Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 1826445251 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
18 lLN11_R - 2040301572 VFB_jrchk89d Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 2040301572 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
19 il3LN6_R - 5813018460 VFB_jrchk88v Entity|has_image|Adult|Anatomy|has_neuron_conn... local interneuron of adult antennal lobe FBbt_00007390 neuprint_JRC_Hemibrain_1point1 5813018460 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
20 lLN2R_b(Regional)_R - 5813076969 VFB_jrchk8b6 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2R FBbt_00049814 neuprint_JRC_Hemibrain_1point1 5813076969 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
21 lLN16a_R - 1702318692 VFB_jrchk89t Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 1702318692 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
22 lLN2T_d(Tortuous)_R - 1667251683 VFB_jrchk8bp Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2T FBbt_00049816 neuprint_JRC_Hemibrain_1point1 1667251683 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
23 lLN2R_b(Regional)_R - 1702305987 VFB_jrchk8b5 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2R FBbt_00049814 neuprint_JRC_Hemibrain_1point1 1702305987 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
24 v2LN35_R - 1733056086 VFB_jrchk8ew Entity|has_image|Adult|Anatomy|has_neuron_conn... local interneuron of adult antennal lobe FBbt_00007390 neuprint_JRC_Hemibrain_1point1 1733056086 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
25 lLN1_b_R - 1610530558 VFB_jrchk8ac Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 1610530558 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
26 lLN2S(Star)_R - 1640922754 VFB_jrchk8b8 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2S FBbt_00049815 neuprint_JRC_Hemibrain_1point1 1640922754 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
27 lLN1_c_R - 1824101645 VFB_jrchk8ag Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 1824101645 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
28 lLN1_c_R - 1547454812 VFB_jrchk8ai Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 1547454812 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
29 lLN1_b_R - 5813069055 VFB_jrchk8aa Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 5813069055 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
30 lLN1_b_R - 1642623277 VFB_jrchk8ad Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 1642623277 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
31 lLN2T_a(Tortuous)_R - 5813054726 VFB_jrchk8bh Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2T FBbt_00049816 neuprint_JRC_Hemibrain_1point1 5813054726 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
32 lLN2F_b(Full)_R - 1640909284 VFB_jrchk8am Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2F FBbt_00049812 neuprint_JRC_Hemibrain_1point1 1640909284 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
33 lLN2F_a(Full)_R - 5901218894 VFB_jrchk8ak Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2F FBbt_00049812 neuprint_JRC_Hemibrain_1point1 5901218894 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
34 lLN2T_e(Tortuous)_R - 1699974843 VFB_jrchk8br Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2T FBbt_00049816 neuprint_JRC_Hemibrain_1point1 1699974843 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
35 lLN10_R - 1825789179 VFB_jrchk89b Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 1825789179 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
36 lLN2S(Star)_R - 1702306037 VFB_jrchk8b7 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2S FBbt_00049815 neuprint_JRC_Hemibrain_1point1 1702306037 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
37 lLN2S(Star)_R - 1732995501 VFB_jrchk8ba Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2S FBbt_00049815 neuprint_JRC_Hemibrain_1point1 1732995501 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
38 lLN2S(Star)_R - 5813069085 VFB_jrchk8b9 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2S FBbt_00049815 neuprint_JRC_Hemibrain_1point1 5813069085 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
39 v2LN3b_R - 1888199872 VFB_jrchk8fg Entity|has_image|Adult|Anatomy|has_neuron_conn... local interneuron of adult antennal lobe FBbt_00007390 neuprint_JRC_Hemibrain_1point1 1888199872 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
40 lLN1_b_R - 1640887603 VFB_jrchk8a6 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 1640887603 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
41 lLN1_b_R - 5813078440 VFB_jrchk8a7 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 5813078440 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
42 lLN2T_b(Tortuous)_R - 5813034493 VFB_jrchk8bm Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2T FBbt_00049816 neuprint_JRC_Hemibrain_1point1 5813034493 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
43 lLN1_b_R - 5813054777 VFB_jrchk8a9 Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 5813054777 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
44 v2LN30_R - 1671620613 VFB_jrchk8e8 Entity|has_image|Adult|Anatomy|has_neuron_conn... local interneuron of adult antennal lobe FBbt_00007390 neuprint_JRC_Hemibrain_1point1 1671620613 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
45 v2LN3b_R - 5813034455 VFB_jrchk8ff Entity|has_image|Adult|Anatomy|has_neuron_conn... local interneuron of adult antennal lobe FBbt_00007390 neuprint_JRC_Hemibrain_1point1 5813034455 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
46 lLN2T_a(Tortuous)_R - 5813032595 VFB_jrchk8bd Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2T FBbt_00049816 neuprint_JRC_Hemibrain_1point1 5813032595 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
47 lLN2T_a(Tortuous)_R - 5813056598 VFB_jrchk8bi Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2T FBbt_00049816 neuprint_JRC_Hemibrain_1point1 5813056598 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
48 lLN1_b_R - 5813054725 VFB_jrchk8ab Entity|has_image|Adult|Anatomy|has_neuron_conn... adult local interneuron of the lateral ALl1 ne... FBbt_00007394 neuprint_JRC_Hemibrain_1point1 5813054725 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
49 lLN2P_b(Patchy)_R - 1946178096 VFB_jrchk8au Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2P FBbt_00049813 neuprint_JRC_Hemibrain_1point1 1946178096 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
50 lLN2T_a(Tortuous)_R - 5813055277 VFB_jrchk8bf Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2T FBbt_00049816 neuprint_JRC_Hemibrain_1point1 5813055277 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
51 l2LN18_R - 5813054773 VFB_jrchk891 Entity|has_image|Adult|Anatomy|has_neuron_conn... local interneuron of adult antennal lobe FBbt_00007390 neuprint_JRC_Hemibrain_1point1 5813054773 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
52 lLN2T_a(Tortuous)_R - 1762354941 VFB_jrchk8bg Entity|has_image|Adult|Anatomy|has_neuron_conn... adult antennal lobe lateral local neuron 2T FBbt_00049816 neuprint_JRC_Hemibrain_1point1 1762354941 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
# Find neurons by dataset/paper - on CATMAID

bates = pymaid.find_neurons(annotations='Paper: Bates and Schlegel et al 2020')
bates
INFO  : Found 583 neurons matching the search parameters (pymaid)

type name skeleton_id n_nodes n_connectors n_branches n_leafs cable_length soma units
0 CatmaidNeuron Uniglomerular mALT DA1 lPN 57316 2863105 ML 2863104 NA NA NA NA NA NA 1 nanometer
1 CatmaidNeuron Uniglomerular mALT DA3 adPN 57350 HG 57349 NA NA NA NA NA NA 1 nanometer
... ... ... ... ... ... ... ... ... ... ...
581 CatmaidNeuron Multiglomerular mlALT vPN VM7d+VM5d+DC4+6 LTS ... 4624378 NA NA NA NA NA NA 1 nanometer
582 CatmaidNeuron Uniglomerular mALT DL2d adPN 57342 ML 57341 NA NA NA NA NA NA 1 nanometer
# Inspect what datasets are available on VFB

ds = vc.neo_query_wrapper.get_datasets(summary=True)
ds_tab = pd.DataFrame.from_records(ds)
ds_tab.sort_values(by=['id'])

label symbol id tags description miniref FlyBase PMID DOI
81 EM L1 Andrade et al. 2019 Andrade2019 Entity|Individual|DataSet [L1 EM reconstructed neurons from Andrade et a... Andrade et al., 2019, Curr. Biol. 29(3): 412--... FBrf0241389 30661802 10.1016/j.cub.2018.12.012
16 MBONs and split-GAL4 lines that target them (A... Aso2014 Entity|Individual|DataSet [] Aso et al., 2014, eLife 3: e04577 FBrf0227179 25535793 10.7554/eLife.04577
19 split-GAL4 lines for dopaminergic neurons (Aso... AsoRubin2016 Entity|Individual|DataSet [For comparison of the properties of memories ... Aso and Rubin, 2016, eLife 5: e16135 FBrf0233230 27441388 10.7554/eLife.16135
52 EM FAFB Bates and Schlegel et al 2020 BatesSchlegel2020 Entity|Individual|DataSet [FAFB EM reconstructed neurons from Bates and ... Bates and Schlegel et al., 2020 10.1016/j.cub.2020.06.042
0 Larval olfactory system neurons - EM (Berk2016) Berck2016 Entity|Individual|DataSet [Berck, Khandelwal et al. 2016] Berck et al., 2016, eLife 5: e14859 FBrf0232785 27177418 10.7554/eLife.14859
... ... ... ... ... ... ... ... ... ...
30 Lee lab adult brain lineage clone image set Yu2013 Entity|Individual|DataSet [An exhaustive set of lineage clones covering ... Yu et al., 2013, Curr. Biol. 23(8): 633--643 FBrf0221412 23541733 10.1016/j.cub.2013.02.057
15 EM L1 Zarin, Mark et al. 2019 Zarin2019 Entity|Individual|DataSet [L1 EM reconstructed neurons from Zarin, Mark ... Zarin, Mark et al., 2019 10.1101/617977
48 EM FAFB Zheng et al 2018 Zheng2018 Entity|Individual|DataSet [FAFB EM reconstructed neurons from Zheng et a... Zheng et al., 2018, Cell 174(3): 730--743.e22 FBrf0239557 30033368 10.1016/j.cell.2018.06.019
34 EM FAFB Zheng et al 2020 Zheng2020 Entity|Individual|DataSet [FAFB EM reconstructed neurons from Zheng et a... Zheng et al. 2020 10.1101/2020.04.17.047167
28 Larval motor circuit neurons (Zwart2016) Zwart2016 Entity|Individual|DataSet [Zwart et al. 2016] Zwart et al., 2016, Neuron 91(3): 615--628 FBrf0233076 27427461 10.1016/j.neuron.2016.06.031

83 rows × 9 columns

sayin_tab = pd.DataFrame.from_records(vc.get_instances_by_dataset('Sayin2019', summary=True))
sayin_tab

label symbol id tags parents_label parents_id data_source accession templates dataset license
0 OA-VPM3 (FAFB:1329078) VFB_001001dr Entity|Octopaminergic|Adult|Anatomy|has_image|... octopaminergic VPM3 neuron FBbt_00110151 catmaid_fafb 1329078 JRC2018Unisex Sayin2019 https://creativecommons.org/licenses/by-sa/4.0...
1 OA-VPM4 (FAFB:1191261) VFB_001001dq Entity|Octopaminergic|Adult|Anatomy|has_image|... octopaminergic VPM4 neuron FBbt_00110152 catmaid_fafb 1191261 JRC2018Unisex Sayin2019 https://creativecommons.org/licenses/by-sa/4.0...
vc.get_connected_neurons_by_type(upstream_type='LNd', downstream_type='adult descending neuron', weight=20)

upstream_neuron_id upstream_neuron_name weight downstream_neuron_id downstream_neuron_name upstream_class downstream_class up_data_source up_accession down_source down_accession
0 VFB_jrchjzxx LNd_R - 5813021192 25 VFB_jrchjthm DNp27_R - 1072063538 LNd neuron descending neuron of the posterior brain DNp27 neuprint_JRC_Hemibrain_1point1 5813021192 neuprint_JRC_Hemibrain_1point1 1072063538
# Intra pacemaker neuron neuron connections

vc.get_connected_neurons_by_type(upstream_type='pacemaker neuron', downstream_type='pacemaker neuron', weight=20)

upstream_neuron_id upstream_neuron_name weight downstream_neuron_id downstream_neuron_name upstream_class downstream_class up_data_source up_accession down_source down_accession
0 VFB_jrchjzxy LNd_R - 5813069648 37 VFB_jrchk8e0 5th s-LNv - 511051477 LNd neuron s-LNv neuron neuprint_JRC_Hemibrain_1point1 5813069648 neuprint_JRC_Hemibrain_1point1 511051477
1 VFB_jrchk089 LPN_R - 480029788 43 VFB_jrchk08a LPN_R - 450034902 LP neuron LP neuron neuprint_JRC_Hemibrain_1point1 480029788 neuprint_JRC_Hemibrain_1point1 450034902
2 VFB_jrchjtf0 DN1pA_R - 324846570 25 VFB_jrchk8e0 5th s-LNv - 511051477 DN1p neuron s-LNv neuron neuprint_JRC_Hemibrain_1point1 324846570 neuprint_JRC_Hemibrain_1point1 511051477
3 VFB_jrchjtf0 DN1pA_R - 324846570 37 VFB_jrchjzxy LNd_R - 5813069648 DN1p neuron LNd neuron neuprint_JRC_Hemibrain_1point1 324846570 neuprint_JRC_Hemibrain_1point1 5813069648
4 VFB_jrchk8e0 5th s-LNv - 511051477 40 VFB_jrchjzxy LNd_R - 5813069648 s-LNv neuron LNd neuron neuprint_JRC_Hemibrain_1point1 511051477 neuprint_JRC_Hemibrain_1point1 5813069648
5 VFB_jrchjtf3 DN1pA_R - 387166379 25 VFB_jrchk8e0 5th s-LNv - 511051477 DN1p neuron s-LNv neuron neuprint_JRC_Hemibrain_1point1 387166379 neuprint_JRC_Hemibrain_1point1 511051477
6 VFB_jrchjtf1 DN1pA_R - 325529237 30 VFB_jrchjzxy LNd_R - 5813069648 DN1p neuron LNd neuron neuprint_JRC_Hemibrain_1point1 325529237 neuprint_JRC_Hemibrain_1point1 5813069648
7 VFB_jrchk8e0 5th s-LNv - 511051477 25 VFB_jrchjzxx LNd_R - 5813021192 s-LNv neuron LNd neuron neuprint_JRC_Hemibrain_1point1 511051477 neuprint_JRC_Hemibrain_1point1 5813021192
8 VFB_jrchjtez DN1pA_R - 5813010153 25 VFB_jrchk8e0 5th s-LNv - 511051477 DN1p neuron s-LNv neuron neuprint_JRC_Hemibrain_1point1 5813010153 neuprint_JRC_Hemibrain_1point1 511051477
9 VFB_jrchjzxy LNd_R - 5813069648 29 VFB_jrchjzxw LNd_R - 5813056917 LNd neuron LNd neuron neuprint_JRC_Hemibrain_1point1 5813069648 neuprint_JRC_Hemibrain_1point1 5813056917
10 VFB_jrchjtf2 DN1pA_R - 387944118 22 VFB_jrchk8e0 5th s-LNv - 511051477 DN1p neuron s-LNv neuron neuprint_JRC_Hemibrain_1point1 387944118 neuprint_JRC_Hemibrain_1point1 511051477
11 VFB_jrchjtf2 DN1pA_R - 387944118 34 VFB_jrchjzxy LNd_R - 5813069648 DN1p neuron LNd neuron neuprint_JRC_Hemibrain_1point1 387944118 neuprint_JRC_Hemibrain_1point1 5813069648
12 VFB_jrchjtf1 DN1pA_R - 325529237 33 VFB_jrchk8e0 5th s-LNv - 511051477 DN1p neuron s-LNv neuron neuprint_JRC_Hemibrain_1point1 325529237 neuprint_JRC_Hemibrain_1point1 511051477
13 VFB_jrchk08a LPN_R - 450034902 30 VFB_jrchk089 LPN_R - 480029788 LP neuron LP neuron neuprint_JRC_Hemibrain_1point1 450034902 neuprint_JRC_Hemibrain_1point1 480029788
14 VFB_jrchjtey DN1a_R - 5813022274 63 VFB_jrchk8e0 5th s-LNv - 511051477 DN1a neuron s-LNv neuron neuprint_JRC_Hemibrain_1point1 5813022274 neuprint_JRC_Hemibrain_1point1 511051477
15 VFB_jrchjtex DN1a_R - 264083994 55 VFB_jrchk8e0 5th s-LNv - 511051477 DN1a neuron s-LNv neuron neuprint_JRC_Hemibrain_1point1 264083994 neuprint_JRC_Hemibrain_1point1 511051477
16 VFB_jrchjtey DN1a_R - 5813022274 75 VFB_jrchjzxy LNd_R - 5813069648 DN1a neuron LNd neuron neuprint_JRC_Hemibrain_1point1 5813022274 neuprint_JRC_Hemibrain_1point1 5813069648
17 VFB_jrchjtex DN1a_R - 264083994 79 VFB_jrchjzxy LNd_R - 5813069648 DN1a neuron LNd neuron neuprint_JRC_Hemibrain_1point1 264083994 neuprint_JRC_Hemibrain_1point1 5813069648
18 VFB_jrchjtf3 DN1pA_R - 387166379 30 VFB_jrchjzxy LNd_R - 5813069648 DN1p neuron LNd neuron neuprint_JRC_Hemibrain_1point1 387166379 neuprint_JRC_Hemibrain_1point1 5813069648
19 VFB_jrchjzxy LNd_R - 5813069648 21 VFB_jrchjzxx LNd_R - 5813021192 LNd neuron LNd neuron neuprint_JRC_Hemibrain_1point1 5813069648 neuprint_JRC_Hemibrain_1point1 5813021192

vc.get_connected_neurons_by_type(upstream_type='adult neuron', downstream_type='adult Drosulfakinin neuron', weight=20)

upstream_neuron_id upstream_neuron_name weight downstream_neuron_id downstream_neuron_name upstream_class downstream_class up_data_source up_accession down_source down_accession
0 VFB_jrchjsj3 AstA1_L - 362473525 28 VFB_jrchjti4 DSKMP1B_R - 1352077058 adult neuron adult Drosulfakinin neuron neuprint_JRC_Hemibrain_1point1 362473525 neuprint_JRC_Hemibrain_1point1 1352077058
1 VFB_jrchk5zh SLP384_R - 482702027 20 VFB_jrchjti6 DSKMP3_R - 327937328 adult superior lateral protocerebrum neuron 384 adult Drosulfakinin neuron neuprint_JRC_Hemibrain_1point1 482702027 neuprint_JRC_Hemibrain_1point1 327937328
2 VFB_jrchjrjn AVLP001_R - 1321564092 26 VFB_jrchjti2 DSKMP1A_R - 1135837629 adult anterior ventrolateral protocerebrum neu... adult Drosulfakinin neuron neuprint_JRC_Hemibrain_1point1 1321564092 neuprint_JRC_Hemibrain_1point1 1135837629
3 VFB_jrchk5eo SLP066_R - 327843160 42 VFB_jrchjti4 DSKMP1B_R - 1352077058 adult superior lateral protocerebrum neuron 066 adult Drosulfakinin neuron neuprint_JRC_Hemibrain_1point1 327843160 neuprint_JRC_Hemibrain_1point1 1352077058
4 VFB_jrchk5qf SLP244_R - 298214577 27 VFB_jrchjti6 DSKMP3_R - 327937328 adult superior lateral protocerebrum neuron 244 adult Drosulfakinin neuron neuprint_JRC_Hemibrain_1point1 298214577 neuprint_JRC_Hemibrain_1point1 327937328
... ... ... ... ... ... ... ... ... ... ... ...
56 VFB_jrchk6zu SMP449_R - 5813026592 25 VFB_jrchjti4 DSKMP1B_R - 1352077058 adult superior medial protocerebrum neuron 449 adult Drosulfakinin neuron neuprint_JRC_Hemibrain_1point1 5813026592 neuprint_JRC_Hemibrain_1point1 1352077058
57 VFB_jrchk5jv SLP152_R - 487812620 28 VFB_jrchjti4 DSKMP1B_R - 1352077058 adult superior lateral protocerebrum neuron 152 adult Drosulfakinin neuron neuprint_JRC_Hemibrain_1point1 487812620 neuprint_JRC_Hemibrain_1point1 1352077058
58 VFB_jrchjrxe AVLP223_R - 1356743512 27 VFB_jrchjti2 DSKMP1A_R - 1135837629 adult anterior ventrolateral protocerebrum neu... adult Drosulfakinin neuron neuprint_JRC_Hemibrain_1point1 1356743512 neuprint_JRC_Hemibrain_1point1 1135837629
59 VFB_jrchk5qg SLP244_R - 297533212 33 VFB_jrchjti6 DSKMP3_R - 327937328 adult superior lateral protocerebrum neuron 244 adult Drosulfakinin neuron neuprint_JRC_Hemibrain_1point1 297533212 neuprint_JRC_Hemibrain_1point1 327937328
60 VFB_jrchk6g5 SMP157_R - 421041565 32 VFB_jrchjti4 DSKMP1B_R - 1352077058 adult superior medial protocerebrum neuron 157 adult Drosulfakinin neuron neuprint_JRC_Hemibrain_1point1 421041565 neuprint_JRC_Hemibrain_1point1 1352077058

61 rows × 11 columns

4 - Mapping

!pip install vfb-connect --upgrade
# Import libs and initialise API objects
from vfb_connect.cross_server_tools import VfbConnect
import pandas as pd

vc = VfbConnect()

import pymaid
import navis

navis.set_pbars(jupyter=False)
pymaid.set_pbars(jupyter=False)

# Connect to the VFB CATMAID server hosting the FAFB data
rm = pymaid.connect_catmaid(server="https://fafb.catmaid.virtualflybrain.org/", api_token=None, max_threads=10)

# Test call to see if connection works 
print(f'Server is running CATMAID version {rm.catmaid_version}')

# Many functions return JSON-compatible nested data structures. This function coverts them to DataFrame.
def summary_2_df(summary, sort=None):
    """Convert summary to DataFrame.  Optionally specify a set of columns to sort as a list of strings"""
    if sort:
        return pd.DataFrame.from_records(summary).sort_values(sort)
    else:
        return pd.DataFrame.from_records(summary)
WARNING: Could not load OpenGL library.
INFO  : Global CATMAID instance set. Caching is ON. (pymaid)
Server is running CATMAID version 2020.02.15-925-gf56795c9c

Mapping

Use case: If I have a single neuron, how can I find other neurons of the same or similar type within or between data sources?

Mapping via common parent type

# lets take some examples from a discovery query on the previous spreadhseet
sayin_tab = pd.DataFrame.from_records(vc.get_instances_by_dataset('Sayin2019', summary=True))
sayin_tab

label symbol id tags parents_label parents_id data_source accession templates dataset license
0 OA-VPM3 (FAFB:1329078) VFB_001001dr Entity|Octopaminergic|Adult|Anatomy|has_image|... octopaminergic VPM3 neuron FBbt_00110151 catmaid_fafb 1329078 JRC2018Unisex Sayin2019 https://creativecommons.org/licenses/by-sa/4.0...
1 OA-VPM4 (FAFB:1191261) VFB_001001dq Entity|Octopaminergic|Adult|Anatomy|has_image|... octopaminergic VPM4 neuron FBbt_00110152 catmaid_fafb 1191261 JRC2018Unisex Sayin2019 https://creativecommons.org/licenses/by-sa/4.0...
oct_VPM3 = summary_2_df(vc.get_instances('octopaminergic VPM3 neuron', summary=True))
oct_VPM3

label symbol id tags parents_label parents_id data_source accession templates dataset license
0 OA-VPM3(NO2/NO3)_R - 329566174 VFB_jrchk10d Entity|Octopaminergic|Adult|Anatomy|has_image|... octopaminergic VPM3 neuron FBbt_00110151 neuprint_JRC_Hemibrain_1point1 329566174 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
1 OA-VPM3(NO2/NO3)_L - 5813061260 VFB_jrchk10e Entity|Octopaminergic|Adult|Anatomy|has_image|... octopaminergic VPM3 neuron FBbt_00110151 neuprint_JRC_Hemibrain_1point1 5813061260 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le...
2 OA-VPM3 (FAFB:1329078) VFB_001001dr Entity|Octopaminergic|Adult|Anatomy|has_image|... octopaminergic VPM3 neuron FBbt_00110151 catmaid_fafb 1329078 JRC2018Unisex Sayin2019 https://creativecommons.org/licenses/by-sa/4.0...
oct_VPM3_images = vc.neo_query_wrapper.get_images(oct_VPM3['id'], stomp=True, template='JRC2018Unisex', image_folder = 'oct_VPM3b')
oct_VPM3_images

label symbol id tags parents_label parents_id data_source accession templates dataset license filename
0 OA-VPM3 (FAFB:1329078) VFB_001001dr Entity|Octopaminergic|Adult|Anatomy|has_image|... octopaminergic VPM3 neuron FBbt_00110151 catmaid_fafb 1329078 JRC2018Unisex Sayin2019 https://creativecommons.org/licenses/by-sa/4.0... OA_VPM3__FAFB_1329078_.swc
1 OA-VPM3(NO2/NO3)_L - 5813061260 VFB_jrchk10e Entity|Octopaminergic|Adult|Anatomy|has_image|... octopaminergic VPM3 neuron FBbt_00110151 neuprint_JRC_Hemibrain_1point1 5813061260 JRC_FlyEM_Hemibrain|JRC2018Unisex Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le... OA_VPM3_NO2_NO3__L___5813061260.swc
2 OA-VPM3(NO2/NO3)_R - 329566174 VFB_jrchk10d Entity|Octopaminergic|Adult|Anatomy|has_image|... octopaminergic VPM3 neuron FBbt_00110151 neuprint_JRC_Hemibrain_1point1 329566174 JRC2018Unisex|JRC_FlyEM_Hemibrain Xu2020NeuronsV1point1 https://creativecommons.org/licenses/by/4.0/le... OA_VPM3_NO2_NO3__R___329566174.swc
oct_VPM3_images = vc.get_images_by_type('octopaminergic VPM3 neuron', stomp=True, template='JRC2018Unisex', image_folder = 'oct_VPM3')
nl = navis.read_swc('./oct_VPM3')
navis.plot3d(nl)
Running query: FBbt:00110151
Query URL: http://owl.virtualflybrain.org/kbs/vfb/instances?object=FBbt%3A00110151&prefixes=%7B%22FBbt%22%3A+%22http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FFBbt_%22%2C+%22RO%22%3A+%22http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FRO_%22%2C+%22BFO%22%3A+%22http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FBFO_%22%7D&direct=False
Query results: 3