Parameters#

Main file for NMRforMD package.

class nmrformd.NMR.NMR(u: Universe, atom_group: AtomGroup, neighbor_group: AtomGroup | None = None, type_analysis: str = 'full', number_i: int = 0, isotropic: bool = True, f0: float | None = None, actual_dt: float | None = None, hydrogen_per_atom: float = 1.0, spin: float = 0.5, pbc: bool = True)#

Bases: object

Calculate NMR relaxation time from MDAnalysis universe.

Parameters#

uMDAnalysis.Universe

MDAnalysis universe containing all the information describing the molecular dynamics system.

atom_groupMDAnalysis.AtomGroup

Target atom groups for NMR calculation.

neighbor_groupMDAnalysis.AtomGroup

Neighbor atom groups. If not specified, atom_group is used.

type_analysisstr, default full

Type of analysis, which can be full, intra_molecular, or inter_molecular.

number_iint, default 0

Number of atom of the target group to consider for the calculation. If number_i = 0, all atoms are considered.

isotropicbool, default True

If isotropic is true, only the spherical harmonic of order 0 is considered, which is usually valid for bulk systems. For non-isotropic systems, use False.

f0int, default None

Frequency at which T1 and T2 are calculated. If None, f = 0 is used.

actual_dtfloat, default None

Can be used to specify a different time interface between frames than the one detected by MDAnalysis.

hydrogen_per_atomfloat, default 1.0

Specify the number of hydrogen per atom, usefull for coarse-grained simulations.

pdbbool, default True

To turn off/on the periodic boundary condition treatment.

calculate_correlation_ij()#

Calculate the correlation function.

calculate_fourier_transform()#

Calculate spectral density J.

Calculate the spectral density J from the Fourier transform of the correlation function.

calculate_relaxationtime()#

Calculate the relaxation time at a given frequency f0 (default is 0)

calculate_spectrum()#

Calculate spectrums R1 and R2 from J.

cartesian_to_spherical()#

Convert cartesian coordinate to spherical.

collect_data()#

Collect data by looping over atoms, time, and evaluate correlation

define_constants()#

Define prefactors.

See this page for details : https://nmrformd.readthedocs.io Gamma is the gyromagnetic constant of 1H in Hz/T or C/kg K has the units of m^6/s^2 alpha_m are normalizing coefficient for harmonic function

evaluate_function_F()#

Evaluate the F functions.

F = alpha Y / r ** 3 Y : spherical harmonic r : spin-spin distance

convention : theta = polar angle, phi = azimuthal angle note: scipy uses the opposite convention

F has the units of Angstrom^(-6)

finalize()#
initialise_data()#

Initialise arrays.

Create an array of zeros for the data and the correlation function. If anisotropic, the spherical harmonic may be complex, so dtype=complex64 is used. Create an array for of values separated by timestep for the time.

initialize()#

Prepare the calculation

loop_over_trajectory()#

Loop of the MDA trajectory and extract rij.

Run over the MDA trajectory. If start, stop, or step are specified, only a sub-part of the trajectory is analyzed.

normalize_Gij()#

Divide Gij by the number of spin pairs.

Optional, for coarse grained model, apply a coefficient “hydrogen_per_atom” != 1

select_atoms_group_i()#

Select atoms of the group i for the calculation.

select_atoms_group_j()#

Select atoms of the group j for the calculation.

For intra molecular analysis, group j are made of atoms of the same residue as group i. For inter molecular analysis, group j are made of atoms of different residues as group i. For full analysis, group j are made of atoms that are not in group i.

select_target_i()#

Select the target atoms i

If number_i=0, select all atoms in target_i If number_i > target_i.atoms.n_atoms, raise message Else, if 0<number_i<target_i.atoms.n_atoms, select atoms randomly

vector_rij()#

Calculate distance between position_i and position_j.

By defaults, periodic boundary conditions are assumed. Pbc can be turned off using pbc = False.

verify_entry()#

Verify that entries are correct, and that groups are not empty.