T1T2ne_TRACT module
- class t1t2ne.scripts.t1t2ne_tract.TractCmd[source]
Bases:
BaseCommand- DESCRIPTION: str = 'This module contains the functions to analyze a TRACT experiment and extract the average tau_c of the system using the algebraic analysis described in Robson et al. (2021), doi:10.1007/s10858-021-00379-5.\nThe analysis can be performed using integrals of the spectra or point-by-point fitting, and the spectra can be phased and smoothed if needed. In the standard operation mode, the tau_c is calculated.In the IDP mode, the Lipari-Szabo order parameter S2 for the intermediate motion is calculated.The IDP mode requires input of the molecular weight of the protein to estimate the correlation time of the slow motion, and it assumes a correlation time of 1.6 ns for the intermediate motion and an order parameter of 0.15 for the slow motion, which are typical values for IDPs but might not be accurate for all systems.'
- SHORT_HELP: str = 'Fit a TRACT experiment to extract the average tau_c of the system'
- t1t2ne.scripts.t1t2ne_tract.filter_data(y, window_length=5, polyorder=3)[source]
Apply a Savitzky-Golay filter to the data y with the specified window length and polynomial order. If the data is shorter than the window length, return it unfiltered.
- Parameters:
y (array_like) – The data to filter.
window_length (int, optional) – The length of the filter window (i.e., the number of coefficients). Default is 5.
polyorder (int, optional) – The order of the polynomial used to fit the samples. Default is 3.
- Returns:
The filtered data.
- Return type:
array_like
- t1t2ne.scripts.t1t2ne_tract.get_stdev_rate(y, window_length=5)[source]
Calculate the standard deviation of the data y in a moving window of specified length.
- Parameters:
y (array_like) – The data to calculate the standard deviation for.
window_length (int, optional) – The length of the moving window as a percentage of the total data length. Default is 5.
- Returns:
The standard deviation of the data in the moving window.
- Return type:
array_like
- t1t2ne.scripts.t1t2ne_tract.make_plot(CO, xaxis, y_rec, yerr_rec, y_ave, yerr_ave, Ra, Rb, sigma_Ra, sigma_Rb, values, name='tau_c', idx=0)[source]
Make a plot of the reconstructed tau_c or S2 values as a function of the chemical shift, with error bars and the average value with its error. The plot also includes the expected relaxation rates based on the input parameters, and a reference spectrum of the Sb dataset.
- Parameters:
CO (Conf_Optns object) – The configuration options object.
xaxis (array_like) – The x-axis values (chemical shift).
y_rec (array_like) – The reconstructed tau_c or S2 values.
yerr_rec (array_like) – The errors of the reconstructed tau_c or S2 values.
y_ave (float) – The average tau_c or S2 value.
yerr_ave (float) – The error of the average tau_c or S2 value.
values (dict) – A dictionary containing the expected relaxation rates and other parameters.
name (str, optional) – The name of the parameter being plotted (‘tau_c’ or ‘S^2’). Default is ‘tau_c’.
- Return type:
None
- t1t2ne.scripts.t1t2ne_tract.s2(w_N, c, tau_slow, S2_slow=0.15, tau_int=1.6e-09)[source]
This function is applicable for IDPs. The model is based on significant assumptions, and we do not endorse the use of this model for extracting quantitative information. The obtained values are only meant to be used to bring the expected relaxation rates in a reasonable ballpark. Calculate the Lipari-Szabo order parameter \(S^2\) for the intermediate motion based on the work of Razaei-Ghaleh et al. (2018), doi:10.1002/anie.201808172.
The slow motion is assumed to correspond to the tumbling of a protein of the same size of the one under study, and the order parameter of the slow motion is assumed to be 0.15. The intermediate motion is assumed to have a correlation time of a peptide of 20 residues (1.6 ns).
\[S^2 = \frac{|\eta_{xy}/(d*c*B_0*P_2(\cos(\theta)))| - 4(S^2_{slow} J(0, \tau_{slow}) + (1-S^2_{slow}) J(0, \tau_{fast})) - 3(S^2_{slow} J(\omega_N, \tau_{slow}) + (1-S^2_{slow}) J(\omega_N, \tau_{fast}))}{4(1-S^2_{slow})(J(0, \tau_{int}) - J(0, \tau_{fast})) + 3(1-S^2_{slow})(J(\omega_N, \tau_{int}) - J(\omega_N, \tau_{fast}))}\]- Parameters:
w_N (float) – The Larmor frequency of the nucleus of interest (in radians per second).
c (float) – half of the difference of Ra and Rb, to which \(\eta_{xy}/(d*c*B_0*P_2(\cos(\theta)))\) should be equal
tau_slow (float) – The correlation time of the slow motion (in seconds).
S2_slow (float, optional) – The order parameter of the slow motion. Default is 0.15.
tau_int (float, optional) – The correlation time of the intermediate motion (in seconds). Default is 1.6e-9.
- Returns:
The Lipari-Szabo order parameter \(S^2\) for the intermediate motion.
- Return type:
float
- t1t2ne.scripts.t1t2ne_tract.tc(w_N, c, O)[source]
Calculate the optimal \(\tau_c\) based on the equation 15 from Robson et al. (2021), doi:10.1007/s10858-021-00379-5.
- Parameters:
w_N (float) – The Larmor frequency of the nucleus of interest (in radians per second).
c (float) – half of the difference of Ra and Rb, to which \(\eta_{xy}/(d*c*B_0*P_2(\cos(\theta)))\) should be equal
O (float) – Lipari-Szabo order parameter \(S^2\).
- Returns:
The closed form solution for \(\tau_c\) (in seconds).
- Return type:
float
- t1t2ne.scripts.t1t2ne_tract.tract_compute_s2(B0, Ra, Rb, sigma_Ra, sigma_Rb, tau_slow, S2_slow=0.15, tau_int=1.6e-09, r=1.02e-10, Deltasigma=-160, theta=0.29670597283903605, nuc1='1H', nuc2='15N')[source]
Compute the Lipari-Szabo order parameter \(S^2\) for the intermediate motion based on the work of Razaei-Ghaleh et al. (2018), doi:10.1002/anie.201808172.
The slow motion is assumed to correspond to the tumbling of a protein of the same size of the one under study, and the order parameter of the slow motion is assumed to be 0.15. The intermediate motion is assumed to have a correlation time of a peptide of 20 residues (1.6 ns).
- Parameters:
w_N (float) – The Larmor frequency of the nucleus of interest (in radians per second).
Ra (array_like) – The relaxation rates of the ANTITROSY component of the TRACT experiment.
Rb (array_like) – The relaxation rates of the TROSY component of the TRACT experiment.
sigma_Ra (array_like) – The standard deviations of the relaxation rates of the ANTITROSY component.
sigma_Rb (array_like) – The standard deviations of the relaxation rates of the TROSY component.
tau_slow (float) – The correlation time of the slow motion (in seconds) estimated from MW.
S2 (list of a single float, optional) – The order parameter of the slow motion. Default is 0.15.
tau_int (float, optional) – The correlation time of the intermediate motion (in seconds). Default is 1.6e-9.
r (float, optional) – The length of the 1H-15N bond in meters. Default is 1.02e-10 m.
Deltasigma (float, optional) – The chemical shift anisotropy of the 15N nucleus. Default is -160 ppm.
theta (float, optional) – The angle between the 1H-15N bond and the principal axis of the CSA tensor in radians. Default is 17 degrees converted to radians.
nuc1 (str, optional) – The name of the first nucleus involved in the dipolar interaction (default is ‘1H’).
nuc2 (str, optional) – The name of the second nucleus involved in the dipolar interaction (default is ‘15N’).
- Returns:
The array of the Lipari-Szabo order parameter \(S^2\) for the intermediate motion and its uncertainty, the average \(S^2\) and its uncertainty.
- Return type:
tuple
- t1t2ne.scripts.t1t2ne_tract.tract_compute_tau(B0, Ra, Rb, sigma_Ra, sigma_Rb, S2=0.9, r=1.02e-10, Deltasigma=-160, theta=0.29670597283903605, nuc1='1H', nuc2='15N')[source]
Compute the tau_c values from the relaxation rates Ra and Rb obtained from the TRACT experiment using the algebraic analysis described in Robson et al. (2021), doi:10.1007/s10858-021-00379-5.
- Parameters:
w_N (float) – The Larmor frequency of the nucleus of interest (in radians per second).
Ra (array_like) – The relaxation rates of the ANTITROSY component of the TRACT experiment.
Rb (array_like) – The relaxation rates of the TROSY component of the TRACT experiment.
sigma_Ra (array_like) – The standard deviations of the relaxation rates of the ANTITROSY component.
sigma_Rb (array_like) – The standard deviations of the relaxation rates of the TROSY component.
r (float, optional) – The length of the 1H-15N bond in meters. Default is 1.02e-10 m.
Deltasigma (float, optional) – The chemical shift anisotropy of the 15N nucleus. Default is -160 ppm.
theta (float, optional) – The angle between the 1H-15N bond and the principal axis of the CSA tensor in radians. Default is 17 degrees converted to radians.
nuc1 (str, optional) – The name of the first nucleus involved in the dipolar interaction (default is ‘1H’).
nuc2 (str, optional) – The name of the second nucleus involved in the dipolar interaction (default is ‘15N’).
- Returns:
A tuple containing the array of tau_c values for each point in the spectrum and the corresponding uncertainties, the average tau_c and its uncertainty.
- Return type:
tuple
- t1t2ne.scripts.t1t2ne_tract.tract_fit_Ra_Rb(CO)[source]
Fit the TRACT experiment to extract the relaxation rates \(R_a\) and \(R_b\) of the two components of the TRACT experiment using the algebraic analysis described in Robson et al. (2021), doi:10.1007/s10858-021-00379-5.
The monoexponential fit is performed using
fit_exponential()from TRAGICO code.- Parameters:
CO (Conf_Optns object) –
The configuration object containing the necessary information to load the data and perform the analysis. CO must contain the following options:
integrate : bool Whether to perform the analysis using integrals of the spectra instead of point-by-point fitting. Default is False.
selectregion : bool Whether to select a region of the spectrum for the analysis instead of using a default range. Default is False.
phase : bool Whether to phase the spectra. Default is False.
basedir : str The base directory where the data is stored.
tract : str The name of the TRACT experiment to analyze.
CO must also contain the following attributes:
r : float The length of the 1H-15N bond in meters. Default is 1.02e-10 m.
Deltasigma : float The chemical shift anisotropy of the 15N nucleus. Default is -160 ppm.
theta : float The angle between the 1H-15N bond and the principal axis of the CSA tensor in radians. Default is 17 degrees converted to radians.
nucs : list of str The list of nuclei to use for the calculation of the relaxation rates. Default is [‘1H’, ‘15N’].
- Returns:
A tuple containing the x axis for plotting, the arrays of \(R_a\) and \(R_b\) values for each point in the spectrum, and the corresponding uncertainties.
- Return type:
tuple