Problem reading multiframe PDB with read.pdb()
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)
-
-
reporter Hi Lars,
Thank you for your support.
I have overlooked the information about read.pdb2(). Now it works flawlessly.
Kindest Regards,
Michal
-
reporter - changed status to resolved
-
-
assigned issue to
-
assigned issue to
-
- changed status to open
keep open to explore if this is a bug
-
- changed component to ToDo
-
See also issue
#550related to the new read.pdb() vs the old read.pdb2() function. -
Any update of this issue, Lars?
-
finally... see commit 1cd36a1
-
Thanks for uploading, Lars. I've tested and it worked nicely. May we merge it now or you want wait to have more tests?
-
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.
-
Sounds great!
-
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.
- Log in to comment
Old version of
read.pdb()
can be found in functionread.pdb2()
. This should parse your multimodel file correctly. I've located the bug and will commit a bugifx in a few days.