library(bio3d)
library(Hmisc)
source("corr_mat_fun.R")

pdb.A <- read.pdb("1XCK_A.pdb")
sse <- dssp(pdb.A)

#pdb <- read.pdb("1XCK_chainALM_noWAT_noH.pdb")
#sse <- dssp(pdb)


A <- scan( "monomer_corr.dat" )
#A <- scan( "~/gulrotkake/groel_md/1XCK/129_1XCK_MGATP/results/correlation_trimer/trimer_corr_all.dat")
n <- sqrt(length(A))
corr.MD.holo <- matrix( A, n, n, byrow = TRUE)

#h <- which(corr.MD.holo>0.2)
#l <- which(corr.MD.holo<(-0.2))
#hmm=corr.MD.holo*0
#hmm[h]=corr.MD.holo[h]
#hmm[l]=corr.MD.holo[l]
#corr.MD.holo=hmm


helix.labels = capitalize(letters[1:length(sse$helix$start)])
helix.labels.at=(sse$helix$start+sse$helix$end)/2
axis.at=sse$helix$start
axis.labels=sse$helix$start

vlines=c(136, 191, 374, 409)
hlines=c(136, 191, 374, 409)
 
  
#png("corrMat.holo.png", width=1000, height=1000,
#    pointsize=24)
pdf("corrMat.holo.pdf", w=8, h=7)
plot.corrmat(corr.MD.holo, sse,
             helix.labels.x=helix.labels, helix.labels.y=helix.labels,
	     helix.labels.at.x=helix.labels.at, helix.labels.at.y=helix.labels.at,
             axis.at.x=axis.at, axis.at.y=axis.at,
	     axis.labels.x=axis.labels, axis.labels.y=axis.labels,
             vlines=vlines, hlines=hlines, main="Cross correlation")
dev.off()



