Skip to content

Physical constants¤

cryojax.constants stores and supports physical constants used when simulating cryo-EM images.

Scattering factor parameters¤

Modeling the electron scattering amplitudes of individual atoms is an important component of modeling cryo-EM images, as these are typically used to approximate the electrostatic potential. Typically, the scattering factor for each individual atom is numerically approximated with a fixed functional form but varying parameters for different atoms. These parameters are stored in lookup tables in the literature. This documentation provides these lookup tables and utilities for extracting them so that they may be used to compute electrostatic potentials in cryoJAX.

cryojax.constants.PengScatteringFactorParameters ¤

Loads electron scattering factor parameters from "Robust Parameterization of Elastic and Absorptive Electron Atomic Scattering Factors" by Peng et al. (1996).

__init__ ¤
__init__(atomic_numbers: Int[ndarray, 'n_atoms'])

Arguments:

  • atomic_numbers: An array of atomic numbers.

cryojax.constants.LobatoScatteringFactorParameters ¤

Loads electron scattering factor parameters from "An accurate parameterization for scattering factors, electron densities and electrostatic potentials for neutral atoms that obey all physical constraints" by Lobato et al. (2014).

__init__ ¤
__init__(atomic_numbers: Int[ndarray, 'n_atoms'])

Arguments:

  • atomic_numbers: An array of atomic numbers.

Warning

Only electron scattering factors for elements found in PDB files (e.g. proteins, DNA/RNA, small molecules) are supported when instantiating cryojax.constants.PengScatteringFactorParameters or cryojax.constants.LobatoScatteringFactorParameters. These are the following atomic_numbers:

- 1: Hydrogen
- 6: Carbon
- 7: Nitrogen
- 8: Oxygen
- 9: Fluorine
- 11: Sodium
- 12: Magnesium
- 15: Phosphorus
- 16: Sulfur
- 17: Chlorine
- 19: Potassium
- 20: Calcium
- 25: Manganese
- 26: Iron
- 27: Colbalt
- 29: Copper
- 30: Zinc

If atomic_numbers contains values not in this list, scattering factor parameters returned yield numpy.nan values or an index out of bounds error. To check if atomic_numbers is a valid array, use cryojax.constants.check_atomic_numbers_supported.


cryojax.constants.check_atomic_numbers_supported ¤

check_atomic_numbers_supported(atomic_numbers: Int[ndarray, '_'])

Throw an error if atomic_numbers contains values not supported by cryoJAX electron scattering factor tabulations.

Physical units¤

Here, convenience methods for working with physical units are described.

cryojax.constants.wavelength_from_kilovolts ¤

wavelength_from_kilovolts(voltage_in_kilovolts: cryojax.jax_util.FloatLike) -> Float[Array, '']

Get the relativistic electron wavelength at a given accelerating voltage. For reference, see Equation 2.5 in Section 2.1 from Spence, John CH. High-resolution electron microscopy. OUP Oxford, 2013..

Arguments:

  • voltage_in_kilovolts: The accelerating voltage given in kilovolts.

Returns:

The relativistically corrected electron wavelength in Angstroms corresponding to the energy energy_in_keV.


cryojax.constants.lorentz_factor_from_kilovolts ¤

lorentz_factor_from_kilovolts(voltage_in_kilovolts: cryojax.jax_util.FloatLike) -> Float[Array, '']

Get the Lorentz factor given an accelerating voltage.

Arguments:

  • voltage_in_kilovolts: The accelerating voltage given in kilovolts.

Returns:

The Lorentz factor.


cryojax.constants.interaction_constant_from_kilovolts ¤

interaction_constant_from_kilovolts(voltage_in_kilovolts: cryojax.jax_util.FloatLike) -> Float[Array, '']

Get the electron interaction constant given an accelerating voltage.

The interaction constant is necessary to compute the object phase shift distribution from an electrostatic potential integrated on the plane.

Info

In the projection approximation in cryo-EM, the phase shifts in the exit plane are given by

\[\eta(x, y) = \sigma_e \int dz \ V(x, y, z),\]

where \(\sigma_e\) is typically referred to as the interaction constant. However, in cryojax, the potential is rescaled to units of inverse length squared as

\[U(x, y, z) = \frac{m_0 e}{2 \pi \hbar^2} V(x, y, z).\]

With this rescaling of the potential, the defined as with the equation

\[\eta(x, y) = \sigma_e \int dz \ U(x, y, z)\]

with

\[\sigma_e = \lambda \gamma,\]

where \(\lambda\) the relativistic electron wavelength \(\gamma\) is the lorentz factor.

References:

  • For the definition of the rescaled potential, see Chapter 69, Page 2003, Equation 69.6 from Hawkes, Peter W., and Erwin Kasper. Principles of Electron Optics, Volume 4: Advanced Wave Optics. Academic Press, 2022.
  • For the definition of the phase shifts in terms of the rescaled potential, see Chapter 69, Page 2012, Equation 69.34b from Hawkes, Peter W., and Erwin Kasper. Principles of Electron Optics, Volume 4: Advanced Wave Optics. Academic Press, 2022.

See the documentation on atom-based scattering potentials for more information.

Arguments:

  • voltage_in_kilovolts: The accelerating voltage given in kilovolts.

Returns:

The electron interaction constant.

Converting between common conventions¤

Here, helper functions for converting between common conventions are described.

cryojax.constants.b_factor_to_variance ¤

b_factor_to_variance(b_factor: Float[Array, '...'] | Float[ndarray, '...'] | float) -> Float[Array, '...']

From the B-factor of a gaussian, return the corresponding value of the variance of the gaussian. This simply does the conversion

\[\sigma^2 = B / (8 \pi^2)\]

The purpose of this function is to make it easy to convert between conventions when defining gaussians.

Arguments:

  • b_factor: The B-factor of the gaussian.

Returns:

The variance.


cryojax.constants.variance_to_b_factor ¤

variance_to_b_factor(variance: Float[Array, '...'] | Float[ndarray, '...'] | float) -> Float[Array, '...']

From the variance of a gaussian, return the corresponding value of the B-factor of the gaussian. This simply does the conversion

\[B = 8 \pi^2 * \sigma^2\]

The purpose of this function is to make it easy to convert between conventions when defining gaussians.

Arguments:

  • variance: The variance of the gaussian.

Returns:

The B-factor.