Use FVGWASgui.m to run the GUI of the FVGWAS method.

If you just want to run the association between ROIs and SNPs, you do not need to input image index and image size.

Some data are included in this folder, you can run FVGWASgui.m with these example data. Also, you can use your own data to run FVGWASgui.m.


Inputs:
N0 is the number of top SNPs. 
G is the number of bootstrap samples. 
Covariates is an n*d matrix.
Data is the image data, it is an n*V matrix, n is number of subjects and V is number of voxels.
SNP is gene data, it is an n*C matrix, n is number of subjects and C is number of SNPs.
Image index is the index of image data, it is a V*1 vector.
Image size is the size of image data, it is a 1*3 vector in real data or a 1*2 vector in simulated data.

After you input all variables, you should choose the directory of the outputs, you then can begin to run this program. 

If you choose a wrong file when you input variables, you can press Clear button to clear all variables and input all variables again.

Outputs:
A 'GSISresults.mat' file: results of GSIS step, pp is -log_10{p-values} of all gene data.
A 'bootstrapsamples.mat' file: Wgmax is the bootstrap samples of W_{\mathcal V, \widetilde{\mathcal C}_0} and Ngmax is the bootstrap samples of N(\mathcal C, \alpha_I).
A 'voxelclusterandSNP.mat' file: pv is the corrected p-values for voxel-SNP level, it is a C*V matrix.
Cluster is the cluster results, it is a C*1 cell, each cell contains clusters' p-values, sizes, and a volume indicates the locations of clusters in image.
rawpvalue is the raw p-values for voxel-SNP level,it is a C*V matrix.
Output Cluster is 0 if you just want to run the association between ROIs and SNPs.


In the GUI folder, there are some simulated data can be used to repeat some simulation experiments in the FVGWAS paper. Gene effect, number of subjects, number of causal SNPs, standard deviation of measurement error, and ROI size were set to 0.01, 1000, 100, 1, and 10, respectively.
Covariates correspondings to covariates.mat file, Data correspondings to Imagedata.mat file, SNP correspondings to SNPdata_1000.txt file, Image index correspondings to imageindex.mat file, and Image size correspondings to imagesize.mat file.
N0 and G can be set to 100 and 1000, respectively.