Skip to content

[BUG] Residues in a topology and coordinates saved in a different order to input structure #423

@jasmin-guven

Description

@jasmin-guven

Describe the bug
Hi! I'm trying to setup an MD system with custom residues and parameters. When I use BioSimSpace to setup the MD directory for a minimisation, some of the residues in the prm7 and pdb files produced are in a different order to the input.

To Reproduce
Steps to reproduce the behavior:

  1. Load the files vim2_ligand_11_solv.prmtop and vim2_ligand_11_solv.inpcrd
  2. Run the code:
import BioSimSpace as bss
import MDAnalysis as mda

system = bss.IO.readMolecules(
    [
        "vim2_ligand_11_solv.prmtop",
        "vim2_ligand_11.solv.inpcrd"
    ]
)

bss.IO.saveMolecules("test_bss.pdb", system, fileformat="PDB")

I tested with MDAnalysis like this:

universe = mda.Universe(
    "vim2_ligand_11_solv.prmtop",
    "vim2_ligand_11_solv.inpcrd",
    topology_format="PARM7"
)
universe.atoms.write("test_mda.pdb")
  1. This is what goes wrong:
    The MH1 residue (reparameterised hydroxide) has a residue number 236, but is placed in between zinc 234 and the ligand ML1 with residue number 235. This causes issues down the line where I use Amber restraints (based on atom indexing) on the prm7 and rst7 generated by BioSimSpace in bss.Process.Amber

Expected behavior
Residues are not reordered from inputs.

Input files
bug.zip

(please complete the following information):

  • OS: MacOS (Tahoe 26.3.1)
  • Version of Python: 3.12.13
  • Version of BioSimSpace: 2025.4.0
  • I confirm that I have checked this bug still exists in the latest released version of BioSimSpace: [no]

I'm hoping I'm not missing anything obvious, thanks in advance!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions