\HeaderA{seqMatcherAlign}{Functions to do local alignment of two sequences using EMBOSS matcher}{seqMatcherAlign}
\aliasA{getAlignStats}{seqMatcherAlign}{getAlignStats}
\keyword{methods}{seqMatcherAlign}
\begin{Description}\relax
\code{seqMatcherAlign} matches two sequences using the EMBOSS matcher
program. 

\code{getAlignStats} extract the statistics from the alignment result data.
\end{Description}
\begin{Usage}
\begin{verbatim}
    seqMatcherAlign(pairNameV,BankIDV,seqBank)
    getAlignStats(alignRes)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{pairNameV}] a vector of gene pair names
\item[\code{BankIDV}] a vector of the sequence IDs in the sequence Bank.
\item[\code{seqBank}] a database of all the sequences 
\item[\code{alignRes}] object returned by \code{seqMatcherAlign} 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{seqMatcherAlign} matches the gene pair names with the sequence
bank IDs and export the two sequences in to two files: seq1.new and
seq2.new. Then uses system calls to run EMBOSS matcher program to
align the two sequences.  The result from matcher is store in file
"out.matcher".  \code{seqMatcherAlign} read in this file and create a
R object summarize the alignment results.

\code{getAlignStats} takes the alignment result data and extract the
statistics of the result in to data.frame.
\end{Details}
\begin{Value}
\begin{ldescription}
\item[\code{names }] contains the names of the gene pair
\item[\code{results }] contains the alignment statistics: the aligned total length,
the number of identical match, the number of similar match, the number of gaps,
and the alignment score
\item[\code{seq}] displays the aligned sequences
\end{ldescription}
\end{Value}
\begin{Note}\relax
\code{pairMatcherAlign} use system calls to run EMBOSS matcher
program. You must have EMBOSS matcher installed on your computer.
\end{Note}
\begin{Author}\relax
Z. Jiang
\end{Author}
\begin{References}\relax
EMBOSS: The European Molecular Biology Open Software Suite (2000)
Rice,P. Longden,I. and Bleasby,A.
Trends in Genetics 16, (6) pp276--277
\end{References}
\begin{Examples}
\begin{ExampleCode}

seq1 <- "RPHEDEKEAIDEAKKMKVPGENEDESKEEEKSQELEEAIDSKEKSTDARDEQGDEGDNEEENNEEDNENENEHTAPPALVMPSPIEMEEQRM"
seq2 <- "QKYLLKKAIRNFSEYPFYAQNKLIHQQATGLILTEEEKSQELEEKIISKIKKEEHLKKINLKHDYFDLQKKYEKECEILTKLSENLRKEK"
seq3 <- "IHQQATGLILTKIISKIKKEEHVPGENEDLKKINLKHDYFDLQKKYEKECEILTKLSENLRKEEIENKRKEHELMEQKRREEGIETEKEKSLRHPSSSSSSRRRN"
seqBank <- list(seq1=list(seq=seq1),seq2=list(seq=seq2),seq3=list(seq=seq3))
bid <- names(seqBank)
pnames <- c("seq1","seq3")
## Not run: 
ar <- seqMatcherAlign(pnames, bid, seqBank)
ar
getAlignStats(ar)
## End(Not run)
\end{ExampleCode}
\end{Examples}

