% -*- mode:Latex -*-
%\VignetteIndexEntry{Vignette for the documentation by value package (docval)}
%\VignetteDepends{}
%\VignetteKeywords{add-on preprocessing microarray svn rma}
%\VignettePackage{docval}

%% check whether we are running pdflatex
%%--------------------------------------
\newif\ifpdf
  \ifx\pdfoutput\undefined
  \pdffalse                 % we are not running pdflatex 
\else
  \pdfoutput=1              % we are running pdflatex 
  \pdfcompresslevel=9       % compression level for text and image;
  \pdftrue
\fi

%% choose global options depending on whether 
%% we are running under pdflatex
%%-------------------------------------------        
\ifpdf
  \documentclass[a4paper, 12pt, fleqn]{article}  
  \usepackage[pdftex]{graphicx}
  \usepackage[pdftex]{color}
  \usepackage[pdftex,linktocpage]{hyperref}
  \hypersetup{pdfstartview={FitH},
              pdfpagemode={UseOutlines},
              pdftitle={},
              pdfauthor={Dennis Kostka},
              pdfsubject={}}
  \usepackage[pdftex]{graphicx}
  \usepackage{thumbpdf}
\else
  \documentclass[a4paper, 12pt, fleqn]{article}
  \usepackage[dvips]{graphicx}
  \usepackage[dvips]{color}
  \usepackage{hyperref}
  \usepackage{psfig}
\fi

%% packages
%%---------
\usepackage[a4paper,left=3cm,right=3cm,top=3.5cm,bottom=3.5cm,nohead]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{yfonts}
\usepackage{amssymb}
\usepackage{latexsym}  
\usepackage{array}
\usepackage[numbers]{natbib}
\usepackage{color}
\usepackage{sectsty}
\usepackage{colortbl}
%% page style:
%%------------
\setlength{\parskip}{0ex}%{1.5ex}
\setlength{\parindent}{0cm}
%\allsectionsfont{\sffamily}


\definecolor{lg}{rgb}{0.9,0.9,0.9}
\definecolor{dg}{rgb}{0.6,0.6,0.6}


%% some new commands
%%------------------
%% bold symbols (vectors)
\newcommand{\bbet}{\boldsymbol{\beta}}
\newcommand{\bbett}{\boldsymbol{\beta}^{\prime}}
\newcommand{\balph}{\boldsymbol{\alpha}}
\newcommand{\bsig}{\boldsymbol{\sigma}}
\newcommand{\bx}{\boldsymbol{x}}
\newcommand{\by}{\boldsymbol{y}}
\newcommand{\bX}{\boldsymbol{X}}
\newcommand{\bY}{\boldsymbol{Y}}
\newcommand{\bK}{\boldsymbol{K}}
\newcommand{\bmu}{\boldsymbol{\mu}}
\newcommand{\bt}{\boldsymbol{\tau}}
\newcommand{\bvth}{\boldsymbol{\vartheta}}
%% bold symbols (matrices)
\newcommand{\BA}{\mathbf{A}}
\newcommand{\BX}{\mathbf{X}}
\newcommand{\BK}{\mathbf{K}}
\newcommand{\BB}{\mathbf{B}}
\newcommand{\BW}{\mathbf{W}}
\newcommand{\BSig}{\mathbf{\Sigma}}
%% indexed vectors
\newcommand{\bxi}{\boldsymbol{x}^{\,(i)}}
\newcommand{\byi}{\boldsymbol{y}^{\,(i)}}
\newcommand{\bXa}{\boldsymbol{X}}
%% sets and spaces
\newcommand{\mcD}{\mathcal{D}}
\newcommand{\mcK}{\mathcal{K}}
\newcommand{\mcF}{\mathcal{F}}
\newcommand{\mcH}{\mathcal{H}}
\newcommand{\mcL}{\mathcal{L}}
\newcommand{\mcN}{\mathcal{N}}
%% colors
\newcommand{\red}[1]{\textcolor{red}{#1}}
\newcommand{\blue}[1]{\textcolor{blue}{#1}}
\newcommand{\green}[1]{\textcolor{green}{#1}}
\newcommand{\gray}[1]{\textcolor{greay}{#1}}
%% misc
\newcommand{\phead}[1]{{ \flushleft \sf\small\textbf{#1}\quad}}
\newcommand{\mbf}{\mathbf}
\newcommand{\arsinh}{\mbox{arsinh}} 
\newcommand{\Ys}{Y^\star}
\newcommand{\ys}{y^\star}

%% the math operators
%%-------------------
\DeclareMathOperator*{\argmax}{argmax}
\DeclareMathOperator*{\argmin}{argmin}
\DeclareMathOperator*{\diag}{diag}
\DeclareMathOperator*{\sgn}{sgn}

\usepackage{Sweave}
\begin{document}

%\VignetteIndexEntry{docval}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% TITLE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\title{Vignette for the documentation by value package (docval)}

\author{ Dennis Kostka and Rainer Spang \\ 
  \vspace{.01cm}\\
   \small Max Planck Institute for Molecular Genetics \\
   \small Ihnestrasse 63-73, 14195 Berlin, Germany }
   
  \date{} 

\maketitle

\tableofcontents

\newpage



\section{Using the software}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\subsection{Preprocessing}
%%%%%%%%%%%%%%%%%%%%%%%%%%

We proceed in three steps:
\begin{itemize}

\item[$i$)] Read in the data. We have prepared an \texttt{AffyBatch} 
object  called \texttt{abo.w}, featuring ten \texttt{.cel} files:

\begin{Schunk}
\begin{Sinput}
> library(docval)
> data(willenbrock)
\end{Sinput}
\end{Schunk}
\begin{Schunk}
\begin{Sinput}
> abo.w
\end{Sinput}
\begin{Soutput}
AffyBatch object
size of arrays=448x448 features (17 kb)
cdf=HG-Focus (8793 affyids)
number of samples=10
number of genes=8793
annotation=hgfocus
notes=
\end{Soutput}
\end{Schunk}
\item[$ii$)] Preprocessing using \texttt{rma}
\begin{Schunk}
\begin{Sinput}
> exs.rma = wrap.val(abo.w[, -10], method = "rma")