Open main menu

Changes

tail -n +2 exp_parameters.txt | awk '{print $7}' | sort -k1,1n | uniq
tail -n +2 exp_parameters.txt | awk '{print $8}' | sort -k1,1n | uniq
</source>
 
== Analyse rx ==
 
=== Setup rx data ===
'''rx_1_ini.py'''
<source lang="python">
# Create the data pipe.
pipe_name = 'base pipe'
pipe_bundle = 'relax_fit'
pipe.create(pipe_name=pipe_name, bundle=pipe_bundle, pipe_type='relax_fit')
 
# Create the spins
script(file='relax_2_spins.py', dir=None)
 
# Set the spectra experimental properties/settings.
script(file='rx_3_spectra_settings.py', dir=None)
 
# Save the program state before run.
# This state file will also be used for loading, before a later cluster/global fit analysis.
state.save('ini_setup_rx', force=True)
</source>
 
'''rx_3_spectra_settings.py'''
<source lang="python">
# Set settings for experiment
import os
 
spin_locks = [0.0, 500.0, 1000.0, 2000.0, 5000.0, 10000.0]
lock_powers = [35.0, 39.0, 41.0, 43.0, 46.0, 48.0]
ncycs = [0, 4, 10, 14, 20, 40]
 
# Load the experiments settings file.
expfile = open('exp_parameters_sort.txt','r')
expfileslines = expfile.readlines()
fpipe = open('pipe_names_rx.txt','w')
 
for spin_lock in spin_locks:
for lock_power in lock_powers:
for i in range(len(expfileslines)):
line=expfileslines[i]
if line[0] == "#":
continue
else:
# DIRN I deltadof2 dpwr2slock ncyc trim ss sfrq
DIRN = line.split()[0]
I = int(line.split()[1])
deltadof2 = float(line.split()[2])
dpwr2slock = float(line.split()[3])
ncyc = int(line.split()[4])
trim = float(line.split()[5])
ss = int(line.split()[6])
set_sfrq = float(line.split()[7])
 
# Calculate spin_lock time
time_sl = 2*ncyc*trim
 
# Define file name for peak list.
FNAME = "%s_%s_%s_%s_max_standard.ser"%(I, int(deltadof2), int(dpwr2slock), ncyc)
sp_id = "%s_%s_%s_%s"%(I, int(deltadof2), int(dpwr2slock), ncyc)
 
if deltadof2 == spin_lock and dpwr2slock == lock_power and ncyc == ncycs[0]:
pipename = "%s_%s"%(int(deltadof2), int(dpwr2slock))
pipebundle = 'relax_fit'
pipe.copy(pipe_from='base pipe', pipe_to=pipename, bundle_to=pipebundle)
pipe.switch(pipe_name=pipename)
fpipe.write("%s %s"%(pipename, pipebundle)+"\n")
 
#print spin_lock, deltadof2, lock_power, dpwr2slock
if deltadof2 == spin_lock and dpwr2slock == lock_power:
# Load the peak intensities (first the backbone NH, then the tryptophan indole NH).
spectrum.read_intensities(file=FNAME, dir=os.path.join(os.getcwd(),"peak_lists"), spectrum_id=sp_id, int_method='height')
 
# Set the relaxation times.
relax_fit.relax_time(time=time_sl, spectrum_id=sp_id)
 
# Set the peak intensity errors, as defined as the baseplane RMSD.
spectrum.baseplane_rmsd(error=1.33e+03, spectrum_id=sp_id)
 
expfile.close()
fpipe.close()
</source>
 
Run by
<source lang="bash">
relax rx_1_ini.py -t log_rx_1_ini.log
</source>
 
=== analyse rx data ===
'''rx_4_run.py'''
<source lang="python">
import os
from auto_analyses.relax_fit import Relax_fit
 
# Set settings for run.
GRID_INC = 11; MC_NUM = 3
 
# Load the initial state setup
state.load(state='ini_setup_rx.bz2')
 
# Load the pipe names.
fpipe = open('pipe_names_rx.txt','r')
pipenames = []
for line in fpipe:
pipenames.append([line.split()[0], line.split()[1]])
fpipe.close()
 
for pipename, pipebundle in pipenames:
pipe.switch(pipe_name=pipename)
results_directory = os.path.join("rx", pipename)
 
Relax_fit(pipe_name=pipename, pipe_bundle=pipebundle, file_root='rx', results_dir=results_directory, grid_inc=GRID_INC, mc_sim_num=MC_NUM, view_plots=False)
</source>
 
Run by
<source lang="bash">
relax rx_4_run.py -t log_rx_4_run.log
</source>
= See also =
[[Category:Tutorials]]
Trusted, Bureaucrats
1,382

edits