mailr19486 - in /branches/relax_disp/test_suite/system_tests: ./ scripts/relax_disp/


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

Header


Content

Posted by edward on April 16, 2013 - 11:49:
Author: bugman
Date: Tue Apr 16 11:49:11 2013
New Revision: 19486

URL: http://svn.gna.org/viewcvs/relax?rev=19486&view=rev
Log:
Combined all the system test scripts of Flemming Hansen's fixed time period 
CPMG data.

For details of this data, see 
http://thread.gmane.org/gmane.science.nmr.relax.devel/3790/focus=3827.


Added:
    
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data.py
      - copied, changed from r19485, 
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data_fast_2site.py
Removed:
    
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data_fast_2site.py
    
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data_slow_2site.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=19486&r1=19485&r2=19486&view=diff
==============================================================================
--- branches/relax_disp/test_suite/system_tests/relax_disp.py (original)
+++ branches/relax_disp/test_suite/system_tests/relax_disp.py Tue Apr 16 
11:49:11 2013
@@ -57,17 +57,29 @@
 
 
     def test_hansen_cpmg_data_fast_2site(self):
-        """Optimisation of Fleming Hansen's CPMG data to the fast 2-site 
dispersion model."""
+        """Optimisation of Dr. Flemming Hansen's CPMG data to the fast 
2-site dispersion model.
+
+        This uses the data from Dr. Flemming Hansen's paper at 
http://dx.doi.org/10.1021/jp074793o.  This is CPMG data with a fixed 
relaxation time period.
+        """
+
+        # Set the model.
+        ds.models = ['fast 2-site']
 
         # Execute the script.
-        self.interpreter.run(script_file=status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'relax_disp'+sep+'hansen_data_fast_2site.py')
+        self.interpreter.run(script_file=status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'relax_disp'+sep+'hansen_data.py')
 
 
     def test_hansen_cpmg_data_slow_2site(self):
-        """Optimisation of Fleming Hansen's CPMG data to the slow 2-site 
dispersion model."""
+        """Optimisation of Dr. Flemming Hansen's CPMG data to the slow 
2-site dispersion model.
+
+        This uses the data from Dr. Flemming Hansen's paper at 
http://dx.doi.org/10.1021/jp074793o.  This is CPMG data with a fixed 
relaxation time period.
+        """
+
+        # Set the model.
+        ds.models = ['slow 2-site']
 
         # Execute the script.
-        self.interpreter.run(script_file=status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'relax_disp'+sep+'hansen_data_slow_2site.py')
+        self.interpreter.run(script_file=status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'relax_disp'+sep+'hansen_data.py')
 
 
     def test_exp_fit(self):

Copied: 
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data.py 
(from r19485, 
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data_fast_2site.py)
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data.py?p2=branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data.py&p1=branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data_fast_2site.py&r1=19485&r2=19486&rev=19486&view=diff
==============================================================================
--- 
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data_fast_2site.py
 (original)
+++ 
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data.py 
Tue Apr 16 11:49:11 2013
@@ -14,6 +14,8 @@
 
 # The dispersion models.
 MODELS = ['exp_fit', 'fast 2-site']
+if hasattr(ds, 'models'):
+    MODELS = ds.models
 
 # The grid search size (the number of increments per dimension).
 GRID_INC = 5

Removed: 
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data_fast_2site.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data_fast_2site.py?rev=19485&view=auto
==============================================================================
--- 
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data_fast_2site.py
 (original)
+++ 
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data_fast_2site.py
 (removed)
@@ -1,130 +1,0 @@
-# Script for CPMG relaxation dispersion curve fitting using Dr. Flemming 
Hansen's data from http://dx.doi.org/10.1021/jp074793o.
-
-# Python module imports.
-from os import sep
-
-# relax module imports.
-from auto_analyses.relax_disp import Relax_disp
-from data_store import Relax_data_store; ds = Relax_data_store()
-from status import Status; status = Status()
-
-
-# Analysis variables.
-#####################
-
-# The dispersion models.
-MODELS = ['exp_fit', 'fast 2-site']
-
-# The grid search size (the number of increments per dimension).
-GRID_INC = 5
-
-# The number of Monte Carlo simulations to be used for error analysis at the 
end of the analysis.
-MC_NUM = 3
-
-
-
-# Set up the data pipe.
-#######################
-
-# The results directory.
-if not hasattr(ds, 'tmpdir'):
-    ds.tmpdir = None
-
-# Create the data pipe.
-pipe_name = 'base pipe'
-pipe_bundle = 'relax_disp'
-pipe.create(pipe_name=pipe_name, bundle=pipe_bundle, pipe_type='relax_disp')
-
-# The path to the data files.
-data_path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'Hansen'
-
-# Load the sequence.
-sequence.read('fake_sequence.in', dir=status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'Hansen', 
res_num_col=1, res_name_col=2)
-
-# Name the spins so they can be matched to the assignments.
-spin.name(name='N')
-
-# Set the relaxation dispersion experiment type.
-relax_disp.exp_type('cpmg fixed')
-
-# The spectral data - spectrum ID, peak list file name, CPMG frequency (Hz), 
spectrometer frequency in Hertz.
-data = [
-    ['500_reference.in',    '500_MHz'+sep+'reference.in_sparky',           
None,  500e6],
-    ['500_66.667.in',       '500_MHz'+sep+'66.667.in_sparky',           
66.6666,  500e6],
-    ['500_133.33.in',       '500_MHz'+sep+'133.33.in_sparky',          
133.3333,  500e6],
-    ['500_133.33.in.bis',   '500_MHz'+sep+'133.33.in.bis_sparky',      
133.3333,  500e6],
-    ['500_200.in',          '500_MHz'+sep+'200.in_sparky',             
200.0000,  500e6],
-    ['500_266.67.in',       '500_MHz'+sep+'266.67.in_sparky',          
266.6666,  500e6],
-    ['500_333.33.in',       '500_MHz'+sep+'333.33.in_sparky',          
333.3333,  500e6],
-    ['500_400.in',          '500_MHz'+sep+'400.in_sparky',             
400.0000,  500e6],
-    ['500_466.67.in',       '500_MHz'+sep+'466.67.in_sparky',          
466.6666,  500e6],
-    ['500_533.33.in',       '500_MHz'+sep+'533.33.in_sparky',          
533.3333,  500e6],
-    ['500_533.33.in.bis',   '500_MHz'+sep+'533.33.in.bis_sparky',      
533.3333,  500e6],
-    ['500_600.in',          '500_MHz'+sep+'600.in_sparky',             
600.0000,  500e6],
-    ['500_666.67.in',       '500_MHz'+sep+'666.67.in_sparky',          
666.6666,  500e6],
-    ['500_733.33.in',       '500_MHz'+sep+'733.33.in_sparky',          
733.3333,  500e6],
-    ['500_800.in',          '500_MHz'+sep+'800.in_sparky',             
800.0000,  500e6],
-    ['500_866.67.in',       '500_MHz'+sep+'866.67.in_sparky',          
866.6666,  500e6],
-    ['500_933.33.in',       '500_MHz'+sep+'933.33.in_sparky',          
933.3333,  500e6],
-    ['500_933.33.in.bis',   '500_MHz'+sep+'933.33.in.bis_sparky',      
933.3333,  500e6],
-    ['500_1000.in',         '500_MHz'+sep+'1000.in_sparky',           
1000.0000,  500e6],
-    ['800_reference.in',    '800_MHz'+sep+'reference.in_sparky',           
None,  800e6],
-    ['800_66.667.in',       '800_MHz'+sep+'66.667.in_sparky',           
66.6666,  800e6],
-    ['800_133.33.in',       '800_MHz'+sep+'133.33.in_sparky',          
133.3333,  800e6],
-    ['800_133.33.in.bis',   '800_MHz'+sep+'133.33.in.bis_sparky',      
133.3333,  800e6],
-    ['800_200.in',          '800_MHz'+sep+'200.in_sparky',             
200.0000,  800e6],
-    ['800_266.67.in',       '800_MHz'+sep+'266.67.in_sparky',          
266.6666,  800e6],
-    ['800_333.33.in',       '800_MHz'+sep+'333.33.in_sparky',          
333.3333,  800e6],
-    ['800_400.in',          '800_MHz'+sep+'400.in_sparky',             
400.0000,  800e6],
-    ['800_466.67.in',       '800_MHz'+sep+'466.67.in_sparky',          
466.6666,  800e6],
-    ['800_533.33.in',       '800_MHz'+sep+'533.33.in_sparky',          
533.3333,  800e6],
-    ['800_533.33.in.bis',   '800_MHz'+sep+'533.33.in.bis_sparky',      
533.3333,  800e6],
-    ['800_600.in',          '800_MHz'+sep+'600.in_sparky',             
600.0000,  800e6],
-    ['800_666.67.in',       '800_MHz'+sep+'666.67.in_sparky',          
666.6666,  800e6],
-    ['800_733.33.in',       '800_MHz'+sep+'733.33.in_sparky',          
733.3333,  800e6],
-    ['800_800.in',          '800_MHz'+sep+'800.in_sparky',             
800.0000,  800e6],
-    ['800_866.67.in',       '800_MHz'+sep+'866.67.in_sparky',          
866.6666,  800e6],
-    ['800_933.33.in',       '800_MHz'+sep+'933.33.in_sparky',          
933.3333,  800e6],
-    ['800_933.33.in.bis',   '800_MHz'+sep+'933.33.in.bis_sparky',      
933.3333,  800e6],
-    ['800_1000.in',         '800_MHz'+sep+'1000.in_sparky',           
1000.0000,  800e6]
-]
-
-# Loop over the spectra.
-for id, file, cpmg_frq, H_frq in data:
-    # Load the peak intensities.
-    spectrum.read_intensities(file=file, dir=data_path, spectrum_id=id, 
int_method='height')
-
-    # Relaxation dispersion CPMG constant time delay T (in s).
-    relax_disp.cpmg_delayT(spectrum_id=id, delayT=0.030)
-
-    # Set the relaxation dispersion CPMG frequencies.
-    relax_disp.cpmg_frq(spectrum_id=id, cpmg_frq=cpmg_frq)
-
-    # Set the NMR field strength of the spectrum.
-    frq.set(id=id, frq=H_frq)
-
-# Specify the duplicated spectra.
-spectrum.replicated(spectrum_ids=['500_133.33.in', '500_133.33.in.bis'])
-spectrum.replicated(spectrum_ids=['500_533.33.in', '500_533.33.in.bis'])
-spectrum.replicated(spectrum_ids=['500_933.33.in', '500_933.33.in.bis'])
-spectrum.replicated(spectrum_ids=['800_133.33.in', '800_133.33.in.bis'])
-spectrum.replicated(spectrum_ids=['800_533.33.in', '800_533.33.in.bis'])
-spectrum.replicated(spectrum_ids=['800_933.33.in', '800_933.33.in.bis'])
-
-# Peak intensity error analysis.
-spectrum.error_analysis(subset=['500_reference.in', '500_66.667.in', 
'500_133.33.in', '500_133.33.in.bis', '500_200.in', '500_266.67.in', 
'500_333.33.in', '500_400.in', '500_466.67.in', '500_533.33.in', 
'500_533.33.in.bis', '500_600.in', '500_666.67.in', '500_733.33.in', 
'500_800.in', '500_866.67.in', '500_933.33.in', '500_933.33.in.bis', 
'500_1000.in'])
-spectrum.error_analysis(subset=['800_reference.in', '800_66.667.in', 
'800_133.33.in', '800_133.33.in.bis', '800_200.in', '800_266.67.in', 
'800_333.33.in', '800_400.in', '800_466.67.in', '800_533.33.in', 
'800_533.33.in.bis', '800_600.in', '800_666.67.in', '800_733.33.in', 
'800_800.in', '800_866.67.in', '800_933.33.in', '800_933.33.in.bis', 
'800_1000.in'])
-
-# Deselect unresolved spins.
-deselect.read(file='unresolved', dir=data_path+sep+'500_MHz', res_num_col=1)
-deselect.read(file='unresolved', dir=data_path+sep+'800_MHz', res_num_col=1)
-
-
-# Auto-analysis execution.
-##########################
-
-# Do not change!
-Relax_disp(pipe_name=pipe_name, pipe_bundle=pipe_bundle, 
results_dir=ds.tmpdir, models=MODELS, grid_inc=GRID_INC, mc_sim_num=MC_NUM)
-
-# Save the program state.
-state.save('devnull', force=True)

Removed: 
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data_slow_2site.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data_slow_2site.py?rev=19485&view=auto
==============================================================================
--- 
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data_slow_2site.py
 (original)
+++ 
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data_slow_2site.py
 (removed)
@@ -1,127 +1,0 @@
-# Script for CPMG relaxation dispersion curve fitting in the slow-exchange 
limit.
-
-# Python module imports.
-from os import sep
-
-# relax module imports.
-from status import Status; status = Status()
-
-
-# Create the data pipe.
-pipe.create('rex', 'relax_disp')
-
-# The path to the data files.
-data_path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'curve_fitting_disp'+sep+'Hansen'+sep+'500_MHz'
-
-# Load the sequence.
-sequence.read('fake_sequence.in', dir=status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'curve_fitting_disp'+sep+'Hansen', 
res_num_col=1, res_name_col=2)
-
-# Name the spins so they can be matched to the assignments.
-spin.name(name='N')
-
-# Set the relaxation dispersion experiment type.
-relax_disp.exp_type('cpmg')
-
-# Set the relaxation dispersion curve type.
-relax_disp.select_model('slow')
-
-# Relaxation dispersion magnetic field (in Hz).
-frq.set(id='500', frq=500.0 * 1e6)
-
-# Spectrum names.
-names = [
-    'reference.in_sparky',
-    '66.667.in_sparky',
-    '1000.in_sparky',
-    '133.33.in_sparky',
-    '933.33.in_sparky',
-    '200.in_sparky',
-    '866.67.in_sparky',
-    '266.67.in_sparky',
-    '800.in_sparky',
-    '333.33.in_sparky',
-    '733.33.in_sparky',
-    '400.in_sparky',
-    '666.67.in_sparky',
-    '466.67.in_sparky',
-    '600.in_sparky',
-    '533.33.in_sparky',
-    '133.33.in.bis_sparky',
-    '933.33.in.bis_sparky',
-    '533.33.in.bis_sparky'
-]
-
-# Relaxation dispersion CPMG constant time delay T (in s).
-relax_disp.cpmg_delayT(id='500', delayT=0.030)
-
-# Relaxation dispersion CPMG frequencies (in Hz).
-cpmg_frq = [
-    None,
-    66.667,
-    1000,
-    133.33,
-    933.33,
-    200,
-    866.67,
-    266.67,
-    800,
-    333.33,
-    733.33,
-    400,
-    666.67,
-    466.67,
-    600,
-    533.33,
-    133.33,
-    933.33,
-    533.33
-]
-
-# Loop over the spectra.
-for i in xrange(len(names)):
-    # Load the peak intensities.
-    spectrum.read_intensities(file=names[i], dir=data_path, 
spectrum_id=names[i], int_method='height')
-
-    # Set the relaxation dispersion CPMG frequencies.
-    relax_disp.cpmg_frq(cpmg_frq=cpmg_frq[i], spectrum_id=names[i])
-
-# Specify the duplicated spectra.
-spectrum.replicated(spectrum_ids=['133.33.in_sparky', 
'133.33.in.bis_sparky'])
-spectrum.replicated(spectrum_ids=['533.33.in_sparky', 
'533.33.in.bis_sparky'])
-spectrum.replicated(spectrum_ids=['933.33.in_sparky', 
'933.33.in.bis_sparky'])
-
-# Peak intensity error analysis.
-spectrum.error_analysis()
-
-# Deselect unresolved spins.
-deselect.read(file='unresolved', dir=data_path, res_num_col=1)
-
-# 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 Tue Apr 16 12:20:01 2013