-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with reading/writing CONECT records in PDB files with many atoms #988
Comments
I think the problem is that you have so many atoms that the PDB format runs out of atom indices and then the CONECT records become meaningless. If you remove the CONECT records
then it can be read successfully: >>> import MDAnalysis as mda
>>> u = mda.Universe("./Flu_membrane_capsule_noCONECT.pdb")
>>> print(u.atoms.n_atoms)
188513 Now, it seems that you wrote this PDB file with MDAnalysis (is this true?) and it was the MDAnalysis PDB write that put the CONECT records there. I think this indicates a bug in the PDBWriter in that it should not write CONECT records if it generates an illegal PDB file. |
As a workaround, can use other formats in your workflow, such as GRO? |
I think there's 2 things here, the PDBParser should still work, it should just give up on trying to read the CONECT records (with a warning). And it looks like the PDBWriter shouldn't have made an unusable file. |
The way that I create this file is by using packmol and then importing it into MDAnalysis to change it. The error message I received was when I imported it again. But, thank you for the advice. Best, Bartosz From: Oliver Beckstein [notifications@github.com] I think the problem is that you have so many atoms that the PDB format runs out of atom indices and then the CONECT records become meaningless. If you remove the CONECT records wget -O Flu_membrane_capsule.pdb https://github.com/MDAnalysis/mdanalysis/files/474513/Flu_membrane_capsule.txt then it can be read successfully:
Now, it seems that you wrote this PDB file with MDAnalysis (is this true?) and it was the MDAnalysis PDB write that put the CONECT records there. I think this indicates a bug in the PDBWriter in that it should not write CONECT records if it generates an illegal PDB file. |
Expected behaviour
Reading in a pdb file using the standard
MDAnalysis.Universe("file_name.pdb")
Actual behaviour
Fails with the following error message:
Code to reproduce the behaviour
Flu_membrane_capsule.txt
Currently version of MDAnalysis:
0.15.1-dev0
The text was updated successfully, but these errors were encountered: