\HeaderA{hmm}{Wrapper for fitting the HMM}{hmm}
\keyword{models}{hmm}
\begin{Description}\relax
A wrapper for fitting the HMM.
\end{Description}
\begin{Usage}
\begin{verbatim}
hmm(object, states, mu = NULL, probs = NULL, takeLog = FALSE, initialP, returnSegments = TRUE, TAUP = 1e+08, verbose = FALSE, ice = FALSE, envir)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] SnpCallSet, SnpCopyNumberSet, or oligoSnpSet object
\item[\code{states}] Labels for the hidden states.  See details for order.
\item[\code{mu}] The latent copy number. See details for order. 
\item[\code{probs}] See details.
\item[\code{takeLog}] Whether to take the log of the copy number before
computing emission probabilities and standard deviations
\item[\code{initialP}] Initial state probabilities
\item[\code{returnSegments}] Logical: whether to return the segments or the
loci x sample matrix of predicted states
\item[\code{TAUP}] Scaling parameter for transition probabilities.
\item[\code{verbose}] Logical: Verbose output?
\item[\code{ice}] Whether to use CRLMM confidence scores of the genotype calls.
\item[\code{envir}] Optional.  An environment for storing intermediate files
created for fitting the HMM.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
For oligoSnpSet objects, the hidden state labels are assumed to be
1: hemizygous deletion
2: normal
3: region of homozygosity (ROH)
4: amplification

The argument mu should have copy number values corresponding to the
above states.  For instance on the absolute scale, the copy number
states should be 1, 2, 2, and 4.

\code{probs}:  If \code{ice} is FALSE, the elements in probs should
correspond to the probability of a homozygous genotype in each of the
above states.  If \code{ice} is TRUE, the elements in probs should
correspond to
1.  Pr(homozygous call \textbar{} truth is heterozyous)  
2.  Pr(heterozygous call \textbar{} truth is heterozygous)
3.  Pr(homozygous call \textbar{} truth is ROH)
4.  Pr(homozygous call \textbar{} truth is normal) .  'Normal' meaning copy
number 2 and a typical frequency of heterozygosity for autosomes.
\end{Details}
\begin{Value}
If \code{returnSegments} is TRUE, a data.frame containing the
coordinates of the predicted segments is returned.  Otherwise, a loci
X sample matrix is returned. The elements of the matrix correspond to
the predict hidden state for a specific locus and sample.
\end{Value}
\begin{Author}\relax
R. Scharpf
\end{Author}
\begin{References}\relax
RB Scharpf et al. (2008) Hidden Markov Models for the assessment of
chromosomal alterations using high-throughput SNP arrays, Annals of
Applied Statistics
\end{References}

