diff shm_csr.r @ 42:1cf60ae234b4 draft

Uploaded
author davidvanzessen
date Tue, 28 Mar 2017 08:25:36 -0400
parents a24f8c93583a
children 77a7ac76c7b9
line wrap: on
line diff
--- a/shm_csr.r	Tue Mar 14 09:30:16 2017 -0400
+++ b/shm_csr.r	Tue Mar 28 08:25:36 2017 -0400
@@ -307,11 +307,16 @@
 			#p = p + scale_colour_manual(values=c("A" = "black", "G" = "black", "C" = "black", "T" = "black"))
 			print(p)
 			dev.off()
+			
+			ggsave(paste("transitions_stacked_", name, ".pdf", sep=""))
+			
 			png(filename=paste("transitions_heatmap_", name, ".png", sep=""))
 			p = ggplot(transition2, aes(factor(reorder(variable, -order.y)), factor(reorder(id, -order.x)))) + geom_tile(aes(fill = value)) + scale_fill_gradient(low="white", high="steelblue") #heatmap
 			p = p + xlab("To base") + ylab("From Base") + ggtitle("Heatmap transition information")  + theme(panel.background = element_rect(fill = "white", colour="black"), text = element_text(size=16, colour="black"))
 			print(p)
 			dev.off()
+			
+			ggsave(paste("transitions_heatmap_", name, ".pdf", sep=""))
 		} else {
 			#print("No data to plot")
 		}
@@ -394,6 +399,8 @@
 	png(filename="IGA.png")
 	print(pc)
 	dev.off()
+	
+	ggsave("IGA.pdf", pc)
 }
 
 print("Plotting IGG piechart")
@@ -415,6 +422,8 @@
 	png(filename="IGG.png")
 	print(pc)
 	dev.off()
+	
+	ggsave("IGG.pdf", pc)
 }
 
 print("Plotting scatterplot")
@@ -436,6 +445,8 @@
 print(p)
 dev.off()
 
+ggsave("scatter.pdf", p)
+
 write.table(dat[,c("Sequence.ID", "best_match", "VRegionMutations", "VRegionNucleotides", "percentage_mutations")], "scatter.txt", sep="\t",quote=F,row.names=F,col.names=T)
 
 print("Plotting frequency ranges plot")
@@ -460,6 +471,8 @@
 print(p)
 dev.off()
 
+ggsave("frequency_ranges.pdf", p)
+
 frequency_bins_data_by_class = frequency_bins_data
 
 frequency_bins_data_by_class = frequency_bins_data_by_class[order(frequency_bins_data_by_class$best_match_class, frequency_bins_data_by_class$frequency_bins),]