echo "spin.create(spin_name='N', spin_num=$I, res_name='$RESN', res_num=$RESI, mol_name=None)" >> $SCRIPT
end
</source>
== Prepare directory for relax run ==
Then we make a directory ready for relax
<source lang="bash">
mkdir ../relax
cp ncyc.txt ../relax
cp peaks_list* ../relax
cp relax_spins.py ../relax
</source>
== relax scripts ==
Add the following python files to the relax directory
'''relax_3_spectra_settings.py'''
<source lang="bash">
# Loop over the spectra settings.
ncycfile=open('ncyc.txt','r')
# Make empty ncyclist
ncyclist = []
i = 0
for line in ncycfile:
ncyc = line.split()[0]
time_T2 = float(line.split()[1])
vcpmg = line.split()[2]
set_sfrq = float(line.split()[3]) * 1e6
rmsd_err = float(line.split()[4])
print ncyc, time_T2, vcpmg
# Test if spectrum is a reference
if float(vcpmg) == 0.0:
vcpmg = None
else:
vcpmg = round(float(vcpmg),3)
# Add ncyc to list
ncyclist.append(int(ncyc))
# Set the current spectrum id
current_id = "Z_A%s"%(i)
# Set the peak intensity errors, as defined as the baseplane RMSD.
spectrum.baseplane_rmsd(error=rmsd_err, spectrum_id=current_id)
# Set the NMR field strength of the spectrum.
spectrometer.frequency(id=current_id, frq=set_sfrq)
# Relaxation dispersion CPMG constant time delay T (in s).
relax_disp.relax_time(spectrum_id=current_id, time=time_T2)
# Set the relaxation dispersion CPMG frequencies.
relax_disp.cpmg_frq(spectrum_id=current_id, cpmg_frq=vcpmg)
i += 1
# Specify the duplicated spectra.
#spectrum.replicated(spectrum_ids=['Z_A1', 'Z_A15'])
# The automatic way
dublicates = map(lambda val: (val, [i for i in xrange(len(ncyclist)) if ncyclist[i] == val]), ncyclist)
for dub in dublicates:
ncyc, list_index_occur = dub
if len(list_index_occur) > 1:
id_list = []
for list_index in list_index_occur:
id_list.append('Z_A%s'%list_index)
# We don't setup replications, since we have RMSD values from background noise
print id_list
#spectrum.replicated(spectrum_ids=id_list)
# Delete replicate spectrum
spectrum.delete('Z_A15')
</source>
= See also =
[[Category:Tutorials]]