\HeaderA{bcrank}{BCRANK: predicting binding site consensus from ranked DNA sequences}{bcrank}
\keyword{methods}{bcrank}
\begin{Description}\relax
This function implements an algorithm for detection of short DNA
sequences that are overrepresented in some part of the list. Starting
from some initial consensus DNA sequence coded in IUPAC symbols, the
method uses a heuristic search to improve the consensus until a local
optimum is found.
\end{Description}
\begin{Usage}
\begin{verbatim}
bcrank(fafile, startguesses=c(), restarts=10, length=10, 
    reorderings=500, silent=FALSE, plot.progress=FALSE, do.search=TRUE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{fafile}] a ranked fasta file containing DNA sequences.
\item[\code{startguesses}] a character vector with consensus sequences in
IUPAC coding to be used as starting sequences in the search. If empty,
random start guesses will be generated.
\item[\code{restarts}] number restarts of the algorithm when using random start guesses.
\item[\code{length}] legth of random start guess.
\item[\code{reorderings}] number of random reorderings of the DNA sequences
performed when calculating score.
\item[\code{silent}] reports progress status if FALSE. 
\item[\code{plot.progress}] if TRUE, the progress is displayed in a plot.
\item[\code{do.search}] if FALSE, no search is performed. In that case the
start guesses are assigned with scores and reported as results.
\end{ldescription}
\end{Arguments}
\begin{Value}
The method returns an objcet of class \code{\LinkA{BCRANKresult-class}{BCRANKresult.Rdash.class}}.
\end{Value}
\begin{Author}\relax
Adam Ameur, \email{adam.ameur@lcb.uu.se}
\end{Author}
\begin{References}\relax
Ameur, A., Rada-Iglesias, A., Komorowski, J., Wadelius, C. Novel
algorithm and ChIP-analysis identifies candidate functional SNPs. Submitted
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{BCRANKresult-class}{BCRANKresult.Rdash.class}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## Load example fasta file  
fastaFile <- system.file("Exfiles/USF1_small.fa", package = "BCRANK") 
## Run BCRANK
## Not run: BCRANKout <- bcrank(fastaFile, restarts=20)

## Show BCRANK results
toptable(BCRANKout)
## The top scoring result
topMotif <- toptable(BCRANKout,1)
## Plot BCRANK search path
plot(topMotif)
## Position Weight Matrix
pwm(topMotif, normalize=FALSE)
\end{ExampleCode}
\end{Examples}

