parmed.periodic_table module

Contains all of the elements in the periodic table and dictionaries that store all of the data found in the periodic table for that element, indexed by the element’s symbol. For consistency with AMBER, a fictitious element ‘EP’ is added to all of the arrays that is just an Extra Point, with no mass or any other meaningful attribute. It’s just a container to put an extra charge

parmed.periodic_table.element_by_mass(mass)[source]

Determine the element that has a mass closest to the input mass

Parameters
massfloat

The atomic mass to compare to

Returns
element: str

The returned string is the name of the element whose atomic mass is closest to the input mass

Notes

This actually fails (i.e., produces poor predictions) for some cases when masses have changed – particularly in the case of Hydrogen mass repartitioning.

parmed.periodic_table.element_by_name(name)[source]

Determine the element based on the name of an atom. This is very naive. It first tries to match the first letter of the element. If that doesn’t work, it tries to match the first two letters. If that still doesn’t work, it defaults to an extra point

Parameters
namestr

Name of the atom to determine an element for

Returns
elementstr

The name of the best-matching element

Notes

This should be a last-case scenario for guessing element information. For instance, Ca will never be matched, since calcium atoms will be tagged as carbon before the second letter is tried. This is usually OK for biomolecules, but you are better off using the mass or, even better, an appropriate representation of the atomic number to begin with