Note
Go to the end to download the full example code.
Gene expressions
siibra can query gene expression data from the Allen brain atlas. The gene
expressions are linked to atlas regions by coordinates of their probes in MNI
space. When querying feature by a region, siibra automatically builds a
region mask to filter the probes.
Hint
This feature is used by the JuGEx toolbox, which provides an implementation for differential gene expression analysis between two different brain regions as proposed by Bludau et al.
import siibra
from nilearn import plotting
We select a brain region and query for expression levels of GABARAPL2.
region = siibra.get_region("julich 2.9", "V1")
features = siibra.features.get(
region, siibra.features.molecular.GeneExpressions,
gene=siibra.vocabularies.GENE_NAMES.GABARAPL2
)
print(features[0])
# Take a peek at how the data looks
features[0].data.head()
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/siibra-python/checkouts/doc_test_ng_resolve/examples/03_data_features/004_gene_expressions.py", line 40, in <module>
features = siibra.features.get(
^^^^^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/siibra-python/checkouts/doc_test_ng_resolve/siibra/features/feature.py", line 593, in _match
live_instances = feature_type._livequery(concept, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/siibra-python/checkouts/doc_test_ng_resolve/siibra/features/feature.py", line 494, in _livequery
features = q.query(concept)
^^^^^^^^^^^^^^^^
File "/home/docs/checkouts/readthedocs.org/user_builds/siibra-python/checkouts/doc_test_ng_resolve/siibra/livequeries/allen.py", line 144, in query
raise InvalidAllenAPIResponseException(
siibra.livequeries.allen.InvalidAllenAPIResponseException: The service "web API of the Allen Brain Atlas for the human microarray expression" is not available at the moment, therefore siibra is not able to fetch gene expression features. This is a known issue which we are investigating: https://github.com/FZJ-INM1-BDA/siibra-python/issues/636.
Since gene expressions are spatial features, let’s check the reference space of the results.
space = features[0].anchor.space
print(space)
Plot the locations of the probes that were found, together with the region mask of V1.
all_coords = [p.coordinate for p in features[0].anchor.location]
mask = region.get_regional_mask(space)
display = plotting.plot_roi(mask.fetch())
display.add_markers(all_coords, marker_size=5)
Total running time of the script: (0 minutes 0.386 seconds)
Estimated memory usage: 722 MB