torsion.pdb with proline

Issue #670 resolved
Former user created an issue

I may have found an issue with torsion.pdb. I'm trying to get all the torsional chi angles for proline, however when I run this code :

require("devtools") 
library(devtools) 
if (!require(bio3d)) { 
   install_bitbucket("Grantlab/bio3d", subdir = "ver_devel/bio3d/") 
   library(bio3d) 
} 
library(bio3d) 
setwd("W:/PDB's/PDB's for Proline 2019/Coot Test Group") 
getwd() 
pdbfiles <- list.files(pattern = "*.pdb", full.names = TRUE) 
help(package=bio3d) 
resid <- readline(prompt="Enter 3 letter residue ID: ") 
for (i in pdbfiles){ 
   pdb <- read.pdb(i) 
   index <- trim(pdb, resid = resid, inds = NULL, sse = TRUE) 
   index <- index[lapply(index,length)>0] 
   print(i) 
   try(print(torsion.pdb(index)$tbl)) 
}

which trims all the pdb in a file to just proline (you must type PRO into the console prompt) and then runs it through torsion.pdb, the chi1 and chi2 values are correct, but the others are NA:

[1] &#34;./6fq1.pdb&#34; phi psi chi1 chi2 chi3 chi4 chi5 15.A.PRO NA 159.59500218 -31.54459 38.20030 NA NA NA 28.A.PRO -70.727327 151.58909803 31.78695 -37.68313 NA NA NA 32.A.PRO -78.816872 38.84767760 29.14053 -38.09224 NA NA NA 45.A.PRO -133.882881 0.03031784 -23.12099 36.75638 NA NA NA

So I looked into the function torsion.pdb and I thought the issue was that the chi3 and chi4 values are calculated by going to the &#34;_E&#34; and &#34;_Z&#34;:

chi3 <- torsion.xyz(co[repadd(getinds(c(&#34;CB&#34;, &#34;_G&#34;, &#34;_D&#34;, &#34;_E&#34;)))]) chi31 <- torsion.xyz(co[repadd(getinds(c(&#34;CB&#34;, &#34;_G&#34;, &#34;_D&#34;, &#34;NH1&#34;)))]) chi4 <- torsion.xyz(co[repadd(getinds(c(&#34;_G&#34;, &#34;_D&#34;, &#34;_E&#34;, &#34;*Z&#34;)))])

Proline doesn&#39;t have these atoms, and instead the values are calculated by looping around back to &#34;N&#34;, so I copied the function into a new file tried just replaced &#34;_E&#34; with &#34;N&#34;, and &#34;_Z&#34; to &#34;CA&#34; to calculate the angles between the correct atoms:

chi3 <- torsion.xyz(co[repadd(getinds(c(&#34;CB&#34;, &#34;_G&#34;, &#34;_D&#34;, &#34;N&#34;)))]) chi31 <- torsion.xyz(co[repadd(getinds(c(&#34;CB&#34;, &#34;_G&#34;, &#34;_D&#34;, &#34;N&#34;)))]) chi4 <- torsion.xyz(co[repadd(getinds(c(&#34;_G&#34;, &#34;_D&#34;, &#34;N&#34;, &#34;CA&#34;)))])

and while I did end up with some values:

[1] &#34;./6fq1.pdb&#34; phi psi chi1 chi2 chi3 chi4 chi5 15.A.PRO NA 159.59500218 -31.54459 38.20030 18.51810 5.859691 -8.1921220 28.A.PRO -70.727327 151.58909803 31.78695 -37.68313 -17.82354 -4.874556 8.8077227 32.A.PRO -78.816872 38.84767760 29.14053 -38.09224 -19.80302 -8.094848 5.8281619

When compared to the values that my classmates calculated by measure in WINCOOT chi3 and 4 don&#39;t match:

Chi1 Chi2 Chi3 Chi4 -31.54 38.2 -29.48 9.52 31.79 -37.68 28.13 -7.92 29.14 -38.09 31.48 13.22

I&#39;ve attached the script and the torsion.pdb function i edited to this, I&#39;m pretty new to coding and really new to R, so i&#39;m sure it&#39;s something i&#39;m overlooking (I understand almost nothing in the function torsion.pdb) Any help would be greatly appreciated, thank you.

Comments (3)

  1. Xinqiu Yao
    • edited description

    I may have found an issue with torsion.pdb. I'm trying to get all the torsional chi angles for proline, however when I run this code :

    require("devtools") library(devtools) if (!require(bio3d)) { install_bitbucket("Grantlab/bio3d", subdir = "ver_devel/bio3d/") library(bio3d) } library(bio3d) setwd("W:/PDB's/PDB's for Proline 2019/Coot Test Group") getwd() pdbfiles <- list.files(pattern = "*.pdb", full.names = TRUE) help(package=bio3d) resid <- readline(prompt="Enter 3 letter residue ID: ") for (i in pdbfiles){ pdb <- read.pdb(i) index <- trim(pdb, resid = resid, inds = NULL, sse = TRUE) index <- index[lapply(index,length)>0] print(i) try(print(torsion.pdb(index)$tbl)) }

    which trims all the pdb in a file to just proline (you must type PRO into the console prompt) and then runs it through torsion.pdb, the chi1 and chi2 values are correct, but the others are NA:

    [1] "./6fq1.pdb" phi psi chi1 chi2 chi3 chi4 chi5 15.A.PRO NA 159.59500218 -31.54459 38.20030 NA NA NA 28.A.PRO -70.727327 151.58909803 31.78695 -37.68313 NA NA NA 32.A.PRO -78.816872 38.84767760 29.14053 -38.09224 NA NA NA 45.A.PRO -133.882881 0.03031784 -23.12099 36.75638 NA NA NA

    So I looked into the function torsion.pdb and I thought the issue was that the chi3 and chi4 values are calculated by going to the "E" and "Z":

    chi3 <- torsion.xyz(co[repadd(getinds(c("CB", "G", "D", "E")))]) chi31 <- torsion.xyz(co[repadd(getinds(c("CB", "G", "D", "NH1")))]) chi4 <- torsion.xyz(co[repadd(getinds(c("G", "D", "E", "*Z")))])

    Proline doesn't have these atoms, and instead the values are calculated by looping around back to "N", so I copied the function into a new file tried just replaced "E" with "N", and "Z" to "CA" to calculate the angles between the correct atoms:

    chi3 <- torsion.xyz(co[repadd(getinds(c("CB", "G", "D", "N")))]) chi31 <- torsion.xyz(co[repadd(getinds(c("CB", "G", "D", "N")))]) chi4 <- torsion.xyz(co[repadd(getinds(c("G", "D", "N", "CA")))])

    and while I did end up with some values:

    [1] "./6fq1.pdb" phi psi chi1 chi2 chi3 chi4 chi5 15.A.PRO NA 159.59500218 -31.54459 38.20030 18.51810 5.859691 -8.1921220 28.A.PRO -70.727327 151.58909803 31.78695 -37.68313 -17.82354 -4.874556 8.8077227 32.A.PRO -78.816872 38.84767760 29.14053 -38.09224 -19.80302 -8.094848 5.8281619

    When compared to the values that my classmates calculated by measure in WINCOOT chi3 and 4 don't match:

    Chi1 Chi2 Chi3 Chi4 -31.54 38.2 -29.48 9.52 31.79 -37.68 28.13 -7.92 29.14 -38.09 31.48 13.22

    I've attached the script and the torsion.pdb function i edited to this, I'm pretty new to coding and really new to R, so i'm sure it's something i'm overlooking (I understand almost nothing in the function torsion.pdb) Any help would be greatly appreciated, thank you.

  2. Xinqiu Yao

    Can you tidy up your text a little bit? I tried to reformat but still is very hard to read…

  3. Log in to comment