library(marray) S1M47_mutent <- read.table("C:/Jacobson/homeira/remove_insig_dof/reslist_full_noglyala_1M47_new3_mutent_chi_0diag_bin15deg.txt") pdf(file="C:/Jacobson/homeira/remove_insig_dof/MI_nocluster_1M47_phipsichi.pdf") heatmap(x=as.matrix((S1M47_mutent)), col = maPalette(low = "white", high = "black", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", main="Mutual Information For Apo IL-2", Rowv = NA, Colv = NA, cexRow=0.2, cexCol=0.2, oldstyle = FALSE,symm=TRUE ) dev.off() #windows() pdf(file="C:/Jacobson/homeira/remove_insig_dof/MI_cluster_1M47_phipsichi.pdf") heatmap(x=as.matrix((max(S1M47_mutent)-S1M47_mutent)), col = maPalette(low = "black", high = "white", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", main="Mutual Information for Apo IL-2", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, cexRow=0.2, cexCol=0.2, oldstyle = FALSE,symm=TRUE ) dev.off() #windows() pdf(file="C:/Jacobson/homeira/remove_insig_dof/MI_cluster_1M47_phipsichi_colorbar.pdf") maColorBar(seq(min(S1M47_mutent),max(S1M47_mutent),by=(max(S1M47_mutent)-min(S1M47_mutent))/50), col = maPalette(low = "white", high = "black", k =50)) dev.off() S1M48_mutent <- read.table("C:/Jacobson/homeira/remove_insig_dof/reslist_full_noglyala_1M48_new3_mutent_chi_0diag_bin15deg.txt") windows() pdf(file="C:/Jacobson/homeira/remove_insig_dof/MI_cluster_1M48_phipsichi.pdf") heatmap(x=as.matrix((max(S1M48_mutent)-S1M48_mutent)), col = maPalette(low = "black", high = "white", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="Mutual Information for IL-2 With Micromolar Inhibitor at Alpha Site", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) dev.off() #windows() #heatmap(x=as.matrix((S1M48_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="Mutual Information for IL-2 With Micromolar Inhibitor at Alpha Site", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) #windows() #heatmap(x=as.matrix((S1M48_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="Mutual Information for IL-2 With Micromolar Inhibitor at Alpha Site", Rowv = NA, Colv = NA, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) S1NBP_mutent <- read.table("C:/Jacobson/homeira/remove_insig_dof/reslist_full_noglyala_1NBP_new3_mutent_chi_0diag_bin15deg.txt") windows() pdf(file="C:/Jacobson/homeira/remove_insig_dof/MI_cluster_1NBP_phipsichi.pdf") heatmap(x=as.matrix((max(S1NBP_mutent)-S1NBP_mutent)), col = maPalette(low = "black", high = "white", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="Mutual Information for IL-2 With Compound at Allosteric Site", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) dev.off() #windows() #heatmap(x=as.matrix((S1NBP_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="Mutual Information for IL-2 With Compound at Allosteric Site", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) #windows() #heatmap(x=as.matrix((S1NBP_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="Mutual Information for IL-2 With Compound at Allosteric Site", Rowv = NA, Colv = NA, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) S1PY2_mutent <- read.table("C:/Jacobson/homeira/remove_insig_dof/reslist_full_noglyala_1PY2_new3_mutent_chi_0diag_bin15deg.txt") windows() pdf(file="C:/Jacobson/homeira/remove_insig_dof/MI_cluster_1PY2_phipsichi.pdf") heatmap(x=as.matrix((max(S1PY2_mutent)-S1PY2_mutent)), col = maPalette(low = "black", high = "white", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="Mutual Information for IL-2 With Nanomolar Inhibitor at Alpha Site", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) dev.off() #windows() #heatmap(x=as.matrix((S1PY2_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="Mutual Information for IL-2 With Nanomolar Inhibitor at Alpha Site", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) #windows() #heatmap(x=as.matrix((S1PY2_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="Mutual Information for IL-2 With Nanomolar Inhibitor at Alpha Site", Rowv = NA, Colv = NA, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) heatmap(x=as.matrix(((S1M47_mutent)-S1M48_mutent)), col = maPalette(low = "white", high = "black", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", main="1M47-1M48", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, cexRow=0.2, cexCol=0.2, oldstyle = FALSE,symm=TRUE ) windows() heatmap(x=as.matrix(((S1M47_mutent)-S1NBP_mutent)), col = maPalette(low = "white", high = "black", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", main="1M47-1NBP", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, cexRow=0.2, cexCol=0.2, oldstyle = FALSE,symm=TRUE ) windows() heatmap(x=as.matrix(((S1M47_mutent)-S1PY2_mutent)), col = maPalette(low = "white", high = "black", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", main="1M47-1PY2", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, cexRow=0.2, cexCol=0.2, oldstyle = FALSE,symm=TRUE ) windows() S1PY2_mutent <- read.table("C:/Jacobson/homeira/reslist_full_noglyala_1PY2_mutent_0diag_v8.txt") #windows() #heatmap(x=as.matrix((max(S1PY2_mutent)-S1PY2_mutent)), col = maPalette(low = "black", high = "white", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1PY2", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_cluster_1PY2_chi.pdf") heatmap(x=as.matrix((S1PY2_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1PY2", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_nocluster_1PY2_chi.pdf") heatmap(x=as.matrix((S1PY2_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1PY2", Rowv = NA, Colv = NA, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) S1NBP_mutent <- read.table("C:/Jacobson/homeira/reslist_full_noglyala_1NBP_mutent_0diag_v8.txt") #windows() #heatmap(x=as.matrix((max(S1NBP_mutent)-S1NBP_mutent)), col = maPalette(low = "black", high = "white", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1NBP", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_nocluster_1NBP_chi.pdf") heatmap(x=as.matrix((S1NBP_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1NBP", Rowv = NA, Colv = NA, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_cluster_1NBP_chi.pdf") heatmap(x=as.matrix((S1NBP_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1NBP", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) S1M47_mutent_unc <- read.table("C:/Jacobson/homeira/reslist_full_noglyala_1M47_uncert.txt") pdf(file="C:/Jacobson/homeira/MI_nocluster_1M47_chi_uncert.pdf") heatmap(x=as.matrix((S1M47_mutent_unc)), col = maPalette(low = "white", high = "black", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="Error in 1M47 ", zlim=c(min(S1M47_mutent),max(S1M47_mutent)), Rowv = NA, Colv = NA, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) S1M47_mutent <- read.table("C:/Jacobson/homeira/reslist7_1M47_mutent_phipsichi_0diag_v8.txt") pdf(file="C:/Jacobson/homeira/MI_nocluster_1M47_reslist7_phipsichi.pdf") heatmap(x=as.matrix((S1M47_mutent)), col = maPalette(low = "white", high = "black", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1M47", Rowv = NA, Colv = NA, oldstyle = FALSE,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_cluster_1M47_reslist7_phipsichi.pdf") heatmap(x=as.matrix((S1M47_mutent)), col = maPalette(low = "white", high = "black", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1M47", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_colorbar_1M47_chi_reslist7_phipsichi.pdf") maColorBar(seq(min(S1M47_mutent),max(S1M47_mutent),by=(max(S1M47_mutent)-min(S1M47_mutent))/50), col = maPalette(low = "white", high = "black", k =50)) S1M48_mutent <- read.table("C:/Jacobson/homeira/reslist7_1M48_mutent_phipsichi_0diag_v8.txt") #windows() #heatmap(x=as.matrix((max(S1M48_mutent)-S1M48_mutent)), col = maPalette(low = "black", high = "white", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1M48", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_cluster_1M48_reslist7_phipsichi.pdf") heatmap(x=as.matrix((S1M48_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1M48", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_nocluster_1M48_reslist7_phipsichi.pdf") heatmap(x=as.matrix((S1M48_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1M48", Rowv = NA, Colv = NA, oldstyle = FALSE,symm=TRUE ) S1PY2_mutent <- read.table("C:/Jacobson/homeira/reslist7_1PY2_mutent_phipsichi_0diag_v8.txt") #windows() #heatmap(x=as.matrix((max(S1PY2_mutent)-S1PY2_mutent)), col = maPalette(low = "black", high = "white", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1PY2", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_cluster_1PY2_reslist7_phipsichi.pdf") heatmap(x=as.matrix((S1PY2_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1PY2", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_nocluster_1PY2_reslist7_phipsichi.pdf") heatmap(x=as.matrix((S1PY2_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1PY2", Rowv = NA, Colv = NA, oldstyle = FALSE,symm=TRUE ) S1NBP_mutent <- read.table("C:/Jacobson/homeira/reslist7_1NBP_mutent_phipsichi_0diag_v8.txt") #windows() #heatmap(x=as.matrix((max(S1NBP_mutent)-S1NBP_mutent)), col = maPalette(low = "black", high = "white", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1NBP", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_nocluster_1NBP_reslist7_phipsichi.pdf") heatmap(x=as.matrix((S1NBP_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1NBP", Rowv = NA, Colv = NA, oldstyle = FALSE,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_cluster_1NBP_reslist7_phipsichi.pdf") heatmap(x=as.matrix((S1NBP_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1NBP", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,symm=TRUE ) S1M47_mutent_unc <- read.table("C:/Jacobson/homeira/reslist7_1M47_uncert_phipsichi_v8.txt") pdf(file="C:/Jacobson/homeira/MI_nocluster_1M47_reslist7_phipsichi_uncert.pdf") heatmap(x=as.matrix((S1M47_mutent_unc)), col = maPalette(low = "white", high = "black", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="Error in 1M47 ", zlim=c(min(S1M47_mutent),max(S1M47_mutent)), Rowv = NA, Colv = NA, oldstyle = FALSE,symm=TRUE ) S1M48_mutent_unc <- read.table("C:/Jacobson/homeira/reslist7_1M48_uncert_phipsichi_v8.txt") pdf(file="C:/Jacobson/homeira/MI_nocluster_1M48_reslist7_phipsichi_uncert.pdf") heatmap(x=as.matrix((S1M48_mutent_unc)), col = maPalette(low = "white", high = "black", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="Error in 1M48 ", zlim=c(min(S1M47_mutent),max(S1M47_mutent)), Rowv = NA, Colv = NA, oldstyle = FALSE,symm=TRUE ) S1PY2_mutent_unc <- read.table("C:/Jacobson/homeira/reslist7_1PY2_uncert_phipsichi_v8.txt") pdf(file="C:/Jacobson/homeira/MI_nocluster_1PY2_reslist7_phipsichi_uncert.pdf") heatmap(x=as.matrix((S1PY2_mutent_unc)), col = maPalette(low = "white", high = "black", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="Error in 1PY2 ", zlim=c(min(S1M47_mutent),max(S1M47_mutent)), Rowv = NA, Colv = NA, oldstyle = FALSE,symm=TRUE ) S1NBP_mutent_unc <- read.table("C:/Jacobson/homeira/reslist7_1NBP_uncert_phipsichi_v8.txt") pdf(file="C:/Jacobson/homeira/MI_nocluster_1NBP_reslist7_phipsichi_uncert.pdf") heatmap(x=as.matrix((S1NBP_mutent_unc)), col = maPalette(low = "white", high = "black", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="Error in 1NBP ", zlim=c(min(S1M47_mutent),max(S1M47_mutent)), Rowv = NA, Colv = NA, oldstyle = FALSE,symm=TRUE ) ############################################################### Alternative dendrogram based on mutual information dissimilarity ################################################################## blah = agnes(as.matrix(max(S1M47_mutent)-S1M47_mutent),diss=TRUE) plot(blah) #S1M47_mutent <- read.table("C:/Jacobson/homeira/reslist_full_noglyala_1M47_mutent_0diag.txt") blah = diana(as.matrix(max(S1M47_mutent)-S1M47_mutent),diss=TRUE) plot(blah) blah = diana(as.matrix(max(S1M47_mutent)-S1M47_mutent),diss='TRUE') plot(blah) blah = agnes(as.matrix(max(S1M47_mutent)-S1M47_mutent),diss='TRUE') plot(blah) ?heatmap ?agnes plot(as.dendrogram(blah)) blah <- agnes(as.matrix(max(S1M47_mutent)-S1M47_mutent)) #bleh = data.frame(blah[1]) blah2<-as.hclust(blah) heatmap(x=as.matrix((S1M47_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1M47",revC=TRUE, Rowv = as.dendrogram(blah2), Colv = as.dendrogram(blah2), reorderfun = function(d,w) rev(reorder(d,w)), oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) ############################################################################# ### Plotting Marginal Histograms along with 2-D Histograms to help understand MI #http://addictedtor.free.fr/graphiques/graphcode.php?graph=78 require(gplots) require(marray) def.par <- par(no.readonly = TRUE) # save default, for resetting... x1 <- read.table("C:/Jacobson/homeira/test_handcalc_1m47_PHE78/run1/chi1PHE78.xvg") x2 <- read.table("C:/Jacobson/homeira/test_handcalc_1m47_PHE78/run2/chi1PHE78.xvg") x3 <- read.table("C:/Jacobson/homeira/test_handcalc_1m47_PHE78/run3/chi1PHE78.xvg") x4 <- read.table("C:/Jacobson/homeira/test_handcalc_1m47_PHE78/run4/chi1PHE78.xvg") x5 <- read.table("C:/Jacobson/homeira/test_handcalc_1m47_PHE78/run5/chi1PHE78.xvg") y1 <- read.table("C:/Jacobson/homeira/test_handcalc_1m47_PHE78/run1/chi2PHE78.xvg") y2 <- read.table("C:/Jacobson/homeira/test_handcalc_1m47_PHE78/run2/chi2PHE78.xvg") y3 <- read.table("C:/Jacobson/homeira/test_handcalc_1m47_PHE78/run3/chi2PHE78.xvg") y4 <- read.table("C:/Jacobson/homeira/test_handcalc_1m47_PHE78/run4/chi2PHE78.xvg") y5 <- read.table("C:/Jacobson/homeira/test_handcalc_1m47_PHE78/run5/chi2PHE78.xvg") x<-append(as.matrix(x1[2]),append(as.matrix(x2[2]),append(as.matrix(x3[2]),append(as.matrix(x4[2]),as.matrix(x5[2]))))) y<-append(as.matrix(y1[2]),append(as.matrix(y2[2]),append(as.matrix(y3[2]),append(as.matrix(y4[2]),as.matrix(y5[2]))))) par(def.par) xhist <- hist(x, breaks=seq(-180,180,15), plot=FALSE) yhist <- hist(y, breaks=seq(-180,180,15), plot=FALSE) top <- max(c(xhist$counts, yhist$counts)) xrange <- c(-180,180) yrange <- c(-180,180) xy_matrix <- hist2d(as.vector(x), as.vector(y), xlim=xrange, ylim=yrange, nbins=360/15, xlab="", ylab="", show=FALSE) nf <- layout(matrix(c(2,0,1,3,4,0),3,2,byrow=TRUE), widths=c(3,1), heights=c(1,3,1), respect=TRUE) #layout.show(nf) par(cex.axis=1.5) par(mar=c(3.8,3.8,1.7,1.7)) #image(as.matrix(xy_matrix$counts), xlab="", ylab="",col = maPalette(low = "white", high = "black", k =100)) hist2d(as.vector(x), as.vector(y), nbins=360/15, xlab="Angle(Deg)", ylab="Angle(Deg)", show=TRUE,col = maPalette(low = "white", high = "black", k =100),cex.lab=1.25) box() par(mar=c(0,3.1,1,1)) barplot(xhist$counts, axes=FALSE, ylim=c(0, top), space=0, main="Histograms for Phe78's Chi Angles",cex.main=1.25) par(mar=c(3.1,0,1,1)) barplot(yhist$counts, axes=FALSE, xlim=c(0, top), space=0, horiz=TRUE) par(mar=c(3.8,3.8,1.7,5.0)) maColorBar(seq(0,max(xy_matrix$counts)/sum(xy_matrix$counts),by=(max(xy_matrix$counts)/sum(xy_matrix$counts))/50), col = maPalette(low = "white", high = "black", k =100)) par(def.par) ############################################################################# S1M48_mutent <- read.table("C:/Jacobson/homeira/reslist_full_noglyala_1M48_mutent_0diag.txt") #windows() #heatmap(x=as.matrix((max(S1M48_mutent)-S1M48_mutent)), col = maPalette(low = "black", high = "white", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1M48", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_cluster_1M48_chi.pdf") heatmap(x=as.matrix((S1M48_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1M48", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_nocluster_1M48_chi.pdf") heatmap(x=as.matrix((S1M48_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1M48", Rowv = NA, Colv = NA, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) S1PY2_mutent <- read.table("C:/Jacobson/homeira/reslist_full_noglyala_1PY2_mutent_0diag_v8.txt") #windows() #heatmap(x=as.matrix((max(S1PY2_mutent)-S1PY2_mutent)), col = maPalette(low = "black", high = "white", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1PY2", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_cluster_1M48_chi.pdf") heatmap(x=as.matrix((S1PY2_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1PY2", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) windows() S1M47_mutent <- read.table("C:/Jacobson/homeira/reslist_full_noglyala_1M47_mutent_0diag.txt") pdf(file="C:/Jacobson/homeira/MI_nocluster_1M47_chi.pdf") heatmap(x=as.matrix((S1M47_mutent)), col = maPalette(low = "white", high = "black", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1M47", Rowv = NA, Colv = NA, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_cluster_1M47_chi.pdf") heatmap(x=as.matrix((S1M47_mutent)), col = maPalette(low = "white", high = "black", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1M47", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_colorbar_1M47_chi.pdf") maColorBar(seq(min(S1M47_mutent),max(S1M47_mutent),by=(max(S1M47_mutent)-min(S1M47_mutent))/50), col = maPalette(low = "white", high = "black", k =50)) S1M48_mutent <- read.table("C:/Jacobson/homeira/reslist_full_noglyala_1M48_mutent_0diag.txt") #windows() #heatmap(x=as.matrix((max(S1M48_mutent)-S1M48_mutent)), col = maPalette(low = "black", high = "white", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1M48", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_cluster_1M48_chi.pdf") heatmap(x=as.matrix((S1M48_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1M48", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_nocluster_1M48_chi.pdf") heatmap(x=as.matrix((S1M48_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1M48", Rowv = NA, Colv = NA, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) S1PY2_mutent <- read.table("C:/Jacobson/homeira/reslist_full_noglyala_1PY2_mutent_0diag_v8.txt") #windows() #heatmap(x=as.matrix((max(S1PY2_mutent)-S1PY2_mutent)), col = maPalette(low = "black", high = "white", k =50), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1PY2", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_cluster_1NBP_chi.pdf") heatmap(x=as.matrix((S1PY2_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1PY2", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_nocluster_1PY2_chi.pdf") heatmap(x=as.matrix((S1PY2_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1PY2", Rowv = NA, Colv = NA, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) S1NBP_mutent <- read.table("C:/Jacobson/homeira/reslist_full_noglyala_1NBP_mutent_0diag_v8.txt") windows() pdf(file="C:/Jacobson/homeira/MI_cluster_1NBP_chi.pdf") heatmap(x=as.matrix((S1NBP_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1NBP", reorderfun = function(d,w) rev(reorder(d,w)),revC=TRUE, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE ) windows() pdf(file="C:/Jacobson/homeira/MI_nocluster_1NBP_chi.pdf") heatmap(x=as.matrix((S1NBP_mutent)), col = maPalette(low = "white", high = "black", k =50), zlim=c(min(S1M47_mutent),max(S1M47_mutent)), add = FALSE, xaxs = "i", yaxs = "i",xaxt= "n", yaxt = "n", xlab="residue", ylab="residue", main="1NBP", Rowv = NA, Colv = NA, oldstyle = FALSE,cexRow=0.2,cexCol=0.20,symm=TRUE )