Author: bugman Date: Mon Mar 4 16:01:12 2013 New Revision: 18617 URL: http://svn.gna.org/viewcvs/relax?rev=18617&view=rev Log: Simplified the rigid frame order model displacement testing script. Modified: branches/frame_order_testing/test_suite/shared_data/frame_order/displacements/rigid_test.py Modified: branches/frame_order_testing/test_suite/shared_data/frame_order/displacements/rigid_test.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/test_suite/shared_data/frame_order/displacements/rigid_test.py?rev=18617&r1=18616&r2=18617&view=diff ============================================================================== --- branches/frame_order_testing/test_suite/shared_data/frame_order/displacements/rigid_test.py (original) +++ branches/frame_order_testing/test_suite/shared_data/frame_order/displacements/rigid_test.py Mon Mar 4 16:01:12 2013 @@ -28,61 +28,10 @@ # Python module imports. from numpy import array, float64 -from time import asctime, localtime - -# relax module imports. -from auto_analyses.frame_order import Frame_order_analysis -# Analysis variables. -##################### - -# The grid search size (the number of increments per dimension). -GRID_INC = 11 - -# The more precise grid search size for the initial rigid model (the number of increments per dimension). -GRID_INC_RIGID = 31 - -# The number of Sobol' points for the PCS numerical integration in the grid searches. -NUM_INT_PTS_GRID = 50 - -# The list of the number of Sobol' points for the PCS numerical integration to use iteratively in the optimisations after the grid search (for the PCS data subset). -NUM_INT_PTS_SUBSET = [100] - -# The minimisation function tolerance cutoff to terminate optimisation (for the PCS data subset, see the minimise user function). -FUNC_TOL_SUBSET = [1e-2] - -# The list of the number of Sobol' points for the PCS numerical integration to use iteratively in the optimisations after the grid search (for all PCS and RDC data). -NUM_INT_PTS_FULL = [100, 1000, 10000] - -# The minimisation function tolerance cutoff to terminate optimisation (for all PCS and RDC data, see the minimise user function). -FUNC_TOL_FULL = [1e-2, 1e-3, 1e-4] - -# The optimisation technique. -MIN_ALGOR = 'simplex' - -# The number of Monte Carlo simulations to be used for error analysis at the end of the protocol. -MC_NUM = 100 - -# The number of Sobol' points for the PCS numerical integration during Monte Carlo simulations. -MC_INT_PTS = 100 - -# The minimisation function tolerance cutoff to terminate optimisation during Monte Carlo simulations. -MC_FUNC_TOL = 1e-2 - -# The frame order models to use. -MODELS = ['rigid'] - - -# Set up the base data pipes. -############################# - -# The data pipe bundle to group all data pipes. -PIPE_BUNDLE = "Frame Order (%s)" % asctime(localtime()) - -# Create the base data pipe containing only a subset of the PCS data. -SUBSET = "Data subset - " + PIPE_BUNDLE -pipe.create(pipe_name=SUBSET, pipe_type='frame order', bundle=PIPE_BUNDLE) +# Create the data pipe. +pipe.create(pipe_name='rigid test', pipe_type='frame order') # Read the structures. structure.read_pdb('displaced.pdb', set_mol_name='fancy_mol') @@ -107,7 +56,6 @@ 'pcs_yb.txt', 'pcs_ho.txt' ] -pcs_files_subset = pcs_files rdc_files = [ 'rdc_dy.txt', 'rdc_tb.txt', @@ -123,7 +71,7 @@ rdc.read(align_id=ln[i], file=rdc_files[i], dir='.', spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=4) # The PCS (only a subset of ~5 spins for fast initial optimisations). - pcs.read(align_id=ln[i], file=pcs_files_subset[i], dir='.', mol_name_col=1, res_num_col=2, spin_name_col=5, data_col=6, error_col=7) + pcs.read(align_id=ln[i], file=pcs_files[i], dir='.', mol_name_col=1, 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.0) @@ -170,21 +118,15 @@ # Allow the average domain to be translated during optimisation. frame_order.ave_pos_translate() -# Set the initial pivot point. -pivot = array([ 0, 0, 0], float64) +# Set the initial pivot point (should make no difference for the rigid model). +pivot = array([0, 0, 0], float64) frame_order.pivot(pivot, fix=True) # Set the paramagnetic centre position. paramag.centre(pos=[-5, -7, -9]) -# Duplicate the PCS data subset data pipe to create a data pipe containing all the PCS data. -DATA = "Data - " + PIPE_BUNDLE -pipe.copy(pipe_from=SUBSET, pipe_to=DATA, bundle_to=PIPE_BUNDLE) -pipe.switch(DATA) - -# Load the complete PCS data into the already filled data pipe. -for i in range(len(ln)): - pcs.read(align_id=ln[i], file=pcs_files[i], mol_name_col=1, res_num_col=2, spin_name_col=5, data_col=6, error_col=7) +# Select the Frame Order model. +frame_order.select_model(model='rigid') # Set the real parameter values. cdp.ave_pos_x = -1 @@ -194,9 +136,8 @@ cdp.ave_pos_beta = 2.0 cdp.ave_pos_gamma = 2.14159265359 +# Calculate the chi2 value. +calc() -# Execution. -############ - -# Do not change! -Frame_order_analysis(data_pipe_full=DATA, data_pipe_subset=SUBSET, pipe_bundle=PIPE_BUNDLE, grid_inc=GRID_INC, grid_inc_rigid=GRID_INC_RIGID, min_algor=MIN_ALGOR, num_int_pts_grid=NUM_INT_PTS_GRID, num_int_pts_subset=NUM_INT_PTS_SUBSET, func_tol_subset=FUNC_TOL_SUBSET, num_int_pts_full=NUM_INT_PTS_FULL, func_tol_full=FUNC_TOL_FULL, mc_sim_num=MC_NUM, mc_int_pts=MC_INT_PTS, mc_func_tol=MC_FUNC_TOL, models=MODELS) +# Attempt to mimimise. +minimise('simplex', constraints=False)