diff pattern_plots.r @ 42:1cf60ae234b4 draft

Uploaded
author davidvanzessen
date Tue, 28 Mar 2017 08:25:36 -0400
parents a24f8c93583a
children
line wrap: on
line diff
--- a/pattern_plots.r	Tue Mar 14 09:30:16 2017 -0400
+++ b/pattern_plots.r	Tue Mar 28 08:25:36 2017 -0400
@@ -9,21 +9,22 @@
 plot1.path = args[2]
 plot1.png = paste(plot1.path, ".png", sep="")
 plot1.txt = paste(plot1.path, ".txt", sep="")
+plot1.pdf = paste(plot1.path, ".pdf", sep="")
 
 plot2.path = args[3]
 plot2.png = paste(plot2.path, ".png", sep="")
 plot2.txt = paste(plot2.path, ".txt", sep="")
+plot2.pdf = paste(plot2.path, ".pdf", sep="")
 
 plot3.path = args[4]
 plot3.png = paste(plot3.path, ".png", sep="")
 plot3.txt = paste(plot3.path, ".txt", sep="")
+plot3.pdf = paste(plot3.path, ".pdf", sep="")
 
 clean.output = args[5]
 
 dat = read.table(input.file, header=F, sep=",", quote="", stringsAsFactors=F, fill=T, row.names=1)
 
-
-
 classes = c("IGA", "IGA1", "IGA2", "IGG", "IGG1", "IGG2", "IGG3", "IGG4", "IGM", "IGE")
 xyz = c("x", "y", "z")
 new.names = c(paste(rep(classes, each=3), xyz, sep="."), paste("un", xyz, sep="."), paste("all", xyz, sep="."))
@@ -63,6 +64,8 @@
 print(p)
 dev.off()
 
+ggsave(plot1.pdf, p)
+
 data2 = dat[c(1, 5:8),]
 
 data2 = data2[,names(data2)[grepl("\\.x", names(data2))]]
@@ -100,6 +103,8 @@
 print(p)
 dev.off()
 
+ggsave(plot2.pdf, p)
+
 data3 = dat[c(5, 6, 8, 17:20),]
 data3 = data3[,names(data3)[grepl("\\.x", names(data3))]]
 names(data3) = gsub(".x", "", names(data3))
@@ -138,6 +143,7 @@
 print(p)
 dev.off()
 
+ggsave(plot3.pdf, p)
 
 
 
@@ -169,3 +175,4 @@
 
 
 
+