Protein RNA cross correlation (Xyz coordinates error)

Issue #776 resolved
Former user created an issue

print(pdbfile)

Call: read.pdb(file = "smallwt1.pdb")

Total Models#: 1

 Total Atoms#: 2984,  XYZs#: 8952  Chains#: 1  (values: A)



 Protein Atoms#: 1462  (residues/Calpha atoms#: 94)

 Nucleic acid Atoms#: 1522  (residues/phosphate atoms#: 48)



 Non-protein/nucleic Atoms#: 0  (residues: 0)

 Non-protein/nucleic resid values: [ none ]

Protein sequence:

  GSSGSSGMSGGLAPSKSTVYVSNLPFSLTNNDLYRIFSKYGKVVKVTIMKDKDTRKSKGV

  AFILFLDKDSAQNCTRAINNKQLFGRVIKASIAI

Nucleic acid sequence:

  AUUAAAGACCAACCAACUUCUGUUCUCUAAACGAACUUUAAAUUAAUA
  • attr: atom, xyz, calpha, call

dcd <- read.dcd(dcdfile)

NATOM = 30378

NFRAME= 1002

ISTART= 0

last = 1002

nstep = 1002

nfile = 1002

NSAVE = 1

NDEGF = 0

version 24

|======================== | 21%Error in readBin(trj, "numeric", size = 8, n = (a/8), endian = head$end) :

invalid 'n' argument

In addition: Warning message:

In rbind(x, y, z) :

number of columns of result is not a multiple of vector length (arg 3)

ca.inds <- atom.select(pdbfile, elety="CA")

ca.inds

Call: atom.select.pdb(pdb = pdbfile, elety = "CA")

Atom Indices#: 94 ($atom)

XYZ Indices#: 282 ($xyz)

  • attr: atom, xyz, call

inds <- atom.select(pdbfile, elety = "P")

View(inds)

inds

Call: atom.select.pdb(pdb = pdbfile, elety = "P")

Atom Indices#: 48 ($atom)

XYZ Indices#: 144 ($xyz)

  • attr: atom, xyz, call

casc.local.inds <- combine.select(ca.inds,inds, operator="+")

Union of selects

  • Selected a total of: 142 atoms *

casc.local.inds[["atom"]]

[1] 2 11 22 33 40 51 62 69 86 97 104 111 130 140 154 165 187 198 212 228 249 265 276

[24] 290 309 323 343 354 373 387 401 415 427 446 467 491 510 530 541 563 584 591 613 629 645 667

[47] 683 697 716 733 755 767 789 801 815 839 861 872 894 901 917 927 947 966 985 1005 1024 1036 1058

[70] 1070 1081 1091 1108 1122 1133 1147 1171 1181 1200 1214 1228 1250 1267 1286 1306 1313 1337 1353 1372 1394 1404 1415

[93] 1434 1444 1463 1496 1526 1556 1589 1622 1655 1689 1722 1753 1784 1817 1850 1881 1912 1945 1978 2009 2039 2069 2100

[116] 2130 2164 2194 2224 2255 2285 2316 2346 2379 2412 2445 2476 2510 2543 2576 2607 2637 2667 2697 2730 2763 2796 2826

[139] 2856 2889 2922 2952

xyz <- fit.xyz(fixed = pdbfile$xyz, mobile=dcdfile, fixed.inds = casc.local.inds$xyz, mobile.inds = casc.local.inds$xyz)

Error in fit.xyz(fixed = pdbfile$xyz, mobile = dcdfile, fixed.inds = casc.local.inds$xyz, :

input 'mobile' should be numeric

Comments (16)

  1. Xinqiu Yao

    It shows that the error is because dcdfile (the “mobile” in the last command) is not ‘numeric’. This correlate with the other error occurred at the beginning in calling read.dcd(). So, it must be something is wrong in the DCD file.

    Can you check the steps you generated the DCD file? Was it from a MD software (e.g., CHARMM) or converted from other format? You can also check by VMD and see if it can be loaded into VMD.

  2. minal chaudhary

    Simulation was performed in schrodinger Maestro. We got out-CMS file. Then loded Trajectory in VMD and form dcd file. (Trajectory was developed in vmd)

  3. Xinqiu Yao

    It would be difficult to figure out without detailed information such as OS, versions of Bio3D and related software (e.g., VMD), etc. Can you provide this? Also, you may consider providing a short example for us to reproduce the error. See the instruction when you click ‘Create issue’ for more detail.

  4. minal chaudhary

    We we are using by 3D in r studio version 3.6.2 (2019-12-12). Version of bio3D is 2.4.1.9. VMD version is 1.9.3 . operating system is windows 10

  5. Xinqiu Yao

    I’ve tested in a similar environment using a simple example but everything looked fine.

    Can you provide a short example DCD/CMS file for us to reproduce the error?

  6. Xinqiu Yao

    Hi,

    I can read your DCD file without any problems:

    > dcd <- read.dcd("mut.dcd")
     NATOM = 29525 
     NFRAME= 1002 
     ISTART= 0 
     last  = 1002 
     nstep = 1002 
     nfile = 1002 
     NSAVE = 1 
     NDEGF = 0 
     version 24 
    |=============================================================| 100% 
    
    > pdb <- read.pdb("Smallmut1.pdb")
    > ca.inds <- atom.select(pdb, "calpha")
    > inds <- atom.select(pdb, elety = "P")
    > casc.local.inds <- combine.select(ca.inds,inds, operator="+")
     Union of selects
     *  Selected a total of: 142 atoms  *
    
    > xyz <- fit.xyz(fixed = pdb$xyz, mobile=dcd, fixed.inds = casc.local.inds$xyz, mobile.inds = casc.local.inds$xyz)
    > xyz
       Total Frames#: 1002
       Total XYZs#:   88575,  (Atoms#:  29525)
    
        [1]  -11.891  7.989  -0.1  <...>  17.932  45.063  7.371  [88752150] 
    
    + attr: Matrix DIM = 1002 x 88575
    
    > sessionInfo()
    R version 3.6.1 (2019-07-05)
    Platform: x86_64-w64-mingw32/x64 (64-bit)
    Running under: Windows 10 x64 (build 18362)
    
    Matrix products: default
    
    locale:
    [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
    [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
    [5] LC_TIME=English_United States.1252    
    
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base     
    
    other attached packages:
    [1] bio3d_2.4-1
    
    loaded via a namespace (and not attached):
    [1] compiler_3.6.1 parallel_3.6.1 tools_3.6.1    Rcpp_1.0.5     grid_3.6.1    
    

    I noticed that your PDB has a different number of atoms from DCD. Make sure you have stripped all water/counter ions and try it again.

  7. Armi Chaudhary

    I am still suprise how u are able to read this file without error. In my case it is showing error. And in simple words how to modify pdb file for this dcd?

  8. Xinqiu Yao

    I suggest remove all previously installed bio3d using remove.packages("bio3d"). You may need to run the command multiple times until it says:

    Error in remove.packages : there is no package called ‘bio3d'

    Some installation paths may need Administrator privilege. Pay attention to the output message.

    Then, reinstall bio3d via install.packages(“bio3d”), and try it again.

    To modify pdb, check out the trim.pdb() function. But in this case, I guess you may want to modify DCD which has the larger number of atoms (and many of them are water I guess). You need to go back to where you generate the DCD and see how you can strip water/counter ions etc.

  9. Armi Chaudhary

    hii

    Thanks for suggestion. i am able to read dcd file but there is error in pdb file reading.

    another problem is this(shown in bold).

    xyz <- fit.xyz(fixed = pdb$xyz, mobile=dcd, fixed.inds = casc.local.inds$xyz, mobile.inds = casc.local.inds$xyz)
    Error: cannot allocate vector of size 7.4 Gb

    library(bio3d)
    dcd <- read.dcd('54fulldcd')
    NATOM = 331517
    NFRAME= 1002
    ISTART= 0
    last = 1002
    nstep = 1002
    nfile = 1002
    NSAVE = 1
    NDEGF = 0
    version 24
    |===============================================================================================================| 100%
    pdb <- read.pdb('pdb54.pdb')
    Error in .read_pdb(file, multi = multi, hex = hex, maxlines = maxlines, :
    basic_string::substr: __pos (which is 60)

  10. Xinqiu Yao

    Can you attach the pdb file for me to take a look?

    The error in bold tells your data is probably too large. As I suggested, try to reduce your trajectory as much as possible (for example, remove atoms that you are not interested in the analysis, possibly including water, counter ions, or even hydrogen, etc., before reading it into R).

  11. Armi Chaudhary

    pdb <- read.pdb("pdb54.pdb")

    Error in .read_pdb(file, multi = multi, hex = hex, maxlines = maxlines, : basic_string::substr: __pos (which is 60) > this->size() (which is 55)

  12. Xinqiu Yao

    Hi,

    We will look into it. For now, you can temporarily use the read.pdb2()function, which might be a bit slower for large PDB files but it can read your file properly.

  13. Log in to comment