library(bio3d)

pdb <- read.pdb("/net/gulrotkake/slars/groel_md/1XCK/129_1XCK_MGATP/1XCK_MGATP_noWAT_noH.pdb.1", maxlines=-1)
q

ca.inds <- atom.select(pdb, "calpha")
seq <- seq.pdb(pdb)

sim129 <- NULL
prefix129 <- "/net/gulrotkake/slars/groel_md/1XCK/129_1XCK_MGATP/results/traj/50ns_1000frames_noWAT_noH.nc"

trj.inds <- seq(1, 1000, by=5)
tmptrj <- read.ncdf(prefix129)
sim129$trj = tmptrj[trj.inds,]

sim129$pca <- pca.xyz(sim129$trj[,ca.inds$xyz])
a <- mktrj.pca(sim129$pca, pc=1, file="129_pc1.pdb", mag=1.5, step=0.175)
a <- mktrj.pca(sim129$pca, pc=2, file="129_pc2.pdb", mag=1.5, step=0.175)
a <- mktrj.pca(sim129$pca, pc=3, file="129_pc3.pdb", mag=1.5, step=0.175)


pdb <- read.pdb("/net/gulrotkake/slars/groel_md/1XCK/117_1XCK_hepta/1XCK_hept_apo_noWAT_noH.pdb.1")
ca.inds <- atom.select(pdb, "calpha")
trj.inds <- seq(1, 1000, by=5)

sim129 <- NULL
prefix129 <- "/net/gulrotkake/slars/groel_md/1XCK/129_1XCK_MGATP/results/traj_heptamer/"
prefix <- "50ns_noWAT_1000frames_noATP_noH_hept_"
 
tmptrj <- read.ncdf(paste(prefix129, prefix, 1 , ".nc", sep=""))
sim129$trj$cis = rbind(sim129$trj$cis, tmptrj[trj.inds,])

tmptrj <- read.ncdf(paste(prefix129, prefix, 2 , ".nc", sep=""))
sim129$trj$trans = rbind(sim129$trj$trans, tmptrj[trj.inds,])

sim129$pca.cis <- pca.xyz(sim129$trj$cis[,ca.inds$xyz])
a <- mktrj.pca(sim129$pca.cis, pc=1, file="129_cis.pc1.pdb", mag=1.5, step=0.175)
a <- mktrj.pca(sim129$pca.cis, pc=2, file="129_cis.pc2.pdb", mag=1.5, step=0.175)
a <- mktrj.pca(sim129$pca.cis, pc=3, file="129_cis.pc3.pdb", mag=1.5, step=0.175)

sim129$pca.trans <- pca.xyz(sim129$trj$trans[,ca.inds$xyz])



               
