Written June 11, 2007 by Liberty Hamilton. Email or with questions.
Updated 02/17/2009 by Owen Phillips. Email if you have any questions.False Discovery Rate (FDR) Correction is a statistical method used in multiple hypothesis testing to correct for type I errors (false positives) in multiple comparisons. To run FDR with the batch commands specified below, you must have already generated probability maps in R. You can then provide either a p-value cutoff or a q-value to determine the false discovery rate for any given analysis. The output of these scripts will be a text file listing the FDR as a percentage value. If you wish to perform an FDR and output .ucf files as well as corrected p-values, you will have to use the anova_shape_fdr_hemispheres_batch.R batch script.
To run on the command line, you must first make sure that your account is set up to use R on cranium ("the grid"). To do this, follow these steps:
Side note: Notice that .Renviron is a hidden file, so you will not see it in your directory by running a simple ls. To list all of the files in a directory, including hidden files that start with a dot (.), type ls -a.
There are two FDR batch scripts that you can use: (1) compute_fdr_for_p_cutoff_batch.R and (2) compute_fdr_threshold_batch.R. These are both located in /ifs/woods/rshape/batch_commands/.
This batch script allows you to specify a p cut-off value and get false discovery rates for areas on your UCF that are significant to p less than or equal to a given cut-off. To run on the command line, you will need an input list file with the files for analysis. The input will look like this:
File
/fullpathtoyourdirectory/10101_genofx_L.ucf
/fullpathtoyourdirectory/10101_genofx_R.ucf
You must either do both hemispheres together, or if you want to analyze hemispheres separately, you will need to make text files with the hemisphere duplicated, like so:
File
/fullpathtoyourdirectory/10101_genofx_L.ucf
/fullpathtoyourdirectory/10101_genofx_L.ucf
Note that there MUST BE a carriage return after the last ucf file.
/ifs/woods/R/R-2.7.2/bin/R CMD BATCH --no-save --no-restore --quiet --args -listInputlist.txt -plevel0.05 /ifs/woods/rshape/batch_commands/compute_fdr_for_p_cutoff_batch.R /mydirectory/FDR_outputp0-05.txt
In statistics, the Q value is the minimum false discovery rate at which the test may be called significant. To compute false discovery rates for a q-value cut-off, use the compute_fdr_threshold_batch.R batch script in /ifs/woods/rshape/batch_commands/. To run on the command line, you will need a few things ready first. As before, you will need your input .txt file. Here is a sample command line (remember the qsub stuff goes first so that the job will be submitted to the grid):
qsub -b y -q long.q /ifs/woods/R/R-2.7.2/bin/R CMD BATCH --no-save --no-restore --quiet --args -list/yourdirectory/list.txt -qlevel0.05 /ifs/woods/rshape/batch_commands/compute_fdr_theshold_batch.R /yourdirectory/genotypeeffect_q0-05.txt
You can also do the same things described above by running FDR in the pipeline (also see the Pipeline User Guide for more help with pipeline related issues). This is very convenient, as you can provide lists of the text files and output files to run FDR correction in parallel for many jobs.
As mentioned earlier, you may not want to display uncorrected data in your results figures if your effect is very robust. In this case, you could run an ANOVA with FDR correction to obtain both the FDR and the .ucf file.
/ifs/woods/R/R-2.7.2/bin/R CMD BATCH --no-save --no-restore --quiet --args -table/path/LeftTextFile.txt -table2/path/RightTextFile.txt -formulay~sex+age+group -reducedy~sex+age -output/path/LFDRoutput.ucf -output2/path/RFDRoutput.ucf /ifs/woods/rshape/batch_commands/anova_shape_fdr_hemispheres_batch.R /path/LR_FDR_output.txt
© 2014 BMAP. All rights reserved.