polymerist.molfiles.pdb ======================= .. py:module:: polymerist.molfiles.pdb .. autoapi-nested-parse:: PDB file atom line formatting tools Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/polymerist/molfiles/pdb/pdbatoms/index Classes ------- .. autoapisummary:: polymerist.molfiles.pdb.SerialAtomLabeller Package Contents ---------------- .. py:class:: SerialAtomLabeller For assigning unique numbered atom names based on their order of appearance within a molecule and elemental class Useful, for example, in generating unique atom names for a PDB file :Parameters: * **atom_label_width** (*int , default 4*) -- Exact length alloted for any generated atom label Labels shorter than this are right-padded with spaces, while labels longer than this are truncated Default of 4 is the chosen to be compatible with the PDB specification ("Atom name: lines 13-16, left-justified") https://www.cgl.ucsf.edu/chimera/docs/UsersGuide/tutorials/pdbintro.html * **include_elem_idx** (*bool, default True*) -- Whether to attach a numerical element-index postfix to atom labels E.g. with atom_label_width=4, the fifth carbon in a topology will be labelled as "C004" with include_elem_idx=True, while labelled as "C " with include_elem_idx=False, * **default_elem_idx** (*int, default 0*) -- Starting index for each element category By default, is 0-indexed; MUST BE POSITIVE .. py:attribute:: atom_label_width :type: int :value: 4 .. py:attribute:: include_elem_idx :type: bool :value: True .. py:attribute:: default_elem_idx :type: int :value: 0 .. py:attribute:: element_counter :type: collections.Counter .. py:method:: get_atom_label(elem_symbol: str) -> str Obtain a numbered atom label for an atom based on its element, updating the underlying element context in the process