Skip to content

Commit

Permalink
convert residue number instead of residue idx when going to and from …
Browse files Browse the repository at this point in the history
…parmed
  • Loading branch information
daico007 committed Oct 27, 2023
1 parent 40fe652 commit 15a0065
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gmso/external/convert_parmed.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ def from_parmed(structure, refer_type=True):
charge=atom.charge * u.elementary_charge,
position=[atom.xx, atom.xy, atom.xz] * u.angstrom,
atom_type=None,
residue=(residue.name, residue.idx + 1),
residue=(residue.name, residue.number),
element=element,
)
site.molecule = (residue.name, residue.idx + 1) if ind_res else None
site.molecule = (residue.name, residue.number) if ind_res else None
site.atom_type = (
copy.deepcopy(pmd_top_atomtypes[atom.atom_type])
if refer_type and isinstance(atom.atom_type, pmd.AtomType)
Expand Down Expand Up @@ -474,7 +474,7 @@ def to_parmed(top, refer_type=True):
structure.add_atom(
pmd_atom,
resname=site.residue.name,
resnum=site.residue.number - 1,
resnum=site.residue.number,
)
else:
structure.add_atom(pmd_atom, resname="RES", resnum=-1)
Expand Down

0 comments on commit 15a0065

Please sign in to comment.