BATools 0.0.1 is an Atmosphere image that has R version 3.0.1 installed. BATools, an R package for Whole Genome Prediction, is also installed on this image.
To use BATools via VNC Viewer, follow these simple steps:
- Launch a new instance of BATools 0.0.1 from Atmosphere, and access it using VNC.
- Once you have access to the instance, open up the terminal by either clicking the black icon at the bottom of the screen, or by going to Application > Accessories > Terminal.
- Enter the command "R" (without the quotes) in the terminal window.
- Enter the command "library(BATools)" or "require(BATools)" to load the BATools package.
- Enter the command q() to quit R.
- Enter the command n as you do not need to save this image.
- Begin coding!
Using the BATools Wrapper Script
In order to make BATools easier to use, there is a wrapper script available (for general information on wrapper scripts follow this link). You can find this wrapper script on the iPlant Data Store, or below in the Additional Information section. The wrapper script takes a phenotype file, a genotype file, a function name, and some other parameters, and runs the given function for the given input files. In order to use this wrapper script, your input files (genotype and phenotype) must be in text format. To run the wrapper script:
- Use iDrop (or another file transfer method) to download the wrapper script and any necessary input files from the iPlant Data Store to your virtual machine. These files can be found under /iplant/home/shared/iplantcollaborative/example_data/BATools, or below under the Additional Information section below.
- Open up the terminal, either by clicking the icon at the bottom of the screen, or by going to Application > Accessories > Terminal.
- Invoke the R wrapper script using one of the following commands. Each command tests a specific function within BATools. There are several parameters to enter, so here are some examples of what the commands should look like for each function.
- The outputs for these tests will go into your current working directory.
You should be able to execute these commands by simply changing the file paths to the appropriate locations for your data then copying and pasting into the terminal as written.
This command will execute the BayesA function and output the results as space-delimited .txt files.
This command will execute the anteBayesA function and output the results as space-delimited .txt files.
This command will execute the BayesB function and output the results as space-delimited .txt files.
This command will execute the anteBayesB function and output the results as space-delimited .txt files.
Sample of output
If you copy and past one of the above links (with the option of changing your file paths) this is what the command output should look like)
Here are the descriptions for all of the parameters used by the BATools wrapper script. For a more detailed explanation, please see the BATools reference manual.
The phenotype (a numerical vector).
The genotype matrix (coded in "0/1/2").
The function to be executed ("BayesA", "BayesB", "anteBayesA", or "anteBayesB").
The type of results files you want BATools to produce ("text" outputs .txt files, "workspace" outputs .RData files, and "both" outputs both .txt and .RData files).
Describes how the genotype file is delimited ("comma", "space", and "tab" are currently the only accepted delimiters).
Describes how the output files are delimited ("comma", "space", and "tab" are currently the only accepted delimiters).
The starting value of pi, which is the ratio of SNP effect variance that is non-zero. When pi = 1, it is BayesA. Otherwise, it is BayesB.
The starting value of the degree of freedom parameter of SNP effect variance.
The starting value of the scale parameter of SNP effect variance.
The value of alpha for sampling pi.
The value of beta for sampling pi.
A boolean value. If truepi = TRUE, means we fix pi to the starting value; If truepi=FALSE, we sample pi.
A boolean value. If truedef = TRUE, means we fix the degree of freedom to the starting value; If truedef=FALSE, we sample the degree of freedom of SNP effect variances.
A boolean value. If truescale = TRUE, means we fix the scale to the starting value; If truescale=FALSE, we sample the scale of SNP effect variances.
A boolean value. If truet = TRUE, means we do not sample the antedependence association parameter t; If truet=FALSE, we sample t.
The number of iterations for MCMC sampling.
The number of iterations for skip.
The number of iterations for burnIn in MCMC sampling.
The seed for the random generator. NOTE: If Seed is left blank, it defaults to 1000. If Seed is set to -1, it defaults to the current system time.
Listed below are the example input files (which can also be found on the iPlant Data Store) and additional documentation for BATools.