diff --git a/unit_test/README.md b/unit_test/README.md index 0585fb7..4615e77 100644 --- a/unit_test/README.md +++ b/unit_test/README.md @@ -1,4 +1,4 @@ -This README includes the instruction on how to run the unit test for the Connectivity-based Psychometric Prediction (CBPP) project. Note that the unit test **runs on the INM7 server only**. +This README includes the instruction on how to run the unit test for the Connectivity-based Psychometric Prediction (CBPP) project. ## Reference @@ -6,7 +6,7 @@ Wu J, Eickhoff SB, Hoffstaedter F, Patil KR, Schwender H, Genon S. **A connectiv ## Data -The unit test script uses the Human Connectome Project (HCP) data. The downloaded data are in the folder: +The unit test script uses the Human Connectome Project (HCP) data. On the **INM7 server**, the downloaded data are in the folder: `/data/BnB3/BnB1/Raw_Data_nonBIDS/HCP` @@ -25,10 +25,22 @@ To run the unit test, call `unit_test.sh` with the following command: ./unit_test.sh -i /data/BnB3/BnB1/Raw_Data_nonBIDS/HCP -d /data/BnB2/Projects/jwu_HCP_Derivatives/unit_test_data -o $output_dir ``` -The whole-brain CBPP performance on test set will be compared to the default results in `/data/BnB2/Projects/jwu_HCP_Derivatives/unit_test_data/wbCBPP_SVR_standard_fix_parc300_Pearson_fixSeed.mat`. The parcel-wise CBPP performance on test set will be compared to the default resutls in `/data/BnB2/Projects/jwu_HCP_Derivatives/unit_test_data/pwCBPP_SVR_standard_fix_parc300_Pearson_fixSeed_parcel5.mat`. +The whole-brain CBPP performance on test set will be compared to the default results in `wbCBPP_SVR_standard_fix_parc300_Pearson_fixSeed.mat`. The parcel-wise CBPP performance on test set will be compared to the default resutls in `pwCBPP_SVR_standard_fix_parc300_Pearson_fixSeed_parcel5.mat`. The unit test is successful if the screen prints `The two volumes are identical` twice (for whole-brain and parcel-wise results respectively). This should take about `4h28m` to run. If only prediction steps need to be tested, put an existing combined FC file in `$out_dir/FC_combined/HCP_gsr_parc300_Pearson.mat` and add `-t 'light'` to the command. This light version of unit test should take about `17m` to run. + +## Running Unit Test Outside INM7 + +As the unit test uses HCP data, it is currently only tested on the **INM7 server**. In order to run the unit test outside INM7, the data need to be prepared in the same structure. + +For resting-state fMRI data, follow the description in the `Data` section, saving the data in `$fmri_dir`. Use the subject IDs of the first 50 subjects in `bin/sublist/HCP_surf_fix_allRun_sub.csv`. Save the psychometric data (N subject x P features matrix) as variable `y` in `$deriv_dir/unit_test_y.mat`. Save the confounding variables (N subject x C variables matrix) as variable `conf` in `$deriv_dir/unit_test_conf.mat`. + +Then call the unit test script with the following command: + +``` +./unit_test.sh -i $fmri_dir -d $deriv_dir -o $output_dir +``` \ No newline at end of file diff --git a/unit_test/pwCBPP_SVR_standard_HCP_gsr_parc300_Pearson_fixSeed_parcel5.mat b/unit_test/pwCBPP_SVR_standard_HCP_gsr_parc300_Pearson_fixSeed_parcel5.mat new file mode 100755 index 0000000..a7f584c Binary files /dev/null and b/unit_test/pwCBPP_SVR_standard_HCP_gsr_parc300_Pearson_fixSeed_parcel5.mat differ diff --git a/unit_test/unit_test.sh b/unit_test/unit_test.sh index 2bd5886..2b286c3 100644 --- a/unit_test/unit_test.sh +++ b/unit_test/unit_test.sh @@ -71,13 +71,13 @@ date # compare results and done echo "Comparing whole-brain CBPP results ..." wb_output=$output_dir/CBPP_perf/wbCBPP_SVR_standard_HCP_gsr_parc300_Pearson_fixSeed.mat -wb_compare=$deriv_dir/wbCBPP_SVR_standard_HCP_gsr_parc300_Pearson_fixSeed.mat +wb_compare=$ROOT_DIR/unit_test/wbCBPP_SVR_standard_HCP_gsr_parc300_Pearson_fixSeed.mat matlab -nodesktop -nosplash -r "addpath('$ROOT_DIR/unit_test'); \ unit_test_compare('$wb_output', '$wb_compare'); \ exit" echo "Comparing parcel-wise CBPP results ..." pw_output=$output_dir/CBPP_perf/pwCBPP_SVR_standard_HCP_gsr_parc300_Pearson_fixSeed_parcel5.mat -pw_compare=$deriv_dir/pwCBPP_SVR_standard_HCP_gsr_parc300_Pearson_fixSeed_parcel5.mat +pw_compare=$ROOT_DIR/unit_test/pwCBPP_SVR_standard_HCP_gsr_parc300_Pearson_fixSeed_parcel5.mat matlab -nodesktop -nosplash -r "addpath('$ROOT_DIR/unit_test'); \ unit_test_compare('$pw_output', '$pw_compare'); \ exit" @@ -98,9 +98,7 @@ usage() { echo " Usage: $0 -o output_dir This script parcellates and computes the connectivity of 50 HCP subjects and use the combined FC matrix for whole-brain and parcel-wise CBPP. -The prediction results should be compared to \$deriv_dir/wbCBPP_SVR_standard_gsr_parc300_Pearson_fixSeed.mat and \$deriv_dir/pwCBPP_SVR_standard_gsr_parc300_Pearson_fixSeed_parcel5.mat. - -Note that this unit test can only be run on the INM7 cluster. +The prediction results should be compared to wbCBPP_SVR_standard_gsr_parc300_Pearson_fixSeed.mat and pwCBPP_SVR_standard_gsr_parc300_Pearson_fixSeed_parcel5.mat respectively. REQUIRED ARGUMENTS: -i absolute path to input directory diff --git a/unit_test/wbCBPP_SVR_standard_HCP_gsr_parc300_Pearson_fixSeed.mat b/unit_test/wbCBPP_SVR_standard_HCP_gsr_parc300_Pearson_fixSeed.mat new file mode 100755 index 0000000..ee42895 Binary files /dev/null and b/unit_test/wbCBPP_SVR_standard_HCP_gsr_parc300_Pearson_fixSeed.mat differ