masses#

biotite.structure.info.masses(elements: ndarray[tuple[N], dtype[str_]] | AtomArray[N] | AtomArrayStack[Any, N]) → ndarray[tuple[N], dtype[floating]][source]#

Get the mass of each chemical element in the given array. [1]

Parameters:
elementsndarray, shape=(n,), dtype=str or AtomArray, shape=(n,) or AtomArrayStack, shape=(m,n)

The chemical elements to get the masses for. If an AtomArray or AtomArrayStack is given, its element annotation is used.

Returns:
massesndarray, shape=(n,), dtype=float

The mass of each element in u.

Raises:
KeyError

If the mass is unknown for some element.

See also

mass

Get the total mass of a single element, residue or molecule.

References

Examples

>>> print(masses(atom_array[:5]))
[14.007 12.011 12.011 15.999 12.011]