Skip to content

Add command to fix duplicate atom names - #1202

Merged
drroe merged 20 commits into
Amber-MD:masterfrom
drroe:fix.duplicate.anames
Oct 22, 2026
Merged

drroe merged 20 commits into
Amber-MD:masterfrom
drroe:fix.duplicate.anames

Conversation

@drroe

@drroe drroe commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

V7.13.0. Add the fixatomnames command.

> help fixatomnames 
  [help fixatomnames]
        { parm <name> | parmindex <#> | crdset <COORDS SET>} [<mask>]
  Attempt to fix duplicated atom names in residues of the specified topology.
WARNING: THIS COMMAND IS STILL EXPERIMENTAL. USE AT YOUR OWN RISK.

This command attempts to fix duplicated atom names in the residues of the specified topology. If no mask is given, all residues will be checked. The algorithm used is extremely simple. When an atom is found with a duplicated name, if it has a digit that digit will be incremented. If multiple digits are present (e.g. H1N1) the right-most digit will be incremented first. If no digits are present one will be appended.

This command was used to fix duplicate atom names in modxna fragments. See: modxna/modxna#20

This PR also makes it so that the molecule and charge type fields of incoming mol2 files are preserved for output mol2 files.

Add 1 test and add a manual entry.

@drroe drroe self-assigned this Oct 22, 2026
@drroe drroe added the New Command New command for cpptraj label Oct 22, 2026
@drroe
drroe merged commit b167747 into Amber-MD:master Oct 22, 2026
12 checks passed
@drroe
drroe deleted the fix.duplicate.anames branch October 22, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Command New command for cpptraj

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant