Author: bugman Date: Tue Feb 19 11:50:03 2008 New Revision: 5019 URL: http://svn.gna.org/viewcvs/relax?rev=5019&view=rev Log: Converted the diff_min.py sample script to the new relax design. Modified: 1.3/sample_scripts/diff_min.py Modified: 1.3/sample_scripts/diff_min.py URL: http://svn.gna.org/viewcvs/relax/1.3/sample_scripts/diff_min.py?rev=5019&r1=5018&r2=5019&view=diff ============================================================================== --- 1.3/sample_scripts/diff_min.py (original) +++ 1.3/sample_scripts/diff_min.py Tue Feb 19 11:50:03 2008 @@ -1,8 +1,8 @@ # Script for model-free analysis. -# Set the run names (also the names of preset model-free models). -#runs = ['m1'] -runs = ['m1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'm9'] +# Set the data pipe names (also the names of preset model-free models). +#pipes = ['m1'] +pipes = ['m1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'm9'] # Nuclei type nuclei('N') @@ -14,35 +14,35 @@ print "#####################################" print "\n\n\n" -for name in runs: - # Create the run. - run.create(name, 'mf') +for name in pipes: + # Create the data pipe. + pipe.create(name, 'mf') # Load the sequence. - sequence.read(name, 'noe.500.out') + sequence.read('noe.500.out') # Load a PDB file. - structure.read_pdb(name, 'example.pdb') + structure.read_pdb('example.pdb') # Load the relaxation data. - relax_data.read(name, 'R1', '600', 600.0 * 1e6, 'r1.600.out') - relax_data.read(name, 'R2', '600', 600.0 * 1e6, 'r2.600.out') - relax_data.read(name, 'NOE', '600', 600.0 * 1e6, 'noe.600.out') - relax_data.read(name, 'R1', '500', 500.0 * 1e6, 'r1.500.out') - relax_data.read(name, 'R2', '500', 500.0 * 1e6, 'r2.500.out') - relax_data.read(name, 'NOE', '500', 500.0 * 1e6, 'noe.500.out') + relax_data.read('R1', '600', 600.0 * 1e6, 'r1.600.out') + relax_data.read('R2', '600', 600.0 * 1e6, 'r2.600.out') + relax_data.read('NOE', '600', 600.0 * 1e6, 'noe.600.out') + relax_data.read('R1', '500', 500.0 * 1e6, 'r1.500.out') + relax_data.read('R2', '500', 500.0 * 1e6, 'r2.500.out') + relax_data.read('NOE', '500', 500.0 * 1e6, 'noe.500.out') # Setup other values. - diffusion_tensor.init(name, (1e-8, 1.0, 60, 290), param_types=1, spheroid_type='oblate', fixed=1) - value.set(name, 1.02 * 1e-10, 'bond_length') - value.set(name, -172 * 1e-6, 'csa') + diffusion_tensor.init((1e-8, 1.0, 60, 290), param_types=1, spheroid_type='oblate', fixed=1) + value.set(1.02 * 1e-10, 'bond_length') + value.set(-172 * 1e-6, 'csa') # Select the model-free model. - model_free.select_model(run=name, model=name) + model_free.select_model(model=name) # Minimise. - grid_search(name, inc=5) - minimise('newton', run=name) + grid_search(inc=5) + minimise('newton') # Minimise the diffusion tensor parameters. print "\n\n\n\n\n" @@ -51,19 +51,23 @@ print "###########################################" print "\n\n\n" -for name in runs: +# Loop over the data pipes. +for name in pipes: + # Switch to the data pipe. + pipe.switch(name) + # Unfix the diffusion tensor. - fix(name, 'diff', fixed=0) + fix('diff', fixed=0) # Fix all model-free paremeter values. - fix(name, 'all_res') + fix('all_res') # Minimise. - grid_search(name, inc=5) - minimise('newton', run=name, max_iter=5000) + grid_search(inc=5) + minimise('newton', max_iter=5000) # Write the results. - results.write(run=name, file='results', force=1) + results.write(file='results', force=1) # Save the program state. state.save('save', force=1)