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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ashuafi
    New Member
    • Apr 2016
    • 1

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

    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 :
    Code:
    def OnPCA_buttonButton(self, event):
            f = open('myfile.R' , 'w')
            f.write('library(bio3d)\n')
            f.write('mydcdfile <-"/home/fareeha/Desktop/GraphMDresearch_paper/Sourcecodes/sample.dcd"\n') 
            f.write('mypdbfile <-"/home/fareeha/Desktop/GraphMDresearch_paper/Sourcecodes/sample.pdb"\n')
            f.write('dcd <- read.dcd(mydcdfile)\n')
            f.write('pdb <- read.pdb(mypdbfile)\n')
            f.write('print(pdb)\n')
            f.write('print(pdb$xyz)\n')
            f.write('print(dcd)\n')
            f.write('ca.inds <- atom.select(pdb, elety="CA")\n')
            f.write('xyz <- fit.xyz(fixed=pdb$xyz, mobile=dcd,fixed.inds=ca.inds$xyz,mobile.inds=ca.inds$xyz)\n')
            f.write('dim(xyz) == dim(dcd)\n')
            f.write('pc <- pca.xyz(xyz[,ca.inds$xyz])\n')
            f.write('plot(pc, col=bwr.colors(nrow(xyz)) )\n')
            f.write('hc <- hclust(dist(pc$z[,1:2]))\n')
            f.write('grps <- cutree(hc, k=2)\n')
            f.write('plot(pc, col=grps)\n')
            f.write('plot.bio3d(pc$au[,1], ylab="PC1 (A)", xlab="Residue Position", typ="l")\n')
            f.write('points(pc$au[,2], typ="l", col="blue")\n')
            f.write('p1 <- mktrj.pca(pc, pc=1, b=pc$au[,1], file="pc1.pdb")\n')
            f.write('p2 <- mktrj.pca(pc, pc=2,b=pc$au[,2], file="pc2.pdb")\n')
            f.write('write.ncdf(p1, "trj_pc1.nc")\n')
            f.close()
            os.system("R CMD BATCH myfile.R")
Working...