S-BrainXcan takes GWAS as input and return the association between GWAS phenotype and a list of brain image-derived phenotypes.

BrainXcan manuscript link.

Software documentation (Quick start) link.

BrainXcan database link.

Analysis scripts link.

Installation notes

Software dependencies

The software is built upon both Python and R scripts along with some standalone executables. Here we provide a conda environment containing all the Python dependencies and snakemake.

conda env create -f environment.yml

Also, install plink 1.9 which will be used for LD clumping in MR analysis.

By default, the pipeline call python, Rscript, and plink as is. And you can provide the path to the desired executables in the configuration file. For instance,

# in config.[name].yaml
rscript_exe: 'path-to/Rscript'
python_exe: 'path-to/python'
plink_exe: 'path-to/plink'

Standalone R

R dependencies are: ggplot2, dplyr, optparse, logging, rmarkdown, pdftools, patchwork, oro.nifti, data.table, pander, arrow, TwoSampleMR.

Below, we provide an example for installing R dependencies as a conda environment. Any standalone R installation with these dependent packages being installed should work just fine.

`$ conda create -n r_36 -y $ conda activate r_36 (r_36) $ conda install -c r r (r_36) $ conda install -c conda-forge r-arrow (r_36) $ conda install -c conda-forge r-pdftools (r_36) $ conda install -c conda-forge r-gmp (r_36) $ conda install -c conda-forge r-rio (r_36) $ conda install -c conda-forge r-pander (r_36) $ conda install -c conda-forge r-sf (r_36) $ conda install -c conda-forge r-stars (r_36) $ conda install -c conda-forge r-plotly (r_36) $ conda install -c conda-forge r-ggnewscale (r_36) $ R

inside R

install.packages(c(‘ggplot2’, ‘dplyr’, ‘logging’, ‘optparse’, ‘rmarkdown’, ‘patchwork’, ‘oro.nifti’, ‘data.table’, ‘remotes’, ‘raster’, ‘rgeos’)) remotes::install_github(“MRCIEU/TwoSampleMR”)`

** Content copied from


Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The source code is licensed under MIT.

Suggest changes

If you find any mistakes (including typos) or want to suggest changes, please feel free to edit the source file of this page on Github and create a pull request.


For attribution, please cite this work as

Yanyu Liang (2021). BrainXcan Brain Feature Prediction Models. PredictDB. /post/2021/07/22/brainxcan-brain-feature-prediction-models/

BibTeX citation

  title = "BrainXcan Brain Feature Prediction Models",
  author = "Yanyu Liang",
  year = "2021",
  journal = "PredictDB",
  note = "/post/2021/07/22/brainxcan-brain-feature-prediction-models/"