This documents describes installation of the CollapsABEL package and provides a small example. The code here has been tested on a machine with Ubuntu 14.04 64 bit. Similar procedure can be adapted to Mac OS X. The currently version of CollapsABEL does not support Windows.
To use the latest version of R, edit /etc/apt/sources.list and add the line:
deb http://cran-mirror.cs.uu.nl/bin/linux/ubuntu trusty/
Change trusty to your Ubuntu version, of course. You can also use a different mirror site. Then you can update the list of available software. In terminal:
sudo apt-get update
If you get an error similar to the following:
W: GPG error: http://cran-mirror.cs.uu.nl trusty/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9
You need to import the gpg public key. In terminal:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 51716619E084DAB9
Just replace the key with what you see in your error message. Now you can install R. In terminal:
sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libxml2 r-base wget liblzma-dev
In terminal:
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java8-installer oracle-java8-set-default
In terminal:
sudo R CMD javareconf
The above command should be able to recognize the Java installation on your system, and should emit some message like this:
Java interpreter : /usr/bin/java
Java version : 1.8.0_60
Java home path : /usr/lib/jvm/java-8-oracle/jre
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
trying to compile and link a JNI program
detected JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux
detected JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/lib/jvm/java-8-oracle/jre/../include -I/usr/lib/jvm/java-8-oracle/jre/../include/linux -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c conftest.c -o conftest.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o conftest.so conftest.o -L/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server -ljvm -L/usr/lib/R/lib -lR
JAVA_HOME : /usr/lib/jvm/java-8-oracle/jre
Java library path: $(JAVA_HOME)/lib/amd64/server
...
Add linking library path of JVM in ~/.bashrc
:
export LD_LIBRARY_PATH=/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server:$LD_LIBRARY_PATH
Go to PLINK2 website and download the package, extract it and put the plink2
executable in your $PATH
, /usr/local/bin
, for example (if you are the administrator of the machine).
In terminal:
cd /tmp
wget https://bitbucket.org/kindlychung/collapsabel/downloads/testfiles.zip
unzip -o testfiles.zip
rm testfiles.zip
cd CollapsABEL_test
In R:
library(CollapsABEL)
rbed_info = rbedInfo(bedstem = "test", TRUE)
pl_gwas = plGwas(rbed_info,
pheno = "test.phe",
pheno_name = "y",
covar_name = "sex,age",
gwas_tag = "test_y_sex_age")
gcdh_report = getQuery(gcdhReport(gcdh_res), "select * from gcdh_report")
head(gcdh_report)
mydata = manhattanData(gcdh_report$CHR1, gcdh_report$BP1, gcdh_report$P1, gcdh_report$SNP1)
myplot = manhattanPlot(mydata)
library(ggplot2)
ggsave("/tmp/mplot.png", myplot, width = 10, height = 5)