\Header{writeChrLength}{Functions that creates binary files for chromosome length and organism}
\alias{findChrLength}{writeChrLength}
\alias{writeOrganism}{writeChrLength}
\keyword{manip}{writeChrLength}
\begin{Description}\relax
These functions figure out the chromosome length and write the length
and organism binary files to the data directory of the pacakge\end{Description}
\begin{Usage}
\begin{verbatim}
writeChrLength(pkgName, pkgPath, chrLengths)
findChrLength(organism, srcUrl = getSrcUrl("GP", organism))
writeOrganism(pkgName, pkgPath, organism)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{pkgName}] \code{pkgName} a character string for the name of a
data package or R library
\item[\code{pkgPath}] \code{pkgPath} a character string for the path where
pkgname resides
\item[\code{organism}] \code{organism} a character string for the name of the
organism of interests
\item[\code{srcUrl}] \code{srcUrl} a character string for the url of the data
source used to create the binary file for chromosome length
\item[\code{chrLengths}] \code{chrLengths} a named vector of integers with
the names being the chromosome numbers and the values of the vector
being the total lengths of chromosomes
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{\Link{findChrLength}} extracts data from the source and figures
out the total length for each chromosome. The total length for a
chromosome is determined as the maximum chromosome location plus 1000.

\code{\Link{writeChrLength}} writes the chromosome length data to the
data directory as a binary file.

\code{\Link{writeOrganism}} writes the name of the organism to the
data directory as a binary file.\end{Details}
\begin{Value}
\code{\Link{findChrLength}} returns a named vector of integers.\end{Value}
\begin{Note}\relax
The functions are part of the Bioconductor project at Dana-Farber
Cancer Institute to provide BioInformatics functionalities through R\end{Note}
\begin{Author}\relax
Jianhua Zhang\end{Author}
\begin{References}\relax
\end{References}
\begin{Examples}
\begin{ExampleCode}
if(interactive()){
    path <- file.path(.path.package("AnnBuilder", "temp"))
    dir.create(file.path(path, "test"))
    dir.create(file.path(path, "test", "data"))
    chrLength <- findChrLength("human")
    writeChrLength("test", path, chrLength)
    writeOrganism("test", path, "human")
    list.files(file.path(path, "test", "data"))
    unlink(file.path(path, "test"), TRUE)
}
\end{ExampleCode}
\end{Examples}

