# Python module imports.
from os import sep
# relax module imports.
from auto_analyses.relax_disp import Relax_disp
# Analysis variables.
#####################
# The dispersion models.
MODELS = ['NS 2-site expanded']
# The grid search size (the number of increments per dimension).
GRID_INC = 21
# The number of Monte Carlo simulations to be used for error analysis at the end of the analysis.
MC_NUM = 10
# The model selection technique to use.
MODSEL = 'AIC'
# Experiment settings
#set_dir = "spectrometer_data_processed"
set_dir = None
pre_run = 'final'
# Cluster file
cluster_file = "cluster_residues.txt"
# Set up the data pipe.
#######################
# Create the data pipe.
pipe_name = 'base pipe'
pipe_bundle = 'relax_disp'
pipe.create(pipe_name=pipe_name, bundle=pipe_bundle, pipe_type='relax_disp')
# Set the relaxation dispersion experiment type.
relax_disp.exp_type('cpmg fixed')
# Create the spins
script(file='relax_2_spins.py', dir=set_dir)
# Name the isotope for field strength scaling.
spin.isotope(isotope='15N')
# Read the spectrum from NMRSeriesTab file. The "auto" will generate spectrum name of form: Z_A{i}
spectrum.read_intensities(file="peaks_list_max_standard.ser", dir=set_dir, spectrum_id='auto', int_method='height')
# Set the spectra experimental properties/settings.
script(file='relax_3_spectra_settings.py', dir=set_dir)
# Cluster residues
f = open(cluster_file, 'r')
for line in f:
resi = line.split()[0]
resn = line.split()[1]
relax_disp.cluster('NS2_cluster', ":%s@N"%resi)
f.close()
cdp.clustering
# Auto-analysis execution.
##########################
# Save the program state before run.
state.save('pre_run_cluster', force=True)