mailr19361 - in /branches/relax_disp/test_suite/system_tests: relax_disp.py scripts/relax_disp/ scripts/relax_disp/exp_fit.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on April 04, 2013 - 16:15:
Author: bugman
Date: Thu Apr  4 16:15:07 2013
New Revision: 19361

URL: http://svn.gna.org/viewcvs/relax?rev=19361&view=rev
Log:
Created the Relax_disp.test_exp_fit system test for checking the relaxation 
dispersion 'exp_fit' model.


Added:
    branches/relax_disp/test_suite/system_tests/scripts/relax_disp/
    branches/relax_disp/test_suite/system_tests/scripts/relax_disp/exp_fit.py
Modified:
    branches/relax_disp/test_suite/system_tests/relax_disp.py

Modified: branches/relax_disp/test_suite/system_tests/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/system_tests/relax_disp.py?rev=19361&r1=19360&r2=19361&view=diff
==============================================================================
--- branches/relax_disp/test_suite/system_tests/relax_disp.py (original)
+++ branches/relax_disp/test_suite/system_tests/relax_disp.py Thu Apr  4 
16:15:07 2013
@@ -71,6 +71,13 @@
         self.interpreter.run(script_file=status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'relax_disp_cpmg_slow.py')
 
 
+    def test_exp_fit(self):
+        """Test the relaxation dispersion 'exp_fit' model curve fitting."""
+
+        # Execute the script.
+        self.interpreter.run(script_file=status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'relax_disp'+sep+'exp_fit.py')
+
+
     def test_read_r2eff(self):
         """Test the reading of a file containing r2eff values."""
 

Added: 
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/exp_fit.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/system_tests/scripts/relax_disp/exp_fit.py?rev=19361&view=auto
==============================================================================
--- branches/relax_disp/test_suite/system_tests/scripts/relax_disp/exp_fit.py 
(added)
+++ branches/relax_disp/test_suite/system_tests/scripts/relax_disp/exp_fit.py 
Thu Apr  4 16:15:07 2013
@@ -1,0 +1,88 @@
+# Script for fitting the 'exp_fit' relaxation dispersion model to synthetic 
R1rho data.
+
+# Python module imports.
+from os import sep
+
+# relax module imports.
+from status import Status; status = Status()
+
+
+# Create the data pipe.
+pipe.create('exp_fit', 'relax_disp')
+
+# The path to the data files.
+data_path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'curve_fitting_disp'+sep+'exp_fit_data'
+
+# Create the sequence data.
+spin.create(res_name='Asp', res_num=1, spin_name='N')
+spin.create(res_name='Gly', res_num=2, spin_name='N')
+spin.create(res_name='Lys', res_num=3, spin_name='N')
+
+# Set the relaxation dispersion experiment type.
+relax_disp.exp_type('r1rho')
+
+# Set the relaxation dispersion curve type.
+relax_disp.select_model('exp_fit')
+
+# The spectral data - spectrum ID, peak lists, offset frequency (Hz), 
relaxation time period (s), baseplane RMSD estimate.
+data = [
+    ["nu_1kHz_relaxT_0.01", "nu_1kHz_relaxT_0.01.list", 1000.0, 0.01,   
1000],
+    ["nu_1kHz_relaxT_0.02", "nu_1kHz_relaxT_0.02.list", 1000.0, 0.02,   
1000],
+    ["nu_1kHz_relaxT_0.04", "nu_1kHz_relaxT_0.04.list", 1000.0, 0.04,   
1000],
+    ["nu_1kHz_relaxT_0.06", "nu_1kHz_relaxT_0.06.list", 1000.0, 0.06,   
1000],
+    ["nu_1kHz_relaxT_0.08", "nu_1kHz_relaxT_0.08.list", 1000.0, 0.08,   
1000],
+    ["nu_1kHz_relaxT_0.10", "nu_1kHz_relaxT_0.10.list", 1000.0, 0.10,   
1000],
+    ["nu_1kHz_relaxT_0.12", "nu_1kHz_relaxT_0.12.list", 1000.0, 0.12,   
1000],
+    ["nu_2kHz_relaxT_0.01", "nu_2kHz_relaxT_0.01.list", 2000.0, 0.01,   
1000],
+    ["nu_2kHz_relaxT_0.02", "nu_2kHz_relaxT_0.02.list", 2000.0, 0.02,   
1000],
+    ["nu_2kHz_relaxT_0.04", "nu_2kHz_relaxT_0.04.list", 2000.0, 0.04,   
1000],
+    ["nu_2kHz_relaxT_0.06", "nu_2kHz_relaxT_0.06.list", 2000.0, 0.06,   
1000],
+    ["nu_2kHz_relaxT_0.08", "nu_2kHz_relaxT_0.08.list", 2000.0, 0.08,   
1000],
+    ["nu_2kHz_relaxT_0.10", "nu_2kHz_relaxT_0.10.list", 2000.0, 0.10,   
1000],
+    ["nu_2kHz_relaxT_0.12", "nu_2kHz_relaxT_0.12.list", 2000.0, 0.12,   
1000],
+]
+
+# Loop over the spectral data, loading it and setting the metadata.
+for i in range(len(data)):
+    # Load the peak intensities and set the errors.
+    spectrum.read_intensities(file=data[i][1], dir=data_path, 
spectrum_id=data[i][0], int_method='height', proton='H')
+    spectrum.baseplane_rmsd(spectrum_id=data[i][0], error=data[i][4])
+
+    # Set the relaxation dispersion spin-lock field strength (nu1).
+    relax_disp.spin_lock_field(spectrum_id=data[i][0], field=data[i][2])
+
+    # Set the relaxation times.
+    relax_disp.relax_time(spectrum_id=data[i][0], time=data[i][3])
+
+# Peak intensity error analysis.
+spectrum.error_analysis()
+
+# Grid search.
+grid_search(inc=11)
+
+# Minimise.
+minimise('simplex', constraints=False)
+
+# Monte Carlo simulations.
+monte_carlo.setup(number=10)
+monte_carlo.create_data()
+monte_carlo.initial_values()
+minimise('simplex', constraints=False)
+monte_carlo.error_analysis()
+
+# Save the relaxation dispersion parameters.
+value.write(param='rex', file='devnull', force=True)
+
+# Save the results.
+results.write(file='devnull', force=True)
+
+# Create Grace plots of the data.
+grace.write(y_data_type='chi2', file='devnull', force=True)    # Minimised 
chi-squared value.
+grace.write(y_data_type='R2', file='devnull', force=True)    # R2 parameter 
without Rex contribution.
+grace.write(y_data_type='Rex', file='devnull', force=True)    # Chemical 
exchange contribution to observed R2.
+grace.write(y_data_type='kex', file='devnull', force=True)    # Exchange 
rate.
+grace.write(x_data_type='frq', y_data_type='int', file='devnull', 
force=True)    # Average peak intensities.
+grace.write(x_data_type='frq', y_data_type='int', norm=True, file='devnull', 
force=True)    # Average peak intensities (normalised).
+
+# Save the program state.
+state.save('devnull', force=True)




Related Messages


Powered by MHonArc, Updated Thu Apr 04 16:20:02 2013