PCA: mktrj.pca produces identical output for p1, p2, etc

Issue #261 resolved
Former user created an issue

I'm using the latest version of Bio3D on a Mac OS X 10.10.4

I followed the procedure described in the Beginning Trajectory Analysis Vignette. I obtained good results on the distribution onto the subspace defined by the largest principal components (attach_1).

Issuing the following commands produced identical output files (differences only in the last column).

p1 <- mktrj.pca(pc, pc = 1, b = pc$au[, 1], resid=residues, file = "pc1.pdb")

p2 <- mktrj.pca(pc, pc = 2, b = pc$au[, 2], resid=residues, file = "pc2.pdb")

p3 <- mktrj.pca(pc, pc = 3, b = pc$au[, 3], resid=residues, file = "pc3.pdb")

See pdb files attached.

I'm not sure if this is a bug or there's something wrong with the issued commands

Thank you in advance for your help

Regards

George

Comments (12)

  1. Xinqiu Yao

    Hi George,

    Sorry I don't see the pdb files you've attached. I tried with my example but couldn't reproduce the problem. Are you using the latest released version (i.e. v2.2-2) or the latest developmental version (e.g. downloaded from this website)? Also note that the outputs are identical in MODEL 1 but will be different in MODEL 2 and so on.

  2. George Tzotzos

    I'm using the latest release version (not the developmental one).

    I'll try with the tutorial example to see if I reproduce the problem. Thank you for the prompt reply Much appreciated

    George

  3. Lars Skjærven

    Hei, The CRAN version does not produce identical output as far as I can see. However, this was indeed a bug, back in 2011 I believe.

    > install.packages("bio3d")
    > library(bio3d)
    > attach(transducin)
    > pc <- pca(pdbs)
    
    > mktrj.pca(pc, pc = 2)[1:5, 1:5]
             [,1]     [,2]     [,3]     [,4]     [,5]
    [1,] 24.09146 75.49203 44.42817 22.61949 77.91995
    [2,] 24.10225 75.48894 44.41738 22.63324 77.92604
    [3,] 24.11304 75.48584 44.40659 22.64699 77.93214
    [4,] 24.12384 75.48275 44.39580 22.66074 77.93823
    [5,] 24.13463 75.47966 44.38501 22.67450 77.94433
    > mktrj.pca(pc, pc = 1)[1:5, 1:5]
             [,1]     [,2]     [,3]     [,4]     [,5]
    [1,] 24.09146 75.49203 44.42817 22.61949 77.91995
    [2,] 24.09706 75.48409 44.40054 22.61821 77.91977
    [3,] 24.10266 75.47614 44.37291 22.61693 77.91958
    [4,] 24.10827 75.46820 44.34527 22.61565 77.91940
    [5,] 24.11387 75.46025 44.31764 22.61437 77.91922
    
    > sessionInfo()
    R version 3.2.1 (2015-06-18)
    Platform: x86_64-redhat-linux-gnu (64-bit)
    Running under: Fedora 21 (Twenty One)
    
    locale:
     [1] LC_CTYPE=C                 LC_NUMERIC=C              
     [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
     [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
     [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
     [9] LC_ADDRESS=C               LC_TELEPHONE=C            
    [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
    
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base     
    
    other attached packages:
    [1] bio3d_2.2-2
    
    loaded via a namespace (and not attached):
    [1] parallel_3.2.1 tools_3.2.1    grid_3.2.1  
    
  4. George Tzotzos

    Just to let you know that I retried to no avail. Below are the heads and tails of the 3 first PCs, namely, pc1.pdb; pc2.pdb; pc3.pdb

    As you can see they are almost identical

    Last login: Mon Aug 3 19:58:37 on ttys002 Georges-MacBook-Pro:6_PCA gtzotzos$ cd /Users/gtzotzos/Desktop/6_PCA Georges-MacBook-Pro:6_PCA gtzotzos$ head pc1.pdb MODEL 1 ATOM 1 CA ASP 1 -4.623 -8.510 9.012 1.00 0.18
    ATOM 2 CA THR 2 -2.917 -8.635 11.605 1.00 0.15
    ATOM 3 CA THR 3 -0.813 -11.415 10.625 1.00 0.11
    ATOM 4 CA PRO 4 2.928 -11.237 10.586 1.00 0.09
    ATOM 5 CA ARG 5 5.108 -11.438 7.544 1.00 0.09
    ATOM 6 CA ARG 6 6.187 -14.669 6.477 1.00 0.12
    ATOM 7 CA ASP 7 8.588 -14.110 3.746 1.00 0.12
    ATOM 8 CA ALA 8 12.085 -14.598 3.773 1.00 0.12
    ATOM 9 CA GLU 9 13.197 -11.480 2.414 1.00 0.08
    Georges-MacBook-Pro:6_PCA gtzotzos$ head pc2.pdb MODEL 1 ATOM 1 CA ASP 1 -4.623 -8.510 9.012 1.00 0.12
    ATOM 2 CA THR 2 -2.917 -8.635 11.605 1.00 0.10
    ATOM 3 CA THR 3 -0.813 -11.415 10.625 1.00 0.12
    ATOM 4 CA PRO 4 2.928 -11.237 10.586 1.00 0.10
    ATOM 5 CA ARG 5 5.108 -11.438 7.544 1.00 0.09
    ATOM 6 CA ARG 6 6.187 -14.669 6.477 1.00 0.11
    ATOM 7 CA ASP 7 8.588 -14.110 3.746 1.00 0.09
    ATOM 8 CA ALA 8 12.085 -14.598 3.773 1.00 0.06
    ATOM 9 CA GLU 9 13.197 -11.480 2.414 1.00 0.05
    Georges-MacBook-Pro:6_PCA gtzotzos$ head pc3.pdb MODEL 1 ATOM 1 CA ASP 1 -4.623 -8.510 9.012 1.00 0.19
    ATOM 2 CA THR 2 -2.917 -8.635 11.605 1.00 0.14
    ATOM 3 CA THR 3 -0.813 -11.415 10.625 1.00 0.13
    ATOM 4 CA PRO 4 2.928 -11.237 10.586 1.00 0.10
    ATOM 5 CA ARG 5 5.108 -11.438 7.544 1.00 0.09
    ATOM 6 CA ARG 6 6.187 -14.669 6.477 1.00 0.16
    ATOM 7 CA ASP 7 8.588 -14.110 3.746 1.00 0.13
    ATOM 8 CA ALA 8 12.085 -14.598 3.773 1.00 0.17
    ATOM 9 CA GLU 9 13.197 -11.480 2.414 1.00 0.12
    Georges-MacBook-Pro:6_PCA gtzotzos$ tail pc1.pdb ATOM 243 CA ASP 243 23.135 19.820 6.112 1.00 0.06
    ATOM 244 CA PRO 244 24.120 23.415 5.476 1.00 0.06
    ATOM 245 CA LYS 245 22.861 23.497 1.925 1.00 0.06
    ATOM 246 CA HIE 246 19.357 22.324 2.626 1.00 0.05
    ATOM 247 CA TYR 247 18.724 24.451 5.722 1.00 0.04
    ATOM 248 CA PHE 248 16.650 27.602 5.636 1.00 0.04
    ATOM 249 CA LEU 249 14.933 30.000 8.042 1.00 0.03
    ATOM 250 CA VAL 250 12.907 32.465 6.286 1.00 0.07
    ENDMDL END
    Georges-MacBook-Pro:6_PCA gtzotzos$ tail pc2.pdb ATOM 243 CA ASP 243 23.107 19.823 6.067 1.00 0.04
    ATOM 244 CA PRO 244 24.080 23.434 5.447 1.00 0.04
    ATOM 245 CA LYS 245 22.817 23.504 1.885 1.00 0.05
    ATOM 246 CA HIE 246 19.319 22.302 2.586 1.00 0.05
    ATOM 247 CA TYR 247 18.706 24.416 5.697 1.00 0.06
    ATOM 248 CA PHE 248 16.642 27.579 5.615 1.00 0.07
    ATOM 249 CA LEU 249 14.931 29.986 8.017 1.00 0.06
    ATOM 250 CA VAL 250 12.809 32.428 6.345 1.00 0.05
    ENDMDL END
    Georges-MacBook-Pro:6_PCA gtzotzos$ tail pc3.pdb ATOM 243 CA ASP 243 23.120 19.881 6.035 1.00 0.07
    ATOM 244 CA PRO 244 24.078 23.493 5.423 1.00 0.07
    ATOM 245 CA LYS 245 22.804 23.580 1.871 1.00 0.06
    ATOM 246 CA HIE 246 19.313 22.356 2.569 1.00 0.04
    ATOM 247 CA TYR 247 18.688 24.464 5.681 1.00 0.03
    ATOM 248 CA PHE 248 16.594 27.608 5.610 1.00 0.02
    ATOM 249 CA LEU 249 14.882 30.005 8.021 1.00 0.01
    ATOM 250 CA VAL 250 12.767 32.456 6.359 1.00 0.07
    ENDMDL END

  5. George Tzotzos

    Thank you Lars

    Do you suggest that I should get rid of my current version and reinstall from CRAN?

    Regards

    George

  6. George Tzotzos

    I just notice that the Bio3D binaries in CRAN are for Mavericks. I'm running Yoshemite OS X 10.10

    Is there a known problem?

    Thanks once again

    George

  7. Xinqiu Yao

    Hi,

    From above you've shown, the 'tail' of the three PCs are NOT identical. Have you checked the three files with VMD? For example, vmd -m pc1.pdb pc2.pdb pc3.pdb should tell you the difference of the three PCs.

  8. George Tzotzos

    Apologies for replying off list but I could not see how to attach the model files.

    I detected no differences in Chimera. I shall also try VMD but I doubt if it’ll behave differently.

    Thank you once again

    George

  9. Lars Skjærven

    So what does sessionInfo() say?

    If you unable to install from CRAN, you can try installing directly from bitbucket using the devtools package:

    remove.packages("bio3d")
    install.packages("devtools")
    devtools::install_bitbucket("Grantlab/bio3d", subdir = "ver_devel/bio3d/", ref = "releases")
    
  10. George Tzotzos

    sessionInfo() says:

    sessionInfo() R version 3.2.1 (2015-06-18) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: OS X 10.10.4 (Yosemite)

    locale: [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

    attached base packages: [1] stats graphics grDevices utils datasets methods base

    other attached packages: [1] bio3d_2.2-2

    loaded via a namespace (and not attached): [1] ncdf_1.6.8 parallel_3.2.1 grid_3.2.1

    I’m also attaching the Session history. I shall now proceed to (de)-reinstall according to your suggestion and will re-run on the same files.

    Thank you

    George

  11. George Tzotzos

    I have the feeling this time, it worked.

    I’m attaching the R session. It includes sessionInfo()

    I opened pc1.pdb and pc2.pdb in Chimera and I detect differences.

    Thank you for the kind help. Much appreciated.

    George

  12. Log in to comment