changeset 56:a4317b006d70 draft

Uploaded
author davidvanzessen
date Tue, 01 Mar 2016 05:06:47 -0500
parents 0d5add1a9800
children cb66d6dd1e66
files aa_histogram.r
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/aa_histogram.r	Tue Mar 01 04:53:06 2016 -0500
+++ b/aa_histogram.r	Tue Mar 01 05:06:47 2016 -0500
@@ -5,22 +5,30 @@
 input = args[1]
 outfile = args[2]
 
+print("---------------- read input ----------------")
+
 dat = read.table(input, sep="\t", fill=T, header=T, quote="")
 
-
+print("---------------- as numeric ----------------")
 
 mutations.at.position = as.numeric(dat[1,])
 aa.at.position = as.numeric(dat[2,])
 
+print("---------------- freq data.frame ----------------")
+
 dat_freq = mutations.at.position / aa.at.position
 dat_dt = data.frame(i=1:length(dat_freq), freq=dat_freq)
 
+print("---------------- weird stuff ----------------")
+
 options(width=220)
 
 print(dat[,20:40])
 
 print(dat_dt) #need this or it will fail????
 
+print("---------------- plot ----------------")
+
 m = ggplot(dat_dt, aes(x=i, y=freq)) + theme(axis.text.x = element_text(angle = 90, hjust = 1))
 m = m + geom_histogram(stat="identity", colour = "black", fill = "darkgrey", alpha=0.8) + scale_x_continuous(breaks=1:length(dat_freq), labels=1:length(dat_freq))
 m = m + annotate("segment", x = 0.5, y = -0.05, xend=26.5, yend=-0.05, colour="darkgreen", size=1) + annotate("text", x = 13, y = -0.1, label="FR1")