Skip to content

Commit

Permalink
Fix missing chainIDs in XYZ files
Browse files Browse the repository at this point in the history
  • Loading branch information
jvsguerra committed Jun 27, 2024
1 parent d2c1462 commit 6bc43b3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions AtomPacker/core/io/xyz/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def load_xyz(filename: str) -> Universe:
# Read XYZ file in MDAnalysis.Universe
universe = Universe(filename)

# if chainIDs not provided, set them to 'X'
if "chainIDs" not in universe.atoms._SETATTR_WHITELIST:
universe.add_TopologyAttr(
"chainIDs", ["X"] * universe.atoms.n_atoms
) # chainIDs

# Add radii to topology
universe.add_TopologyAttr(
"radii",
Expand Down

0 comments on commit 6bc43b3

Please sign in to comment.