add-elem-info (repair PDB element columns)¶
add-elem-info fills in or corrects the element symbols (columns 77–78) of the ATOM and HETATM records in a PDB file.
What it is for¶
PDB files without element columns: structures from modeling tools or molecular dynamics (MD) that leave columns 77–78 blank.
Wrong element symbols: re-infer every column with
--overwrite-elem.Preparing input for other commands: run
add-elem-infobefore a standalone command such asextract.
Examples¶
1. Write <input>_add_elem.pdb¶
Fill the element columns and write the result next to the input.
pdb2reaction add-elem-info -i 1abc.pdb
The console prints [OK] Wrote: 1abc_add_elem.pdb and the counts total atoms, assigned/updated, and kept existing. With no [WARN] line, every atom has an element.
2. Choose the output file¶
pdb2reaction add-elem-info -i 1abc.pdb -o 1abc_fixed.pdb
3. Overwrite the input¶
Replace the input file itself.
pdb2reaction add-elem-info -i 1abc.pdb --overwrite
How it works¶
Reading the records:
add-elem-inforeads every line, follows MODEL blocks, and looks only at ATOM and HETATM records.Keeping valid symbols: An element field that already holds a valid symbol (or
EPfor a water virtual site) is kept. Blank or unrecognized fields are repaired;--overwrite-elemre-infers every field.Inferring the element: The element comes from the four-character atom name (columns 13–16) and the residue name. Ion residues give the element of the ion; amino acids, nucleic acids, and water follow the usual naming. Other ligands use the column where the atom name starts:
NAfrom column 14 is N, and from column 13 is Na. This also covers LEaP halogens such asCL1from column 14 and hydrogen names such asHG11.Writing and the summary: Only columns 77–78 of the repaired records change, and the console prints a summary.
Output files¶
The repaired PDB:
<input>_add_elem.pdbby default, the path given with-o, or the input file itself with--overwriteand no-o.Console summary:
total atoms,assigned/updated(atoms whose element column changed),kept existing, andassignment breakdown(counts per element). Atoms that could not be assigned are left unchanged and listed after[WARN] Could not confidently assign N atoms; left unchanged., up to 50 of them. Type the element symbol of each listed atom into columns 77–78 by hand, right-aligned;--overwrite-elemuses the same rules and will not assign them.
Main options¶
Option |
Type |
Default |
Description |
|---|---|---|---|
|
path |
(required) |
Input PDB file |
|
path |
|
Output PDB file; without it, |
|
flag |
|
Overwrite the input file when |
|
flag |
|
Re-infer element columns that already hold a valid symbol |
See the generated CLI reference for every option.
Notes¶
What changes: only columns 77–78 of the ATOM and HETATM records being repaired. Every other line, including HEADER, REMARK, CONECT, ANISOU, and the charge columns (79–80), is written unchanged.
Special names: deuterium labels become H, selenium (
SE*) is recognized as Se, and halogens are recognized automatically.Two different flags:
--overwrite-elemdecides which element columns are re-inferred;--overwritedecides only where the file is written.Writing to the input path: when
-onames the input file, including through a symbolic link,--overwriteis required; without it the run stops with an error.Exit codes: see Exit codes.
See also¶
extract — extract the active-site model from the repaired PDB
all — the full workflow, which repairs blank element fields on its own
Troubleshooting — what to do when a run fails