Getting set up with R and the BAM code

Instructions are given for Windows and for Unix/Linux.
The procedure for MacOS should be similar to that for Windows.

1) Windows

R for Windows can be downloaded from http://cran.r-project.org/bin/windows/base/

The miniR installation should be sufficient.

R should install into a folder called something like   C:\Program Files\R\rw1030
(The version number may differ from 1030).

Open this folder, and save the text file bambundle.R into it, keeping this name.
The file can be opened with Notepad if required.

Note: it is advisable to use your browser's "Save As" facility, rather than copying
and pasting the text into a new file. Copying and pasting can cause lines to wrap
awkwardly and introduce bugs into the code.

Start R, by clicking on the blue capital R symbol in this folder or on the desktop.

Type

> source("bambundle.R")

The code is now ready for use. Try it out with

> mymaps <- makemap.func(40, 40)

> bam.func(mymaps, radius=1.5)

(this may take a few seconds).

See the demonstration here for full use and how to run the code with your own data.

R can be exited with the command

> q()

Respond "yes" to "Save workspace image?" to ensure that the BAM functions remain installed in R.
If you answer "no", the command source("bambundle.R") will be needed again the next time you start R.


2) Unix/ Linux

R for Unix and Linux can be downloaded from: http://cran.r-project.org/.

Create a directory for work with the BAM code (e.g. mkdir BAM).
Save the text file bambundle.R into this directory, keeping this name.

Note: it is advisable to use your browser's "Save As" facility, rather than copying
and pasting the text into a new file. Copying and pasting can cause lines to wrap
awkwardly and introduce bugs into the code.

Start R from this directory, by typing R.

Type

> source("bambundle.R")

The code is now ready for use. Try it out with Try it out with

> mymaps <- makemap.func(40, 40)

> bam.func(mymaps, radius=1.5)

(this may take a few seconds).

See the demonstration here for full use and how to run the code with your own data.

R can be exited with the command

> q()

Respond "yes" to "Save workspace image?" to ensure that the BAM functions remain installed in R.
If you answer "no", the command source("bambundle.R") will be needed again the next time you start R.