# Installation

## Installation instructions for R packages

1. Make sure you have R installed. You can download it from http://cran.ma.imperial.ac.uk/.

Note: We recommend use the 2.15 version of R

1. For Mac users you will need to have installed the tcltk add-on for R. This can be downloaded from http://cran.r-project.org/bin/macosx/tools/tcltk-8.5.5-x11.dmg.

2. Open R console.

3. First install the dependencies which are required for the DvD package. Download the R script DvDdependencies.R, this script will automatically check for and if necessary install R packages required by DvD.

source("~/DvDdependencies.R") #where "~/" should be the directory where the source file is stored

install.packages("~/DrugVsDiseasedata_0.99.2.tar.gz",type="source") #note "~/" should point to the directory where the file is saved
library(DrugVsDiseasedata)

install.packages("~/cMap2data_0.99.1.tar.gz",type="source") #note "~/" should point to the directory where the file is saved
library(cMap2data)

install.packages("~/DrugVsDisease_1.1.2.tar.gz",type="source") #note "~/" should point to the directory where the file is saved
library(DrugVsDisease)


## Installation instructions for Cytoscape plug-in

1. Make sure you have installed DvD, DvDdata and dependencies as above. Install Rserve. It is a R package that enables communication between Java and R. Enter the following commands in R console:
install.packages("Rserve") # This command only needs to be typed once
library(Rserve)
Rserve(args="--vanilla")


Note: Rserve is only disabled if you restart your pc. Thus, if you want to use Rserve after reboot you have to call it again.
On Windows Rserve may also stop working if an error is encountered.

Note: We recommend use the 2.8.3 version of Cytoscape

1. Install DvD plugin.
 sudo apt-get install libcairo2-dev