Changes

Jump to navigation Jump to search
β†’β€ŽIn GUI: Formatting of the instructions using templates and tags.
__TOC__
 
= Method 1 =
== Intro ==
Made from [[Tutorial_for_Relaxation_dispersion_analysis_cpmg_fixed_time_recorded_on_varian_as_fid_interleaved | Tutorial for Relaxation dispersion analysis cpmg fixed time recorded on varian as fid interleaved]]
=== Measure RMSD in spectra ===
[[Tutorial_for_Relaxation_dispersion_analysis_cpmg_fixed_time_recorded_on_varian_as_fid_interleaved#Measure_the_backgorund_noise_.22RMSD.22_in_each_of_the_.ft2_files | Measure the backgorund noise .22RMSD.22 RMSD in each of the .ft2 files ]]
==== Very fast way - RMSD via nmrpipe showApod ====
paste relaxt.txt $OUT > settings.txt
</source>
 
== Relax script ==
 
'''File: relax_1_ini.py'''
<source lang="python">
import os
from auto_analyses.relax_fit import Relax_fit
 
# Taken from the relax disp manual, section 10.6.1 Dispersion script mode - the sample script
# 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
spectrum.read_spins(file='peaks_list_max_standard.ser', dir=None)
# 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=None, spectrum_id='auto', int_method='height')
# Loop over the spectra settings.
timesfile=open('settings.txt','r')
i = 0
for line in timesfile:
timeT = line.split()[0]
set_sfrq = float(line.split()[1])
rmsd_err = float(line.split()[2])
print timeT, set_sfrq, rmsd_err
# Set the current spectrum id
current_id = "Z_A%s"%(i)
 
# Set the relax time
relax_fit.relax_time(time=float(timeT), spectrum_id=current_id)
 
# Set the peak intensity errors, as defined as the baseplane RMSD.
spectrum.baseplane_rmsd(error=rmsd_err, spectrum_id=current_id)
i += 1
# 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', force=True)
 
# Set settings for run.
results_directory = os.path.join(os.getcwd(),"model_sel_analyt")
pipe_name = 'base pipe'; pipe_bundle = 'relax_fit'
#GRID_INC = 11; MC_NUM = 500
GRID_INC = 21; MC_NUM = 100
 
Relax_fit(pipe_name=pipe_name, pipe_bundle=pipe_bundle, file_root='rx', results_dir=results_directory, grid_inc=GRID_INC, mc_sim_num=MC_NUM, view_plots=True)
</source>
 
=== Analyse ===
<source lang="bash">
relax_trunk relax_1_ini.py -t log_relax_1_ini.log
</source>
 
= Method 2 =
== Intro ==
You have measured a range of HSQC with different settings of T1 and T2.
 
You have imported one spectrum in analysis, made peak assignment, and now wan't to analyse for all the spectrum.
 
== Export peak list from analysis ==
We want to use the NMRPipe program, '''seriesTab'''.<br>
First export to Sparky format.
 
Go to
# Other
# Format converter
# Export
# Sparky
# Peaks export menu
# Select spectrum which contain your peaks
# Select export file. Save to somewhere. For example: <code>test.sparky</code>.
# Export
# In the last menu which pop-up, select {{button|OK}} for molecular system
# Then be SURE to have <code>Proton first in Dim 0</code>.
 
Remove potential un-assigned peaks '?'.
<source lang="bash">
grep -v "?" test.sparky > test2.sparky
</source>
 
Then sort the file, according to residue number. Be aware of small tricks.
<source lang="bash">
# Extraxt assignments, removing first letter
awk '{print $1}' test2.sparky | cut -d'-' -f1 | cut -c2- > sort.txt
 
# Merge columns to prepare for sort
paste sort.txt test2.sparky > sort2.tx
 
# Sort after natural sort of (version) numbers within text
sort -V sort2.tx | grep -v "Assignment" > sort3.txt
 
# Now extract columns
awk '{print $2, $3, $4, $5, $6, $7}' sort3.txt > test3.sparky
cat test3.sparky
</source>
 
You should now have a sorted peak list. Congratulations.
 
Now we convert the peak list from Sparky to NMRPipe format. First find directory with files.
 
<source lang="bash">
# Go into directory, and copy the peak file
cd "/sbinlab2/rma/Desktop/Documents/.../XYZ.fid"
cp /sbinlab2/rma/Desktop/test/test3.sparky .
 
set SPEAKS=test3.sparky
set FTFILE=0/test.ft2
 
stPeakList.pl $FTFILE $SPEAKS > test.tab
cat test.tab
 
# Now check file
nmrDraw $FTFILE
</source>
 
In NMRDraw, {{key press|shift|k}}. Push {{button|read}}. Now zoom into a peak. Be "sure", that you have not moved the spectrum in analysis or so.
 
== Do intensity measurements for all spectra ==
<source lang="bash">
# '-1': single column, 'v' natural sort of (version) numbers within text,
ls -v -d -1 */*.ft2 > ft2_files.ls
cat ft2_files.ls
 
# So. -in 'test.tab' contains information about x,y positions in frequency units.
# -out tells where to store file.
# -list tells which ft2 files to compare.
# -max takes the height.
# -max -dx 1 -dy 1, takes the height within a freqency box of +/- 1 freqeuncy unit.
seriesTab -in test.tab -out peaks_list_max_standard.ser -list ft2_files.ls -max
seriesTab -in test.tab -out peaks_list_max_dx1_dy1.ser -list ft2_files.ls -max -dx 1 -dy 1
</source>
 
== Extract time delays from procpar==
<source lang="bash">
# '^' look for line starting with.
# Then take next line.
# print from column 2 to end of line.
set RELAXT=`awk '/^relaxT /{f=1;next}f{print $0;exit}' procpar | cut -d" " -f 2-`; echo $RELAXT
 
set SFRQ=`awk '/^sfrq /{f=1;next}f{print $2;exit}' procpar`; echo $SFRQ
</source>
 
Now extract noise from spectrums
<source lang="bash">
set FIDS=`cat ft2_files.ls`
set OUT=../apod_rmsd.txt
foreach I (`seq 1 ${#FIDS}`)
set FID=${FIDS[$I]}; set DIRN=`dirname $FID`
cd $DIRN
set apodrmsd=`showApod *.ft2 | grep "REMARK Automated Noise Std Dev in Processed Data:" | awk '{print $9}'`
set RELAXTI=${RELAXT[$I]}
echo $DIRN $RELAXTI $apodrmsd $SFRQ >> $OUT
cd ..
end
 
cat apod_rmsd.txt
</source>
 
You should now a file with settings, which tell the delay time and spectrum noise for the measurements. <br>
You also have a file, which have measured intensities for spins at each spectrum.
 
== Analyse in relax ==
 
=== In GUI ===
<source lang="bash">
gedit analyse_relax_gui.py
</source>
 
<source lang="python">
# Create the spins
spectrum.read_spins(file="peaks_list_max_standard.ser", dir=None)
 
# 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=None, spectrum_id='auto', int_method='height')
 
# Open the settings file.
set_file = open('apod_rmsd.txt', 'r')
 
for i, line in enumerate(set_file):
# Set the current spectrum id
current_id = "Z_A%s"%(i)
 
# Get the relax time.
relaxT_i = float(line.split()[1])
rmsd_i = float(line.split()[2])
sfrq_i = float(line.split()[3])
 
print relaxT_i, rmsd_i, sfrq_i
 
# Set time
relax_fit.relax_time(time=relaxT_i, spectrum_id=current_id)
 
# Set noise
spectrum.baseplane_rmsd(error=rmsd_i, spectrum_id=current_id)
 
# Set sfrq
spectrometer.frequency(id=current_id, frq=sfrq_i, units='MHz')
</source>
 
Then do:
# <code>relax -g</code>
# {{button|New analysis}}
# {{button|R2 relaxation}} {{next}} {{button|Next}}
# Create pipe {{button|Finish}}
# {{menu|User functions (n-z)|script}} {{next}} <code>analyse_relax_gui.py</code>
# Set in top <code>NMR freqeuncy label</code> to <code>750</code>.
# {{button|OK}}
 
=== In GUI ===
<source lang="bash">
gedit analyse_relax.py
</source>
 
<source lang="python">
from auto_analyses.relax_fit import Relax_fit
 
# Taken from the relax disp manual, section 10.6.1 Dispersion script mode - the sample script
# Create the data pipe.
pipe_name = 'base pipe'
pipe_bundle = 'RMA'
pipe.create(pipe_name=pipe_name, bundle=pipe_bundle, pipe_type='relax_fit')
# Create the spins
spectrum.read_spins(file="peaks_list_max_standard.ser", dir=None)
 
# 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=None, spectrum_id='auto', int_method='height')
 
# Open the settings file.
set_file = open('apod_rmsd.txt', 'r')
 
for i, line in enumerate(set_file):
# Set the current spectrum id
current_id = "Z_A%s"%(i)
 
# Get the relax time.
relaxT_i = float(line.split()[1])
rmsd_i = float(line.split()[2])
sfrq_i = float(line.split()[3])
 
print relaxT_i, rmsd_i, sfrq_i
 
# Set time
relax_fit.relax_time(time=relaxT_i, spectrum_id=current_id)
 
# Set noise
spectrum.baseplane_rmsd(error=rmsd_i, spectrum_id=current_id)
 
# Set sfrq
spectrometer.frequency(id=current_id, frq=sfrq_i, units='MHz')
 
Relax_fit(pipe_name=pipe_name, pipe_bundle=pipe_bundle, file_root='R2', results_dir=None, grid_inc=11, mc_sim_num=500, view_plots=False)
</source>
 
Run relax
<source lang="bash">
relax analyse_relax.py
</source>
 
== See also ==
[[Category:Tutorials]]
Trusted, Bureaucrats
4,223

edits

Navigation menu