annotate SMART/DiffExpAnal/DESeqTools/pairwiseScatterPlots.R @ 33:aa0420172fc6

Deleted selected files
author m-zytnicki
date Tue, 30 Apr 2013 14:34:53 -0400
parents 94ab73e8a190
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
1 # pairwiseScatterPlots
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
2 # scatter plots for pairwise comparaisons of log counts
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
3
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
4 # input : counts, target, outputName
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
5 # output : scatter plots (pdf: allows multiple figures in one file)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
6
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
7 # created Feb 21th, 2012
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
8 # modified Sept 27th, 2012 (pdf output file)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
9 # modified Oct 30th, 2012 (png)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
10 # Marie-Agnes Dillies
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
11
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
12
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
13 pairwiseScatterPlots <- function( counts, target, OUT_scatterPlot, out = TRUE, pdffile = FALSE ){
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
14
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
15 if (out & !pdffile) png( OUT_scatterPlot )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
16 if (pdffile) pdf( OUT_scatterPlot )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
17
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
18 conds <- unique(target$group)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
19 # colnames(counts) <- target$label
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
20
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
21 for (i in 1:(length(conds)-1)){
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
22 for (j in (i+1):length(conds)){
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
23 cond1 <- conds[i]; cond2 <- conds[j]
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
24 pairs( log2(counts[, which(target$group %in% c(as.character(cond1), as.character(cond2)))]+1),
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
25 pch=".", cex=0.5, main = paste(cond1, cond2, sep=" vs ") )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
26 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
27 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
28
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
29 if (pdffile) dev.off()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
30 if (out) dev.off()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
31 }