This is a script for human imaging transcriptomics analysis using Allen Human Brain Atlas (AHBA). The script is used in R and some python scripts are called via the reticulate package.
The idea of imaging transcriptomics was reviewed and introduced in:
- A practical guide to linking brain-wide gene expression and neuroimaging data
- Toward Best Practices for Imaging Transcriptomics of the Human Brain
- Chapter 14 - Uncovering the genetics of the human connectome
The codes were tested on Windows 10/11 system with R 4.4.1 and python 3.9.7.
We mainly focuse on Regional Gene Expression, a small part of Imaging Transcriptomics (See the 'second type' in PHASE 2: RELATING EXPRESSION AND NEUROIMAGING MEASURES in Arnatkeviciute et al.).
You can obtain the source code either by using git or by downloading it manually. Since the scripts are not currently packaged as an R package, there is no installation process required.
python packages requirement:
- pyls (should be downloaded from github and installed)
- neuromaps (Connectome Workbench is needed)
- brainsmash (Connectome Workbench is needed)
- abagen
R packages needed can be found in ./R/base/load_packages.R for main analysis and in corresponding scripts in ./R/Plots for visualization.
What you need is to prepare a single 3D brain imaging file in Nifti format (.nii or .nii.gz). It can either be a statistic map or other imaging phenotypes (IMPORTANT: Only volume data in MNI152 standard space is supported now). You can open the demo.qmd file in the ./R folder, which provides a complete example of the analysis workflow along with detailed explanations of each step. Referring to this file can help guide you in conducting your own imaging transcriptomics analysis.
reticulatecrash or similar problems: py_run_file_impl() crashing since .v1.27: ReinstallRmight help.Error in serialize(data, node$con): error writing to connection: This may be related to insufficient memory, especially for GSEA analysis of multiple PLS components.
- Tight fitting genes: finding relations between statistical maps and gene expression patterns (repo: https://github.com/chrisgorgo/alleninf)
- Integrating neuroimaging and gene expression data using the imaging transcriptomics toolbox (repo: https://github.com/alegiac95/Imaging-transcriptomics)
Highlight: Compared with these toolboxes, our processing workflow allows the use of any user-provided brain atlas/parcellations in the MNI space, and offer different statistic methods to link spatial gene expression with brain imaging such as partial least squares regression (PLSR), linear regression, and weighted gene coexpression network analysis (WGCNA).
[1] Wang Y, Ye C, Pan R, Tang B, Li C, Liu J, Tao W, Zhang X, Yang T, Yan Y, Jiang S, Lui S, Wu B. Cognitive implications and associated transcriptomic signatures of distinct regional iron depositions in cerebral small vessel disease. Alzheimers Dement. 2025 Apr;21(4):e70196. doi: 10.1002/alz.70196. PMID: 40257048.