As i have searched in the updated ggplot2 cheatsheet,
i have mainly experienced problems about creating some specific plots of interest:
In detail, a first "naive" function i created, was to deal with the output of function topTable from limma, and create a volcano plot, like below:
volcano.r <- function(object, FC_cutoff_1, FC_cutoff_2, pval_cutoff) { # where object is the output of topTable
results <- object
results$threshold <- "1"
a <- subset(results, adj.P.Val < pval_cutoff & logFC > FC_cutoff_1)
results[rownames(a), "threshold"] <- "2"
b <- subset(results, adj.P.Val < pval_cutoff & logFC < FC_cutoff_2 )
results[rownames(b), "threshold"] <- "3"
volcano <- ggplot(data=results, aes(x=logFC, y=-1*log10(adj.P.Val), colour=threshold, label=SYMBOL))
volcano <- volcano + geom_point() + scale_color_manual(values=c("black","red","green"), labels=c("Not Significant", "Upregulated", "Downregulated"), name="key/Legend")
volcano2 <- volcano + theme(legend.text=element_text(size=16))
print(volcano2)
ggsave(filename="eleos.jpeg", plot=volcano2)
}
(im posting the code in order to illustrate my main question below)
In this specific case, here i can distinguish the aesthetics regarding the data frame, both for the x and the y axis. However, my main difficulty was to try to create some general boxplots, histograms and Q-Q plots regarding for instance a specific microarray dataset in R, as in this case i don't deal with data frames, but mainly with ExpressionSets or matrices. Thus, i could not understand how to appropriately define the aesthetics, because here all the rows are the genes, and the columns represent the different samples. So,
1) Is there a tutorial or book regarding high-throughput data analysis with ggplot2, especially with examples for microarray data ?
2) Or is it possible to provide me with a small idea or a brief explanation on this matter, or where i could look to deal with my issue, as my main goal is to learn how to create these specific plots for microarray expression sets(boxplots, histograms and quantile-quantile plots) ??