\name{ForkBatch} 

\alias{ForkBatch}
\alias{OneBatch}
\alias{OneBatch,RolexaRun-method}
\title{Multi-threaded Probabilistic Base Calling}
\description{Performs multi-threaded base calling on a collection of
  intensity files generated by the Solexa image analysis software}
\usage{
ForkBatch(run=Rolexa.env,path,outpath="./",prefix="rs_",nthreads=3,nfiles=2,lane=1,tiles=1:100,...)
\S4method{OneBatch}{RolexaRun}(run,path,lane,tiles,outpath,prefix)
OneBatch(run,...)
}
\arguments{
  \item{run}{a \link[=RolexaRun-class]{RolexaRun} object defining the run parameters}
  \item{path}{a \link[ShortRead:SolexaPath-class]{SolexaPath} object
    defining providing the input paths}
  \item{outpath}{the path to the output directory}
  \item{prefix}{output file prefix, see \code{\link{SaveResults}}}
  \item{nthreads}{number of threads to use}
  \item{nfiles}{number of input files to concatenate in one batch}
  \item{lane}{the lane number to analyze}
  \item{tiles}{a subset of tiles to read}
  \item{\dots}{further arguments passed to the \link[=RolexaRun-class]{RolexaRun} constructor}
}
\details{
The function \code{\link{ForkBatch}} runs through the list of input files, concatenates them by
batches of \code{nfiles}, then calls
\code{\link{OneBatch}} in each of the
\code{nthreads} threads until all batches have been processed. Each
batch results are passed to \code{\link{FilterResults}} and saved in an
output file inside \code{outpath}.
}
\references{Probabilistic base calling of Solexa sequencing data,
  BMC Bioinformatics 2008, 9:431}
\author{Jacques Rougemont, Arnaud Amzallag, Christian Iseli, Laurent Farinelli, Ioannis Xenarios, Felix Naef}
\seealso{\code{\link{CombineFastQ}}, \code{\link{CombineReads}} and \code{\link{SaveResults}}}
\examples{
path = SolexaPath(system.file("extdata", package="ShortRead"))
rolenv = SetModel(idsep="_")
\dontrun{
#This will take some time to complete:
library(fork)
ForkBatch(run=rolenv,path=path,tiles=1)
}
}
\keyword{iteration}
\keyword{utilities}