Latest update: 2019-01-21
Weikang Gong. et al, "Statistical testing and power analysis for brain-wide association study." Medical image analysis 47 (2018): 15-30.
Edmund T. Rolls, et al. "Functional connectivity of the anterior cingulate cortex in depression and in health." Cerebral Cortex 1 (2018): 14.
Brain-wide association study is a method to analyse voxel-by-voxel resting-state fMRI data. It simply involves (1) calculating the functional connectivities between pairwise voxel across the whole brain; (2) testing the difference/correlation between functional connectivities and a phenotype of interests; (3) performing multiple comparison correction using a novel Gaussian Random Field-based approach, which generalized the widely-used cluster-size inferece to functional connectivities. So intuitively, what is cluster-size inference on functional connectivities (FC), or what is FC cluster? It is just a bundle of connectivities between two voxel clusters. We are actually testing whether there are many FCs (with p-value < certain cluster-defining threshold) connecting two voxel clusters (just like in the volume analysis we test the size of the observed voxel cluster is large by chance). This software package implement the idea of FC clusters, but also performs such a huge number of calculations (correlation matrix + GLM statistics) efficiently. It no longer has a memory requirement on your computer (but better > 16 GB), and supports both python 2.7 and 3.6, and Linux/Mac/Windows system.
This is the development version of BWAS, bug report is wellcome!
- System: Linux/Mac/Windows.
- Python 2.7 or 3.6 (Anaconda is recommended).
- Python modules: copy, glob, numpy, scipy, matplotlib, nilearn, nibabel, joblib, multiprocessing, PyPDF2.
-
Toolbox directory: The absolute directory of the BWAS code.
-
fMRI data: Please put all your preprocessed rfMRI data in a directory (.nii.gz or nii format). The software will read data in alphabetical order according to the names of your rfMRI data.
-
variable of interest file: One or multiple columns. The file format should be either a ".txt" file or a ".npy" file, with each row representing a subject and column representing a variable. The number of rows should be the same as the number of subjects, the order should be also in alphabetical order according to the names of your rfMRI data. (Note: we only support binary and continuous phenotypes, e.g. for case-control study, the labels of two groups are 0 and 1).
-
covariates file: Multiple columns. The file format should be either a ".txt" file or a ".npy" file, with each row representing a subject and each column representing a variable. (Note: you can only include binary and continuous variables here, categorical variable should be transformed to dummy variables (multiple columns of 0 and 1)).
-
mask_file: a binary mask (.nii.gz or .nii format) of your fMRI data.
-
CDT: cluster defining threshold (z-value), usually >=5 to meet the assumption of RFT.
-
Memory limit: the maxmum memory to use per CPU (in GB).
-
Number of cores: usually the more the faster. (Memory limit x Number of cores) must be smaller than your total avaliable CPU memory.
-
Output directory: the absolute directory to save all the outputs.
- All the source code is in the file: BWAS_cpu.py
- To run it in command line, please use the file: BWAS_main.py; You can type: python BWAS_main.py -h to see the help;
- To run it in GUI, please use the file: BWAS_gui.py; You can type: python BWAS_gui.py to open the gui, the input should be the same as BWAS_main.py. After enter all the things, press "run BWAS interactively" or "run BWAS in background" to perform the analysis (Do not forget to press the save button after you enter CDT, Memory limit and Number of cores).
In the Output directory,
- BWAS_result_CDT=?.mat: the infomation of all FC with |Z|> CDT, including the matrix coordinates and MNI coordinates and the corresponding Z-statistics of each FC.
- 'MA_CDT=?_x.jpg','MA_CDT=?_y.jpg','MA_CDT=?_z.jpg': the figures of the number of significant FCs in each voxel.
- 'MA_CDT=??.nii.gz': the number of significant FCs in each voxel.
- BWAS_FC_clusters_plot.pdf: Each figure represent a FC cluster, connecting the left voxel-cluster and the right voxel-cluster, the values on the voxels shows the number of FCs connecting it that pass FC cluster based correction.
- ./FC_cluster_files/FC_cluster_?+'1.nii.gz, ./FC_cluster_files/FC_cluster?+'_2.nii.gz: the nifti files to generate the above pictures.
- brain_gl_negative.txt and brain_gl_positive.txt: the file you can put into braingl software (https://code.google.com/archive/p/braingl/) to visualize the voxel-by-voxel FCs. You should use "braingl_bg.nii.gz" as background.
Author: Weikang Gong
Email: [email protected]
You may also find sKPCR is useful: https://github.com/weikanggong/sKPCR.