mdanalysis icon indicating copy to clipboard operation
mdanalysis copied to clipboard

Chain ID not detected in DCD and PDB files created with VMD

Open biomolsim opened this issue 5 months ago • 2 comments

I am analysing a VMD-generated trajectory to calculate inter-residue interactions, and MDAnalysis is unable to recognize the chainID despite it being present in these files.

Somehow, the segid is being detected and can be used for selections. <universe>.segments.chainIDs does not generate the list of chains present, as expected. Is there any way to resolve this issue?

biomolsim avatar Jun 02 '25 03:06 biomolsim

Hi @biomolsim , could you please provide a PDB file that reproduces this error along with your expected results?

yuxuanzhuang avatar Jun 05 '25 16:06 yuxuanzhuang

With standard PDB files, the chains are recognized automatically (with MDA 2.9.0):

In [1]: !curl https://files.rcsb.org/download/4E43.pdb.gz -O
In [2]: u = mda.Universe("./4E43.pdb.gz")
In [3]: u.atoms.chainIDs
Out[3]: array(['A', 'A', 'A', ..., 'B', 'B', 'C'], shape=(1877,), dtype=object)

(and u.segments.chainIDs also works for my example).

We need to see your PDB file (or at least a part with ATOM records) to see what it looks like and how it is formatted.

orbeckst avatar Jun 11 '25 19:06 orbeckst

Without further information there's not much more we can do. Please feel free to re-open the issue.

orbeckst avatar Sep 30 '25 22:09 orbeckst