Skip to content
Snippets Groups Projects
Commit 4b4d9d47 authored by jugex push 2's avatar jugex push 2
Browse files

creating file

parent 0e56d679
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
# Differential gene expression analysis in two brain regions
JuGEx performs differential gene expresssion in two different brain regions, as described in the publication
> *Sebastian Bludau, Thomas W. Mühleisen, Simon B. Eickhoff, Michael J. Hawrylycz, Sven Cichon, Katrin Amunts. Integration of transcriptomic and cytoarchitectonic data implicates a role for MAOA and TAC1 in the limbic-cortical network. 2018, Brain Structure and Function. https://doi.org/10.1007/s00429-018-1620-6*
For the gene expression data, `siibra` accesses the Allen Brain Atlas API (© 2015 Allen Institute for Brain Science. Allen Brain Atlas API. Available from: brain-map.org/api/index.html).
%% Cell type:markdown id: tags:
### Initialize the analysis
The analysis is initialized with a `siibra` atlas object. It will check if the parcellation selected in the atlas is suitable for performing the analysis, which includes to verify that the given atlas object provides maps in the MNI ICBM 152 space. We explicitely select the Julich-Brain probabilistic cytoarchitectonic maps, and tell the atlas to threshold the probability maps for filtering gene expressions instead of using the simplified labelled volume.
%% Cell type:code id: tags:
``` python
!pip install 'siibra>=0.3a17,<0.4' 'siibra-jugex==1.0.1'
```
%% Cell type:code id: tags:
``` python
import siibra, siibra_jugex
from packaging import version
assert version.parse('0.3a30') > version.parse( siibra.__version__ ) and version.parse( siibra.__version__ ) >= version.parse('0.3a17')
assert version.parse( siibra_jugex.__version__ ) >= version.parse('0.2')
```
%% Cell type:code id: tags:
``` python
atlas = siibra.atlases['human']
julichbrain = atlas.get_parcellation("julich")
jugex = siibra_jugex.DifferentialGeneExpression(julichbrain)
```
%% Cell type:markdown id: tags:
### Configure the experiment with brain regions and candidate genes
The analysis is configured by specifying some candidate genes of interest, and two regions of interest (ROI) specified by brain area names that the atlas object can resolve. Note that the siibra atlas class does fuzzy string matching to resolve region names, so you can try with a simple name of the regions to see if siibra interprets them. Also, gene names can easily be looked up and autocompleted in siibra.gene_names.
%% Cell type:code id: tags:
``` python
# set analysis parameters
candidate_regions = ["Area hOc1 (V1, 17, CalcS) left", "Area Fp1 (FPole) left"]
candidate_genes = ["CHRM2"]
threshold = 0.2
permutations = 100
jugex.add_candidate_genes(candidate_genes)
jugex.define_roi1(candidate_regions[0], maptype=siibra.MapType.CONTINUOUS, threshold=threshold)
jugex.define_roi2(candidate_regions[1], maptype=siibra.MapType.CONTINUOUS, threshold=threshold)
```
%% Cell type:markdown id: tags:
### Run the analysis
%% Cell type:code id: tags:
``` python
result = jugex.run(permutations=permutations)
print(result['p-values'])
```
%% Cell type:markdown id: tags:
The aggregated input parameters can be stored to disk.
%% Cell type:code id: tags:
``` python
jugex.save('jugex_{}_{}.json'.format(
"_".join(candidate_regions),
"_".join(candidate_genes) ))
```
%% Cell type:markdown id: tags:
### Look at filtered positions of microarray samples in MNI space
%% Cell type:markdown id: tags:
Let's have a look at the sample positions that have been found in the Allen atlas. Since we configured brainscapes to prefer thresholded continuous maps for region filtering over the simplified parcellation map, we also plot the probability maps here.
%% Cell type:code id: tags:
``` python
from nilearn import plotting
for regionname in candidate_regions:
samples = jugex.get_samples(regionname)
region = atlas.get_region(regionname)
pmap = region.get_regional_map(
siibra.spaces.MNI152_2009C_NONL_ASYM,
siibra.MapType.CONTINUOUS)
# we could have also used the simple parcellation map mask as follows:
# mask = atlas.get_mask(bs.spaces.MNI_152_ICBM_2009C_NONLINEAR_ASYMMETRIC)
display = plotting.plot_roi(pmap.fetch(),cmap="jet",title=region.name)
display.add_markers([s['mnicoord'] for s in samples.values()])
```
%% Cell type:code id: tags:
``` python
```
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment