Author: bugman Date: Wed Jan 25 10:02:19 2012 New Revision: 15243 URL: http://svn.gna.org/viewcvs/relax?rev=15243&view=rev Log: Reactivated and converted the Frame_order.test_cam_free_rotor() system test to the new design. Modified: branches/frame_order_testing/test_suite/system_tests/frame_order.py branches/frame_order_testing/test_suite/system_tests/scripts/frame_order/cam/free_rotor.py Modified: branches/frame_order_testing/test_suite/system_tests/frame_order.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/test_suite/system_tests/frame_order.py?rev=15243&r1=15242&r2=15243&view=diff ============================================================================== --- branches/frame_order_testing/test_suite/system_tests/frame_order.py (original) +++ branches/frame_order_testing/test_suite/system_tests/frame_order.py Wed Jan 25 10:02:19 2012 @@ -161,7 +161,7 @@ setattr(cdp, param, curr) - def fixme_test_cam_free_rotor(self): + def test_cam_free_rotor(self): """Test the free rotor frame order model of CaM.""" # Execute the script. Modified: branches/frame_order_testing/test_suite/system_tests/scripts/frame_order/cam/free_rotor.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/test_suite/system_tests/scripts/frame_order/cam/free_rotor.py?rev=15243&r1=15242&r2=15243&view=diff ============================================================================== --- branches/frame_order_testing/test_suite/system_tests/scripts/frame_order/cam/free_rotor.py (original) +++ branches/frame_order_testing/test_suite/system_tests/scripts/frame_order/cam/free_rotor.py Wed Jan 25 10:02:19 2012 @@ -11,7 +11,8 @@ # Some variables. -DATA_PATH = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'frame_order'+sep +BASE_PATH = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'frame_order'+sep+'cam'+sep +DATA_PATH = BASE_PATH + 'free_rotor' class Analysis: @@ -38,23 +39,57 @@ def optimisation(self): """Optimise the frame order model.""" - # The file paths. - PATH_N_DOM = DATA_PATH - PATH_C_DOM = PATH_N_DOM+sep+'free_rotor'+sep - # Create the data pipe. pipe.create(pipe_name='frame order', pipe_type='frame order') - # Load the tensors. - script(PATH_N_DOM + 'tensors.py') - script(PATH_C_DOM + 'tensors.py') + # Read the structures. + structure.read_pdb('1J7O_1st_NH.pdb', dir=BASE_PATH, set_mol_name='N-dom') + structure.read_pdb('1J7P_1st_NH_rot.pdb', dir=BASE_PATH, set_mol_name='C-dom') + + # Load the spins. + structure.load_spins('@N') + structure.load_spins('@H') + + # Load the NH vectors. + structure.vectors(spin_id='@N', attached='H', ave=False) + + # Set the values needed to calculate the dipolar constant. + value.set(1.041 * 1e-10, 'r', spin_id="@N") + value.set('15N', 'heteronuc_type', spin_id="@N") + value.set('1H', 'proton_type', spin_id="@N") + + # Loop over the alignments. + ln = ['dy', 'tb', 'tm', 'er'] + for i in range(len(ln)): + # Load the RDCs. + rdc.read(align_id=ln[i], file='rdc_%s.txt'%ln[i], dir=DATA_PATH, res_num_col=2, spin_name_col=5, data_col=6, error_col=7) + + # The PCS. + pcs.read(align_id=ln[i], file='pcs_%s.txt'%ln[i], dir=DATA_PATH, res_num_col=2, spin_name_col=5, data_col=6, error_col=7) + + # The temperature and field strength. + temperature(id=ln[i], temp=303) + frq.set(id=ln[i], frq=900e6) + + # Load the N-domain tensors (the full tensors). + script(BASE_PATH + 'tensors.py') + + # Define the domains. + domain(id='N', spin_id=":1-78") + domain(id='C', spin_id=":80-144") # The tensor domains and reductions. full = ['Dy N-dom', 'Tb N-dom', 'Tm N-dom', 'Er N-dom'] red = ['Dy C-dom', 'Tb C-dom', 'Tm C-dom', 'Er C-dom'] for i in range(len(full)): + # Initalise the reduced tensor. + align_tensor.init(tensor=red[i], params=(0,0,0,0,0)) + + # Set the domain info. align_tensor.set_domain(tensor=full[i], domain='N') align_tensor.set_domain(tensor=red[i], domain='C') + + # Specify which tensor is reduced. align_tensor.reduction(full_tensor=full[i], red_tensor=red[i]) # Select the model. @@ -63,17 +98,32 @@ # Set the reference domain. frame_order.ref_domain('N') + # The pivot point. + pivot = array([ 37.254, 0.5, 16.7465]) + frame_order.pivot(pivot, fix=True) + + # Set the paramagnetic centre. + paramag.centre(pos=[35.934, 12.194, -4.206]) + + # Check the minimum. + cdp.ave_pos_beta = 1.1838868514111507 + cdp.ave_pos_gamma = 0.35219976958846927 + cdp.axis_theta = 2.1815126749944502 + cdp.axis_phi = 0.89068285262982982 + calc() + print("\nchi2: %s" % cdp.chi2) + # Optimise. - grid_search(inc=11) - minimise('simplex', constraints=False) + #grid_search(inc=11) + #minimise('simplex', constraints=False) - # Test Monte Carlo simulations. - monte_carlo.setup(number=3) - monte_carlo.create_data() - monte_carlo.initial_values() - minimise('simplex', constraints=False) - eliminate() - monte_carlo.error_analysis() + ## Test Monte Carlo simulations. + #monte_carlo.setup(number=3) + #monte_carlo.create_data() + #monte_carlo.initial_values() + #minimise('simplex', constraints=False) + #eliminate() + #monte_carlo.error_analysis() # Write the results. results.write('devnull', dir=None, force=True) @@ -86,7 +136,7 @@ pipe.create(pipe_name='orig pos', pipe_type='frame order') # Load the structure. - structure.read_pdb(DATA_PATH+'1J7P_1st_NH.pdb') + structure.read_pdb(BASE_PATH+'1J7P_1st_NH.pdb') # Store the centre of mass. cdp.CoM = centre_of_mass() @@ -99,7 +149,7 @@ pipe.create(pipe_name='ave pos', pipe_type='frame order') # Load the structure. - structure.read_pdb(DATA_PATH+'1J7P_1st_NH_rot.pdb') + structure.read_pdb(BASE_PATH+'1J7P_1st_NH_rot.pdb') # Rotate all atoms. structure.rotate(R=R, origin=pivot)