Skip to content
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

PDBWriter uses first character of segid as chainID instead of the last as written in the documentation #2224

Closed
capslockwizard opened this issue Mar 20, 2019 · 0 comments · Fixed by #2478

Comments

@capslockwizard
Copy link

Expected behavior
When writing out a PDB file with MDAnalysis, the chains IDs in the PDB file are taken from the last character of the segid as documented here.

Actual behavior
Instead, the first character from segid is used as the chain ID in PDB files. From the source:

vals['chainID'] = segids[i][:1]

Code to reproduce the behavior

import MDAnalysis as mda
from MDAnalysis.tests.datafiles import PSF, DCD,  GRO, PDB, TPR, XTC, TRR,  PRMncdf, NCDF

u = mda.Universe(PSF, DCD)
u.write('test.pdb')

Current version of MDAnalysis

  • Which version are you using? 0.19.2
  • Which version of Python (python -V)? 2.7.15
  • Which operating system? Ubuntu 16.04
CCook96 added a commit to CCook96/mdanalysis that referenced this issue Jan 27, 2020
orbeckst pushed a commit that referenced this issue Jan 30, 2020
* fix #2224
* PDBWriter ChainID now from last character of segid
* Added docstrings, streamlined test code and updated CHANGELOG and AUTHORS
* Update AUTHORS
* Update CHANGELOG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants