atomic_number#

biotite.structure.info.atomic_number(atoms: AtomArray[N] | ndarray[tuple[N], dtype[str_]]) → ndarray[tuple[N], dtype[integer]][source]#

Get the atomic number for each atom in the given structure.

Parameters:
atomsAtomArray, shape=(n,) or ndarray, shape=(n,), dtype=str

The atoms to get the atomic numbers for. Alternatively, the elements can be given directly.

Returns:
numbersndarray, shape=(n,), dtype=uint8

The atomic number for each atom. Unknown elements are indicated by 0.

Examples

>>> molecule = residue("URA")
>>> print(molecule.element)
['N' 'C' 'O' 'N' 'C' 'O' 'C' 'C' 'H' 'H' 'H' 'H']
>>> print(atomic_number(molecule))
[7 6 8 7 6 8 6 6 1 1 1 1]