18
|
1 # pairwiseScatterPlots
|
|
2 # scatter plots for pairwise comparaisons of log counts
|
|
3
|
|
4 # input : counts, target, outputName
|
|
5 # output : scatter plots (pdf: allows multiple figures in one file)
|
|
6
|
|
7 # created Feb 21th, 2012
|
|
8 # modified Sept 27th, 2012 (pdf output file)
|
|
9 # modified Oct 30th, 2012 (png)
|
|
10 # Marie-Agnes Dillies
|
|
11
|
|
12
|
|
13 pairwiseScatterPlots <- function( counts, target, OUT_scatterPlot, out = TRUE, pdffile = FALSE ){
|
|
14
|
|
15 if (out & !pdffile) png( OUT_scatterPlot )
|
|
16 if (pdffile) pdf( OUT_scatterPlot )
|
|
17
|
|
18 conds <- unique(target$group)
|
|
19 # colnames(counts) <- target$label
|
|
20
|
|
21 for (i in 1:(length(conds)-1)){
|
|
22 for (j in (i+1):length(conds)){
|
|
23 cond1 <- conds[i]; cond2 <- conds[j]
|
|
24 pairs( log2(counts[, which(target$group %in% c(as.character(cond1), as.character(cond2)))]+1),
|
|
25 pch=".", cex=0.5, main = paste(cond1, cond2, sep=" vs ") )
|
|
26 }
|
|
27 }
|
|
28
|
|
29 if (pdffile) dev.off()
|
|
30 if (out) dev.off()
|
|
31 }
|