By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,009 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

want to link PDB browser button and DCD broswer button where the code is present

P: 1
I am using Boa Constructor GUI for graphical representation of PCA (principal component analysis) code which is in R language. i want to give option of browsing PDB file and DCD file and another option of PLOT for plotting the graph and values taken from uploaded files. how can i do it in Boa constructor my code is :
Expand|Select|Wrap|Line Numbers
  1. def OnPCA_buttonButton(self, event):
  2.         f = open('myfile.R' , 'w')
  3.         f.write('library(bio3d)\n')
  4.         f.write('mydcdfile <-"/home/fareeha/Desktop/GraphMDresearch_paper/Sourcecodes/sample.dcd"\n') 
  5.         f.write('mypdbfile <-"/home/fareeha/Desktop/GraphMDresearch_paper/Sourcecodes/sample.pdb"\n')
  6.         f.write('dcd <- read.dcd(mydcdfile)\n')
  7.         f.write('pdb <- read.pdb(mypdbfile)\n')
  8.         f.write('print(pdb)\n')
  9.         f.write('print(pdb$xyz)\n')
  10.         f.write('print(dcd)\n')
  11.         f.write('ca.inds <- atom.select(pdb, elety="CA")\n')
  12.         f.write('xyz <- fit.xyz(fixed=pdb$xyz, mobile=dcd,fixed.inds=ca.inds$xyz,mobile.inds=ca.inds$xyz)\n')
  13.         f.write('dim(xyz) == dim(dcd)\n')
  14.         f.write('pc <- pca.xyz(xyz[,ca.inds$xyz])\n')
  15.         f.write('plot(pc, col=bwr.colors(nrow(xyz)) )\n')
  16.         f.write('hc <- hclust(dist(pc$z[,1:2]))\n')
  17.         f.write('grps <- cutree(hc, k=2)\n')
  18.         f.write('plot(pc, col=grps)\n')
  19.         f.write('plot.bio3d(pc$au[,1], ylab="PC1 (A)", xlab="Residue Position", typ="l")\n')
  20.         f.write('points(pc$au[,2], typ="l", col="blue")\n')
  21.         f.write('p1 <- mktrj.pca(pc, pc=1, b=pc$au[,1], file="pc1.pdb")\n')
  22.         f.write('p2 <- mktrj.pca(pc, pc=2,b=pc$au[,2], file="pc2.pdb")\n')
  23.         f.write('write.ncdf(p1, "trj_pc1.nc")\n')
  24.         f.close()
  25.         os.system("R CMD BATCH myfile.R")
Apr 5 '16 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.