\HeaderA{snpm2phase}{convert information in a snp.matrix to PHASE input format;
invokePhase can run a suitably installed version of PHASE}{snpm2phase}
\aliasA{parsePh.out}{snpm2phase}{parsePh.out}
\aliasA{personalHap}{snpm2phase}{personalHap}
\aliasA{phaseInput-class}{snpm2phase}{phaseInput.Rdash.class}
\keyword{models}{snpm2phase}
\begin{Description}\relax
convert information in a snp.matrix to PHASE input format;
invokePhase can run a suitably installed version of PHASE
\end{Description}
\begin{Usage}
\begin{verbatim}
snpm2phase(snpm, cnum, outfilename)
parsePh.out(fn)
personalHap(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{snpm}] snp.matrix instance
\item[\code{cnum}] chromosome number as chrnum instance
\item[\code{outfilename}] character name of file to write
\item[\code{fn}] character name of PHASE .out file to read
\item[\code{x}] output of parsePh.out
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
follows phase 2.1 documentation for input format

a phaseInput container class can store relevant metadata
\end{Details}
\begin{Value}
writes to a file and gives a message
\end{Value}
\begin{Author}\relax
Vince Carey <stvjc@channing.harvard.edu>
\end{Author}
\begin{Examples}
\begin{ExampleCode}
data(smtest)
tt = tempfile()
pin = snpm2phase(smtest, chrnum(20), tt)

class(pin)
getClass("phaseInput")
pin
readLines(tt)
unlink(tt)
pp = parsePh.out(system.file("phaseOut/cpne1_20k.out", package="GGtools"))
pp[[1]][1:3]
personalHap(pp)
\end{ExampleCode}
\end{Examples}

