add-elem-info¶
mlmm add-elem-info adds or repairs PDB element symbols (columns 77-78). It infers elements from fixed-column atom names and residue context, and replaces only the element field on ATOM/HETATM records. Use it before downstream tools when element columns are missing or unreliable; --overwrite also replaces existing element fields.
Examples¶
Command form:
mlmm add-elem-info -i INPUT [-o OUTPUT] [--inplace] [--overwrite]
Add or repair element columns into the non-destructive default output:
mlmm add-elem-info -i 1abc.pdb
This writes 1abc_add_elem.pdb. To replace the input explicitly:
mlmm add-elem-info -i 1abc.pdb --inplace
Write the result to a separate output file:
mlmm add-elem-info -i 1abc.pdb -o 1abc_fixed.pdb
Re-infer and overwrite existing element fields:
mlmm add-elem-info -i 1abc.pdb --overwrite
Workflow¶
Read raw PDB records and classify atoms with the residue definitions used in
extract.py(AMINO_ACIDS,WATER_RES,ION).For each atom, guess the element by combining the atom name, residue name, and whether the record is HETATM:
Ion residues: Prefers residue-derived elements; polyatomic ions (e.g., NH4, H3O+) are assigned per atom (H/N/O).
Proteins, nucleic acids, water: Maps H/D to H; water atoms to O/H; first-letter mapping for P/N/O/S; recognizes Se; carbon labels (CA/CB/CG/…) to C.
Ligands/cofactors: Uses atom-name prefixes (C*/P*, excluding CL) and two-letter/one-letter normalization; recognizes halogens (Cl/Br/I/F).
Replace only columns 77–78 on ATOM/HETATM records and preserve all other columns and records:
No
-o/--outgiven: writes<input>_add_elem.pdb.--inplacewithout-o/--out: replaces the input file.-o/--outgiven: writes to the specified path.
Print a summary reporting total atoms, newly assigned, kept existing, overwritten (when
--overwrite), per-element counts, and up to 50 unresolved atoms (model/chain/residue/atom/serial).
Outputs¶
PDB file with element columns (77-78) populated or corrected
Console report with totals for processed/assigned atoms, per-element counts, and up to 50 unresolved atoms
CLI options¶
Option |
Description |
Default |
|---|---|---|
|
Input PDB file. |
Required |
|
Output PDB path; takes precedence over |
None → |
|
Replace the input file when |
|
|
Re-infer and overwrite element fields even if already present (by default, existing values are preserved). |
|
Every input line is preserved byte-for-byte except columns 77–78 of ATOM/HETATM records selected for repair. HEADER, REMARK, CONECT, ANISOU, and legacy charge columns are retained.
The full flag list is in the generated command reference.
See Also¶
Common Error Recipes — Symptom-first failure routing
Troubleshooting — Detailed troubleshooting guide
mm-parm — Build AMBER topology (requires correct element columns)
extract — Extract active-site pocket from protein-ligand complex