\name{annotationPlot}
\alias{annotationPlot}
\title{
Function to summarize and plot extracted GO or pathway annotation
}
\description{
Summarize the information from the GO or pathway annotation list
into a table of counts and percentages, and possibly print a few images.
}
\usage{
annotationPlot(res.list, percentages = FALSE, plot = TRUE, trimzero = FALSE, type=c("GO", "pathway"))
		
}
\arguments{
\item{res.list}{
 	The list of summarized annotation as generated by \code{\link{processAnnotation}}.
}
\item{percentages}{
	TRUE or FALSE.
}
\item{plot}{
	TRUE or FALSE: should plots be printed.
}
\item{trimzero}{
	TRUE or FALSE: should GO categories with no counts be removed. 
	This is not really relevant when a small number of GO categories 
	has been selected.
}
\item{type}{
	The type of annotation.
}
}
%\details{
%}
\value{
	\item{counts}{A matrix of counts, GO categories (rows) by samples (cols). }
	\item{percentages}{A matrix of percentages, GO categories (rows) by samples (cols). }
}
%\references{
%}
\author{
D. Pascovici
}
%\note{
%}

\seealso{
See Also \code{\link{processAnnotation}}
}
\examples{
\dontrun{
# get list of ID's
GOIDlist <- GOTermList("BP", 2)

# find existing files
dir <- system.file("files", package="PloGO2")
file.names <- paste(dir,c("00100.txt", "01111.txt", "10000.txt",
			"11111.txt","Control.txt"), sep="/")

# summarize annotation
res.list <- processAnnotation(file.names, GOIDlist)

annotationPlot(res.list, plot=FALSE)
}
# KEGG pathway
dir <- system.file("files", package="PloGO2")
fname <- file.path(dir,"PWFiles", c("red.txt", "blue.txt", "yellow.txt", "green.txt", "turquoise.txt") )
datafile <- file.path(dir,"Abundance_data.csv")

AnnotIDlist <- c("osa01100","osa01110","osa01230","osa00300","osa00860")
		
res.list <- processAnnotation(fname, AnnotIDlist,  data.file.name = datafile)

annotationPlot(res.list, plot=TRUE, type="pathway")

}
\keyword{ ~kwd1 }
\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
