Problem reading multiframe PDB with read.pdb()

Issue #542 open
Michal created an issue

Hi,

I have a problem loading multiframe/model PDB file prepared in VMD from MD trajectory in an updated version of Bio3D - 2.3-3. My concern is that everything was working fine in version 2.2-3 and it would be very helpful for me to have it working again.

The problem is that even though the structure is loaded with multi=TRUE, it is not correctly split into models / frames. Instead, it is taken as a one huge molecule I assume. There is a warning message when files is loaded.

pdb <- read.pdb("TestPDB.pdb", multi=TRUE)
Warning message:
In read.pdb("TestPDB.pdb ",  :
  duplicated element numbers ('eleno') detected

Accessing the pdb object after loading gives:

Call:  read.pdb(file = "TestPDB.pdb",   multi = TRUE)

   Total Models#: 1
     Total Atoms#: 259600,  XYZs#: 778800  Chains#: 1  (values: X)

     Protein Atoms#: 224000  (residues/Calpha atoms#: 12800)
     Nucleic acid Atoms#: 0  (residues/phosphate atoms#: 0)

....

Frames / models are split only with “END” lines in a PDB file, perhaps that is the reason.

Thank you in advance, Michal

Comments (13)

  1. Lars Skjærven

    Old version of read.pdb() can be found in function read.pdb2(). This should parse your multimodel file correctly. I've located the bug and will commit a bugifx in a few days.

  2. Michal reporter

    Hi Lars,

    Thank you for your support.

    I have overlooked the information about read.pdb2(). Now it works flawlessly.

    Kindest Regards,

    Michal

  3. Xinqiu Yao

    Thanks for uploading, Lars. I've tested and it worked nicely. May we merge it now or you want wait to have more tests?

  4. Lars Skjærven

    Sure. I just wanted you guys to test it out before merging. Lets keep the branch open and I will explore alternatives for producing a better error message. E.g. by storing a vector of atoms for each model, and report back the discrepancy in number of atoms.

  5. Xinqiu Yao

    Bug has been fixed.

    Error message to be updated: Lets keep the branch open and I will explore alternatives for producing a better error message. E.g. by storing a vector of atoms for each model, and report back the discrepancy in number of atoms.

  6. Log in to comment