mailr22828 - /trunk/test_suite/system_tests/relax_disp.py


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

Header


Content

Posted by tlinnet on April 22, 2014 - 20:48:
Author: tlinnet
Date: Tue Apr 22 20:48:30 2014
New Revision: 22828

URL: http://svn.gna.org/viewcvs/relax?rev=22828&view=rev
Log:
Splitted systemtest Relax_disp.sod1wt_t25_to_cr72 into part as setup and test 
part.

Regarding bug #21953, (https://gna.org/bugs/index.php?21953) - Weird 
performance of grid search

Modified:
    trunk/test_suite/system_tests/relax_disp.py

Modified: trunk/test_suite/system_tests/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_disp.py?rev=22828&r1=22827&r2=22828&view=diff
==============================================================================
--- trunk/test_suite/system_tests/relax_disp.py (original)
+++ trunk/test_suite/system_tests/relax_disp.py Tue Apr 22 20:48:30 2014
@@ -240,6 +240,130 @@
 
         # Change the model.
         self.interpreter.relax_disp.select_model('NS MMQ 2-site')
+
+
+    def setup_sod1wt_t25(self, pipe_name, pipe_type, pipe_name_r2eff, 
select_spin_index):
+        """Setup of data SOD1-WT CPMG. From paper at 
U{http://dx.doi.org/10.1073/pnas.0907387106}.
+
+        Optimisation of Kaare Teilum, Melanie H. Smith, Eike Schulz, Lea C. 
Christensen, Gleb Solomentseva, Mikael Oliveberg, and Mikael Akkea 2009 
+        'SOD1-WT' CPMG data to the CR72 dispersion model.
+
+        This uses the data from paper at 
U{http://dx.doi.org/10.1073/pnas.0907387106}.  This is CPMG data with a fixed 
relaxation time period recorded at fields of 500 and 600MHz.
+        Data is for experiment at 25 degree Celcius.
+        """
+
+        # Create the data pipe and load the base data.
+        data_path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'sod1wt_t25'
+
+        # Set experiment settings. sfrq, time_T2, ncyc
+        Exps = [
+        ["600MHz", "Z_A", 599.8908617*1E6, 0.06, [28, 0, 4, 32, 60, 2, 10, 
16, 8, 20, 50, 18, 40, 6, 12, 0, 24], ["Z_A1", "Z_A15"] ],
+        ["500MHz", "Z_B", 499.862139*1E6, 0.04, [20, 0, 16, 10, 36, 2, 12, 
4, 22, 18, 40, 14, 26, 8, 32, 24, 6, 28, 0], ["Z_B1", "Z_B18"] ] ]
+
+        # Create base pipe
+        self.interpreter.pipe.create(pipe_name=pipe_name, 
pipe_type=pipe_type)
+
+        # Loop throug experiments
+        id_lists = []
+        for folder, key, sfrq, time_T2, ncycs, rep_ncyss in Exps:
+            # Read spins
+            self.interpreter.spectrum.read_spins(file="128_FT.ser", 
dir=data_path+sep+folder)
+            self.interpreter.spectrum.read_spins(file="128_FT.ser", 
dir=data_path+sep+folder)
+
+            # Make spectrum id list
+            id_list = list(key+str(i) for i in range(len(ncycs)))
+            id_lists.append(id_list)
+
+            # Read intensities
+            self.interpreter.spectrum.read_intensities(file="128_FT.ser", 
dir=data_path+sep+folder, int_method='height', spectrum_id=id_list, 
int_col=list(xrange(len(id_list))) )
+
+            # Loop over experiments
+            for i in range(len(ncycs)):
+                ncyc = ncycs[i]
+                vcpmg = ncyc/time_T2
+
+                # Test if spectrum is a reference
+                if float(vcpmg) == 0.0:
+                    vcpmg = None
+                else:
+                    vcpmg = round(float(vcpmg),3)
+
+                # Set current id
+                current_id = id_list[i]
+
+                # Set the current experiment type.
+                self.interpreter.relax_disp.exp_type(spectrum_id=current_id, 
exp_type='SQ CPMG')
+
+                # Set the NMR field strength of the spectrum.
+                self.interpreter.spectrometer.frequency(id=current_id, 
frq=sfrq, units='Hz')
+
+                # Relaxation dispersion CPMG constant time delay T (in s).
+                
self.interpreter.relax_disp.relax_time(spectrum_id=current_id, time=time_T2)
+
+                # Set the relaxation dispersion CPMG frequencies.
+                self.interpreter.relax_disp.cpmg_frq(spectrum_id=current_id, 
cpmg_frq=vcpmg)
+
+        # Define replicated
+        self.interpreter.spectrum.replicated(spectrum_ids=Exps[0][5])
+        self.interpreter.spectrum.replicated(spectrum_ids=Exps[1][5])
+
+        # Perform error analysis
+        self.interpreter.spectrum.error_analysis(subset=id_lists[0])
+        self.interpreter.spectrum.error_analysis(subset=id_lists[1])
+
+        # Define isotope
+        self.interpreter.spin.isotope(isotope='15N')
+
+        #############
+
+        # Define the 64 residues which was used for Global fitting
+        glob_assn = ["G10N-H", "D11N-H", "Q15N-H", "G16N-H", "G37N-H", 
"G41N-H", "L42N-H", "H43N-H", "H46N-H", "V47N-H", "E49N-H", 
+        "E50N-H", "E51N-H", "N53N-H", "T54N-H", "G56N-H", "C57N-H", 
"T58N-H", "G61N-H", "H63aN-H", "F64aN-H", "N65aN-H", 
+        "L67N-H", "S68N-H", "K70N-H", "G72N-H", "G73N-H", "K75N-H", 
"E78N-H", "R79N-H", "H80N-H", "V81N-H", "G82N-H", 
+        "G85N-H", "N86N-H", "V87N-H", "S102N-H", "V103N-H", "I104N-H", 
"S105N-H", "A111N-H", "I112N-H", "R115N-H", 
+        "V118N-H", "E121N-H", "A123N-H", "L126N-H", "G127N-H", "K128N-H", 
"G129N-H", "G130N-H", "N131N-H", "E133N-H", 
+        "S134N-H", "T135N-H", "T137N-H", "G138N-H", "N139N-H", "A140N-H", 
"G141N-H", "S142N-H", "R143N-H", "C146N-H", "G147N-H"]
+
+        # Test number of global
+        self.assertEqual(64, len(glob_assn ))
+
+        ## Turn assignments into relax spin ids.
+        # Define regular expression search
+        r = re.compile("([a-zA-Z]+)([0-9]+)([a-zA-Z]+)")
+
+        # Create list to hold regular expression search
+        relax_glob_ids = []
+
+        # Loop over assignments
+        for assn in glob_assn:
+            # Make match for the regular search
+            m = r.match(assn)
+            # Convert to relax spin string
+            relax_string = ":%s@%s"%(m.group(2),m.group(3))
+
+            # Save the relax spin string and the regular search
+            relax_glob_ids.append([m.group(0), m.group(1), m.group(2), 
m.group(3), relax_string])
+
+        ############# Deselect all spins, and select few spins
+
+        ## Deselect all spins, and select a few for analysis
+        self.interpreter.deselect.all()            
+
+        # Select few spins
+        for i in select_spin_index:
+            self.interpreter.select.spin(spin_id=relax_glob_ids[i][4], 
change_all=False)
+
+        ##############
+
+        # Prepare for R2eff calculation
+        self.interpreter.pipe.copy(pipe_from=pipe_name, 
pipe_to=pipe_name_r2eff)
+        self.interpreter.pipe.switch(pipe_name=pipe_name_r2eff)
+
+        # Select model for points calculation
+        MODEL = "R2eff"
+        self.interpreter.relax_disp.select_model(model=MODEL)
+        # Calculate R2eff values
+        self.interpreter.calc(verbosity=1)
 
 
     def test_bug_21081_disp_cluster_fail(self):
@@ -3447,126 +3571,16 @@
         Data is for experiment at 25 degree Celcius.
         """
 
-        # Create the data pipe and load the base data.
-        data_path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'sod1wt_t25'
-
-        # Set experiment settings. sfrq, time_T2, ncyc
-        Exps = [
-        ["600MHz", "Z_A", 599.8908617*1E6, 0.06, [28, 0, 4, 32, 60, 2, 10, 
16, 8, 20, 50, 18, 40, 6, 12, 0, 24], ["Z_A1", "Z_A15"] ],
-        ["500MHz", "Z_B", 499.862139*1E6, 0.04, [20, 0, 16, 10, 36, 2, 12, 
4, 22, 18, 40, 14, 26, 8, 32, 24, 6, 28, 0], ["Z_B1", "Z_B18"] ] ]
-
-        # Generate r20 keu
-        r20_key_600 = generate_r20_key(exp_type=EXP_TYPE_CPMG_SQ, 
frq=Exps[0][2])
-        r20_key_500 = generate_r20_key(exp_type=EXP_TYPE_CPMG_SQ, 
frq=Exps[1][2])
-
-        # Create base pipe
+        # Base data setup.
         pipe_name = 'base pipe'
         pipe_type = 'relax_disp'
-        self.interpreter.pipe.create(pipe_name=pipe_name, 
pipe_type=pipe_type)
-
-        # Loop throug experiments
-        id_lists = []
-        for folder, key, sfrq, time_T2, ncycs, rep_ncyss in Exps:
-            # Read spins
-            self.interpreter.spectrum.read_spins(file="128_FT.ser", 
dir=data_path+sep+folder)
-            self.interpreter.spectrum.read_spins(file="128_FT.ser", 
dir=data_path+sep+folder)
-
-            # Make spectrum id list
-            id_list = list(key+str(i) for i in range(len(ncycs)))
-            id_lists.append(id_list)
-
-            # Read intensities
-            self.interpreter.spectrum.read_intensities(file="128_FT.ser", 
dir=data_path+sep+folder, int_method='height', spectrum_id=id_list, 
int_col=list(xrange(len(id_list))) )
-
-            # Loop over experiments
-            for i in range(len(ncycs)):
-                ncyc = ncycs[i]
-                vcpmg = ncyc/time_T2
-
-                # Test if spectrum is a reference
-                if float(vcpmg) == 0.0:
-                    vcpmg = None
-                else:
-                    vcpmg = round(float(vcpmg),3)
-
-                # Set current id
-                current_id = id_list[i]
-
-                # Set the current experiment type.
-                self.interpreter.relax_disp.exp_type(spectrum_id=current_id, 
exp_type='SQ CPMG')
-
-                # Set the NMR field strength of the spectrum.
-                self.interpreter.spectrometer.frequency(id=current_id, 
frq=sfrq, units='Hz')
-
-                # Relaxation dispersion CPMG constant time delay T (in s).
-                
self.interpreter.relax_disp.relax_time(spectrum_id=current_id, time=time_T2)
-
-                # Set the relaxation dispersion CPMG frequencies.
-                self.interpreter.relax_disp.cpmg_frq(spectrum_id=current_id, 
cpmg_frq=vcpmg)
-
-        # Define replicated
-        self.interpreter.spectrum.replicated(spectrum_ids=Exps[0][5])
-        self.interpreter.spectrum.replicated(spectrum_ids=Exps[1][5])
-
-        # Perform error analysis
-        self.interpreter.spectrum.error_analysis(subset=id_lists[0])
-        self.interpreter.spectrum.error_analysis(subset=id_lists[1])
-        #self.interpreter.spectrum.error_analysis(subset=id_lists[0])
-
-        # Define isotope
-        self.interpreter.spin.isotope(isotope='15N')
-
-        #############
-
-        # Define the 64 residues which was used for Global fitting
-        glob_assn = ["G10N-H", "D11N-H", "Q15N-H", "G16N-H", "G37N-H", 
"G41N-H", "L42N-H", "H43N-H", "H46N-H", "V47N-H", "E49N-H", 
-        "E50N-H", "E51N-H", "N53N-H", "T54N-H", "G56N-H", "C57N-H", 
"T58N-H", "G61N-H", "H63aN-H", "F64aN-H", "N65aN-H", 
-        "L67N-H", "S68N-H", "K70N-H", "G72N-H", "G73N-H", "K75N-H", 
"E78N-H", "R79N-H", "H80N-H", "V81N-H", "G82N-H", 
-        "G85N-H", "N86N-H", "V87N-H", "S102N-H", "V103N-H", "I104N-H", 
"S105N-H", "A111N-H", "I112N-H", "R115N-H", 
-        "V118N-H", "E121N-H", "A123N-H", "L126N-H", "G127N-H", "K128N-H", 
"G129N-H", "G130N-H", "N131N-H", "E133N-H", 
-        "S134N-H", "T135N-H", "T137N-H", "G138N-H", "N139N-H", "A140N-H", 
"G141N-H", "S142N-H", "R143N-H", "C146N-H", "G147N-H"]
-
-        # Test number of global
-        self.assertEqual(64, len(glob_assn ))
-
-        ## Turn assignments into relax spin ids.
-        # Define regular expression search
-        r = re.compile("([a-zA-Z]+)([0-9]+)([a-zA-Z]+)")
-
-        # Create list to hold regular expression search
-        relax_glob_ids = []
-
-        # Loop over assignments
-        for assn in glob_assn:
-            # Make match for the regular search
-            m = r.match(assn)
-            # Convert to relax spin string
-            relax_string = ":%s@%s"%(m.group(2),m.group(3))
-
-            # Save the relax spin string and the regular search
-            relax_glob_ids.append([m.group(0), m.group(1), m.group(2), 
m.group(3), relax_string])
-
-        ############# Deselect all spins, and select few spins
-
-        ## Deselect all spins, and select a few for analysis
-        self.interpreter.deselect.all()            
-
-        # Select few spins
-        for i in range(0,2):
-            self.interpreter.select.spin(spin_id=relax_glob_ids[i][4], 
change_all=False)
-
-        ##############
-
-        # Prepare for R2eff calculation
         pipe_name_r2eff = "%s_R2eff"%(pipe_name)
-        self.interpreter.pipe.copy(pipe_from=pipe_name, 
pipe_to=pipe_name_r2eff)
-        self.interpreter.pipe.switch(pipe_name=pipe_name_r2eff)
-
-        # Select model for points calculation
-        MODEL = "R2eff"
-        self.interpreter.relax_disp.select_model(model=MODEL)
-        # Calculate R2eff values
-        self.interpreter.calc(verbosity=1)
+        select_spin_index = range(0,2)
+        self.setup_sod1wt_t25(pipe_name=pipe_name, pipe_type=pipe_type, 
pipe_name_r2eff=pipe_name_r2eff, select_spin_index=select_spin_index)
+
+        # Generate r20 keu
+        r20_key_600 = generate_r20_key(exp_type=EXP_TYPE_CPMG_SQ, 
frq=599.8908617*1E6)
+        r20_key_500 = generate_r20_key(exp_type=EXP_TYPE_CPMG_SQ, 
frq=499.862139*1E6)
 
         ## Now prepare for MODEL calculation
         MODEL = "CR72"




Related Messages


Powered by MHonArc, Updated Tue Apr 22 21:00:02 2014