%\VignetteIndexEntry{04 - Experimental Features}
%\VignetteKeywords{High-performance computing}
%\VignettePackage{oligo}
\documentclass{article}

\newcommand{\Rfunction}[1]{{\texttt{#1}}}
\newcommand{\Rmethod}[1]{{\texttt{#1}}}
\newcommand{\Rcode}[1]{{\texttt{#1}}}
\newcommand{\Robject}[1]{{\texttt{#1}}}
\newcommand{\Rpackage}[1]{{\textsf{#1}}}
\newcommand{\Rclass}[1]{{\textit{#1}}}
\newcommand{\oligo}{\Rpackage{oligo }}

\begin{document}
\title{Experimental Features}
\date{April, 2009}
\author{Benilton Carvalho}
\maketitle

\section{Experimental Features}

Starting on series 1.12.x, the \oligo package offers (experimental) high performance computing features:

\begin{itemize}
\item \textbf{Support to larger datasets; and}
\item \textbf{Support to parallel computing.}
\end{itemize}

These features are initially available for RMA methods on
Expression/Gene/Exon arrays and will be implemented in other methods as
necessity arrives.

The use of such features is as simple as loading the required packages
(and setting a cluster option, if parallel computing is desired). The
methods themselves are able to detect if these experimental features are
enabled and use them if possible, without any modification of the method
call.

\section{Support to large datasets}

The \oligo package uses the features implemented by the \Rpackage{ff}
package (preferably version >= 2.1-4) to provide a better support to
large datasets.

If the user prefers not to use the \Rpackage{ff} package, then regular R
objects are used and the usual memory restrictions apply.

The support to large datasets is enabled by simply loading the
\Rpackage{ff} package. Once that is done, \Rpackage{oligo} saves ff
files to the directory pointed by \Rcode{ldPath()}.

<<>>=
library(oligo)
library(ff)
ldPath()
@ 

Methods (rma) uses batches to process data. When possible (eg.,
background correction), it uses at most \Rcode{ocSamples()} samples
simultaneously at processing. For procedures that process probes (like
summarization), a maximum of \Rcode{ocProbesets()} are used
simultaneously. Therefore, the user should tune these parameters for a
better performance.

<<>>=
ocSamples()
ocSamples(50) ## changing default to 50
ocProbesets()
ocProbesets(100) ## changing default to 100
@ 

<<eval=FALSE>>=
  library(oligo)
  library(ff)
  rawData <- read.celfiles(list.celfiles())
  rmaRes <- rma(rawData)
  exprs(rmaRes)[1:10,]
@ 
 
\section{Parallel computing}

The \oligo package can make use of a parallel environment (with
\Rcode{rma} in the meantime) set via \Rpackage{snow} package, as long as
the user:

\begin{itemize}
  \item enables support to large datasets (load \Rpackage{ff});
  \item loads the \Rpackage{snow} package;
  \item sets the cluster variable with \Rcode{snow::makeCluster()}.
\end{itemize}

A simple example is shown below:

<<>>=
library(ff)
library(snow)
options(cluster=makeCluster(2, "SOCK"))
library(oligo)
@ 
<<eval=FALSE>>=
rawData <- read.celfiles(list.celfiles())
rmaRes <- rma(rawData)
rma
@ 

\section{Details}

This document was written using:

<<>>=
sessionInfo()
@ 

\end{document}
