Permalink
Browse files

Finished the vignette

  • Loading branch information...
1 parent 983eb49 commit f2600acdd25a7e8cfa75a442818073b17509a9a2 @raivokolde committed Apr 3, 2013
Showing with 24 additions and 2,597 deletions.
  1. +1 −8 .Rbuildignore
  2. +1 −1 R/GOsummaries.R
  3. +21 −2 inst/doc/GOsummaries-basics.Rnw
  4. +0 −3 man/panel_boxplot.Rd
  5. +1 −2 man/plot.gosummaries.Rd
  6. +0 −2,581 man/plot.gosummaries.log
View
@@ -1,9 +1,2 @@
visual_test
-*.out
-*.log
-*.fdb_latexmk
-*.blg
-*.bbl
-*.aux
-*.gz
-*.toc
+
View
@@ -1005,7 +1005,7 @@ customize = function(p, par){
#' differential expression it draws the boxplot of expression values.
#'
#' @param x a gosummaries object
-#' @param components names of the gosummaries components to draw.
+#' @param components index for the components to draw.
#' @param classes name of the variable from annotation data.frame that defines the colors in the plot
#' @param panel_plot plotting function for panel
#' @param panel_customize customization function for the panel plot, menat for making
@@ -156,10 +156,29 @@ Using as id variables
\end{figure}
\subsection{Configuring the plot appearance}
+The layout of the plot is fixed. However, it is still possible to configure some parameters. For example, the proportions of the panel area with parameters \texttt{panel\_height} and \texttt{panel\_width}. The unit for these measures is lines of text. Using these units keeps the proportions of the plot similar even if we change the \texttt{fontsize}. The panel height parameter is most useful if one wants to omit the panel area completely. Then one can set the \texttt{panel\_height} to 0.
+The content of the panels is drawn by the function that is specified in the \texttt{panel\_plot} parameter. If one uses the built in functions, such as \texttt{gosummaries.prcomp}, \texttt{gosummaries.kmeans}, etc. then the most suitable panel drawing function is selected automatically. Without any expression data, only the number of genes is displayed in there. In case of PCA, we display projection of the values to the principal component as histogram. For clustering and differential expression we show the boxplots of the expression in different samples. Instead of boxplot, one can use also the violin plot (\texttt{panel\_violin}) or combination of boxplot and violin plot (\texttt{panel\_violin\_box}).
+All the panel drawing functions basically generate a \texttt{ggplot2} plot based on the \texttt{Data} slot in a component of \texttt{gosummaires} object. From there we extract the plot area to display in panel and also the legend. In principle it is possible to define your own functions, as long as its input and output are match our functions and it conforms to the data in the \texttt{Data} slot in the components of \texttt{gosummaires} object. See the help of \texttt{panel\_boxplot} and the source of these functions for more information.
-\bibliographystyle{plain}
-\bibliography{references}
+If one wants to make smaller changes to the panels, such as, change the colour scheme, then for this we have easier means than defining new panel function. With the parameter \texttt{panel\_customize} one can specify a function that modifies the plot created with the \texttt{panel\_plot} function. For example the default function \texttt{customize} looks like this.
+
+\begin{verbatim}
+function(p, par){
+ p = p + ggplot2::scale_fill_discrete(par$classes)
+ return(p)
+}
+\end{verbatim}
+
+To select a different colour scheme one can modify that function and and give it to the \texttt{plot.gosummaires} function.
+\begin{verbatim}
+cust = function(p, par){
+ p = p + scale_fill_brewer(par$classes, type = "qual", palette = 2)
+ return(p)
+}
+plot(gs_kmeans, panel_plot = panel_violin, panel_customize = cust,
+classes = "Tissue", components = 1:2)
+\end{verbatim}
\end{document}
View
@@ -54,9 +54,6 @@
the data given in the Data slot of the gosummaries
object.
}
-\examples{
-# Example1
-}
\author{
Raivo Kolde <rkolde@gmail.com>
}
View
@@ -13,8 +13,7 @@
\arguments{
\item{x}{a gosummaries object}
- \item{components}{names of the gosummaries components to
- draw.}
+ \item{components}{index for the components to draw.}
\item{classes}{name of the variable from annotation
data.frame that defines the colors in the plot}
Oops, something went wrong.

0 comments on commit f2600ac

Please sign in to comment.