Difference between revisions of "Tutorial for R1/R2 Relaxation curve-fitting analysis on varian recorded as fid interleaved"
Jump to navigation
Jump to search
Line 60: | Line 60: | ||
== Relax script == | == Relax script == | ||
+ | |||
+ | '''File: relax_1_ini.py''' | ||
<source lang="python"> | <source lang="python"> | ||
import os | import os | ||
Line 110: | Line 112: | ||
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) | 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> | </source> | ||
+ | |||
+ | === Analyse === | ||
+ | relax_trunk relax_1_ini.py -t log_relax_1_ini.log |
Revision as of 11:35, 3 February 2014
Contents
Intro
Made from Tutorial for Relaxation dispersion analysis cpmg fixed time recorded on varian as fid interleaved
Get the process helper scripts
Check the peak list matches
sparky 0/test.ucsf
Prepare files
Make standard peak list
stPeakList.pl 0/test.ft2 peak_list_SPARKY.list > peak_list_SPARKY.tab cat peak_list_SPARKY.tab
Find *.ft2 files
ls -v -d -1 */*.ft2 > ft2_files.ls cat ft2_files.ls
Measure heights
seriesTab -in peak_list_SPARKY.tab -out peaks_list_max_standard.ser -list ft2_files.ls -max cat peaks_list_max_standard.ser
Extract the spectra settings from Varian procpar file
set RELAXT=`awk '/^relaxT /{f=1;next}f{print $0;exit}' procpar`; echo $NCYCLIST
set SFRQ=`awk '/^sfrq /{f=1;next}f{print $2;exit}' procpar`; echo $SFRQ
foreach I (`seq 2 ${#RELAXT}`)
set T=${RELAXT[$I]}; echo $T $SFRQ >> relaxt.txt
end
cat relaxt.txt
Measure RMSD in spectra
Measure the backgorund noise RMSD in each of the .ft2 files
Very fast way - RMSD via nmrpipe showApod
We can also use the showApod rmsd.
set FIDS=`cat ft2_files.ls`
set OUT=${PWD}/apod_rmsd.txt
set CWD=$PWD
rm $OUT
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}'`
echo $apodrmsd $DIRN >> $OUT
cd $CWD
end
cat $OUT
paste relaxt.txt $OUT > settings.txt
Relax script
File: relax_1_ini.py
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)
Analyse
relax_trunk relax_1_ini.py -t log_relax_1_ini.log