Error in flucts[i, ] <- all.modes[[i]]$fluctuations :

Issue #506 resolved
Yazhini arangas created an issue

I am doing all-atom nma for comparing 2 structures using following commands:

library(bio3d)
a <-  pdbaln(c("4b50_Repair.pdb","4x7c_Repair_D.pdb")
b <- read.all(a)
m <- aanma(b)
m$rmsip`

But I am getting an error like this: Error in flucts[i, ] <- all.modes[[i]]$fluctuations : I understand that it is related to vector length and might be issue with pdb file. I have checked pdb files and no insertion code or any other issues that I aware of. Could you please suggest me what would be the issue and how to resolve it?

Comments (8)

  1. Xinqiu Yao

    Hi,

    There are some "insertion" residues in 4b50_Repair.pdb that might cause the problem. Please renumber the file using e.g. clean.pdb() and try it again:

    pdb <- read.pdb('4b50_Repair.pdb')
    pdb <- clean.pdb(pdb)
    write.pdb(pdb, file='4b50_Repair.pdb')
    
    a <-  pdbaln(c("4b50_Repair.pdb","4x7c_Repair_D.pdb"))
    b <- read.all(a)
    m <- aanma(b)
    m
    Call:
      aanma.pdbs(pdbs = b)
    
    Class:
      enma
    
    Number of structures:
      2
    
    Attributes stored:
      - Root mean square inner product (RMSIP)
      - Aligned atomic fluctuations
      - Aligned eigenvectors (gaps removed)
      - Dimensions of x$U.subspace: 360x354x2
    
    Coordinates were aligned prior to NMA calculations
    
    + attr: fluctuations, rmsip, U.subspace, L, full.nma, xyz,
            call
    
    m$rmsip`
    
                      4b50_Repair.pdb 4x7c_Repair_D.pdb
    4b50_Repair.pdb            1.0000            0.7931
    4x7c_Repair_D.pdb          0.7931            1.0000
    

    Anyway, the function should work even if insertions exist. We will find out and fix it. Thanks for reporting.

  2. Xinqiu Yao

    I found this bug is deeper into the 'pdbs' format (either created by read.fasta.pdb() or read.all()), in which we don't have a record for "insert" codes. Recommend update relevant functions to have it (It shouldn't affect so much the compatibility but will have an extensive test after the changes).

    What do others think?

  3. Xinqiu Yao

    The bug has been fixed by this commit.

    This patch only applies to 'read.all()', which is directly related to the bug. In future, we may update the general format of 'pdbs' to contain 'insert' record, if necessary.

  4. Log in to comment