Author: bugman Date: Mon Aug 6 13:28:05 2007 New Revision: 3352 URL: http://svn.gna.org/viewcvs/relax?rev=3352&view=rev Log: Application of Sebastien Morin's patch creating the N15_CSA and NH_BOND_LENGTH constants. For the patch, see the post at https://mail.gna.org/public/relax-devel/2007-07/msg00060.html. The patch 'patch__default_csa_r__l1.3_r3351' makes uniform the use of the CSA value (now -172 ppm everywhere) and fixes the test-suite (in jw_mapping) to account for this change. It also adds two constants for the CSA and NH bond length default values. Modified: 1.3/physical_constants.py 1.3/prompt/value.py 1.3/specific_fns/jw_mapping.py 1.3/test_suite/system_tests/jw_mapping.py 1.3/test_suite/system_tests/model_free.py Modified: 1.3/physical_constants.py URL: http://svn.gna.org/viewcvs/relax/1.3/physical_constants.py?rev=3352&r1=3351&r2=3352&view=diff ============================================================================== --- 1.3/physical_constants.py (original) +++ 1.3/physical_constants.py Mon Aug 6 13:28:05 2007 @@ -32,3 +32,10 @@ # The magnetic constant or the permeability of vacuum. mu0 = 4.0 * pi * 1e-7 + +# The 15N CSA in the NH bond (default value). +N15_CSA = -172 * 1e-6 + +# The length of the NH bond (default value). +NH_BOND_LENGTH = 1.02 * 1e-10 + Modified: 1.3/prompt/value.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/value.py?rev=3352&r1=3351&r2=3352&view=diff ============================================================================== --- 1.3/prompt/value.py (original) +++ 1.3/prompt/value.py Mon Aug 6 13:28:05 2007 @@ -345,10 +345,10 @@ To set the CSA value of all residues in the reduced spectral density mapping run '600MHz' to - -170 ppm, type: - - relax> value.set('600MHz', -170 * 1e-6, 'csa') - relax> value.set('600MHz', value=-170 * 1e-6, param='csa') + -172 ppm, type: + + relax> value.set('600MHz', -172 * 1e-6, 'csa') + relax> value.set('600MHz', value=-172 * 1e-6, param='csa') To set the NH bond length of all residues in the model-free run 'm5' to 1.02 Angstroms, Modified: 1.3/specific_fns/jw_mapping.py URL: http://svn.gna.org/viewcvs/relax/1.3/specific_fns/jw_mapping.py?rev=3352&r1=3351&r2=3352&view=diff ============================================================================== --- 1.3/specific_fns/jw_mapping.py (original) +++ 1.3/specific_fns/jw_mapping.py Mon Aug 6 13:28:05 2007 @@ -29,6 +29,7 @@ from base_class import Common_functions from maths_fns.jw_mapping import Mapping from relax_errors import RelaxError, RelaxFuncSetupError, RelaxNoRunError, RelaxNoSequenceError, RelaxNoValueError, RelaxNucleusError +from physical_constants import N15_CSA, NH_BOND_LENGTH # The relax data storage object. @@ -208,6 +209,7 @@ """ Reduced spectral density mapping default values ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + These default values are found in the file 'physical_constants.py'. _______________________________________________________________________________________ | | | | @@ -216,18 +218,18 @@ | | | | | Bond length | 'r' | 1.02 * 1e-10 | | | | | - | CSA | 'csa' | -170 * 1e-6 | + | CSA | 'csa' | -172 * 1e-6 | |_______________________________________|______________|______________________________| """ # Bond length. if param == 'r': - return 1.02 * 1e-10 + return NH_BOND_LENGTH # CSA. if param == 'CSA': - return -170 * 1e-6 + return N15_CSA def num_instances(self, run=None): Modified: 1.3/test_suite/system_tests/jw_mapping.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/jw_mapping.py?rev=3352&r1=3351&r2=3352&view=diff ============================================================================== --- 1.3/test_suite/system_tests/jw_mapping.py (original) +++ 1.3/test_suite/system_tests/jw_mapping.py Mon Aug 6 13:28:05 2007 @@ -25,7 +25,7 @@ # relax module imports. from data import Data as relax_data_store - +from physical_constants import N15_CSA, NH_BOND_LENGTH # The relax data storage object. @@ -76,8 +76,8 @@ def calc_integrity(self): # Correct jw values: - j0 = [4.0958793960056238e-09, 3.7976266046729745e-09] - jwx = [1.85720953886864e-10, 1.6450121628270092e-10] + j0 = [4.0703318681008998e-09, 3.7739393907014834e-09] + jwx = [1.8456254300773903e-10, 1.6347516082378241e-10] jwh = [1.5598167512718012e-12, 2.9480536599037041e-12] # Loop over residues. @@ -135,8 +135,8 @@ self.relax.interpreter._Nuclei.nuclei('N') # Set r and csa. - self.relax.interpreter._Value.set(self.run, 1.02 * 1e-10, 'bond_length') - self.relax.interpreter._Value.set(self.run, -170 * 1e-6, 'csa') + self.relax.interpreter._Value.set(self.run, NH_BOND_LENGTH, 'bond_length') + self.relax.interpreter._Value.set(self.run, N15_CSA, 'csa') # Select the frequency. self.relax.interpreter._Jw_mapping.set_frq(self.run, frq=600.0 * 1e6) @@ -155,8 +155,8 @@ self.relax.interpreter._Sequence.read(self.run, file='test_seq', dir=sys.path[-1] + '/test_suite/system_tests/data') # Try to set the values. - bond_length = 1.02 * 1e-10 - csa = -170 * 1e-6 + bond_length = NH_BOND_LENGTH + csa = N15_CSA self.relax.interpreter._Value.set(self.run, bond_length, 'bond_length') self.relax.interpreter._Value.set(self.run, csa, 'csa') Modified: 1.3/test_suite/system_tests/model_free.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/model_free.py?rev=3352&r1=3351&r2=3352&view=diff ============================================================================== --- 1.3/test_suite/system_tests/model_free.py (original) +++ 1.3/test_suite/system_tests/model_free.py Mon Aug 6 13:28:05 2007 @@ -26,6 +26,7 @@ # relax module imports. from data import Data as relax_data_store +from physical_constants import N15_CSA, NH_BOND_LENGTH # The relax data storage object. @@ -260,7 +261,7 @@ # Setup other values. self.relax.interpreter._Diffusion_tensor.init(self.run, 1e-8, fixed=1) - self.relax.interpreter._Value.set(self.run, [-170 * 1e-6, 1.02 * 1e-10], ['csa', 'bond_length']) + self.relax.interpreter._Value.set(self.run, [N15_CSA, NH_BOND_LENGTH], ['csa', 'bond_length']) # Select the model. self.relax.interpreter._Model_free.select_model(self.run, model='m4') @@ -303,7 +304,7 @@ # Setup other values. self.relax.interpreter._Diffusion_tensor.init(self.run, (1.601 * 1e7, 1.34, 72.4, 90-77.9), param_types=4) - self.relax.interpreter._Value.set(self.run, [-170 * 1e-6, 1.02 * 1e-10], ['csa', 'bond_length']) + self.relax.interpreter._Value.set(self.run, [N15_CSA, NH_BOND_LENGTH], ['csa', 'bond_length']) self.relax.interpreter._Value.set(self.run, [0.8, 50 * 1e-12, 0.0], ['S2', 'te', 'Rex']) # Select the model. @@ -342,7 +343,7 @@ self.relax.interpreter._Relax_data.read(self.run, 'NOE', '500', 500.0 * 1e6, 'noe.500.out', dir=path) # Setup other values. - self.relax.interpreter._Value.set(self.run, [-170 * 1e-6, 1.02 * 1e-10], ['csa', 'bond_length']) + self.relax.interpreter._Value.set(self.run, [N15_CSA, NH_BOND_LENGTH], ['csa', 'bond_length']) # Select the model. self.relax.interpreter._Model_free.select_model(self.run, model='tm2') @@ -930,7 +931,7 @@ # Setup other values. self.relax.interpreter._Diffusion_tensor.init(self.run, 10e-9, fixed=1) - self.relax.interpreter._Value.set(self.run, 1.02 * 1e-10, 'bond_length') + self.relax.interpreter._Value.set(self.run, NH_BOND_LENGTH, 'bond_length') self.relax.interpreter._Value.set(self.run, -160 * 1e-6, 'csa') # Select the model-free model. @@ -1198,10 +1199,10 @@ self.relax.interpreter._Sequence.read(self.run, file='noe.500.out', dir=path) # Set the CSA value. - self.relax.interpreter._Value.set(self.run, 1.02 * 1e-10, 'bond_length') + self.relax.interpreter._Value.set(self.run, NH_BOND_LENGTH, 'bond_length') # Test the value. - if relax_data_store.res[self.run][1].r != 1.02 * 1e-10: + if relax_data_store.res[self.run][1].r != NH_BOND_LENGTH: print "The bond length has not been set correctly." return @@ -1224,10 +1225,10 @@ self.relax.interpreter._Sequence.read(self.run, file='noe.500.out', dir=path) # Set the CSA value. - self.relax.interpreter._Value.set(self.run, -170 * 1e-6, 'csa') + self.relax.interpreter._Value.set(self.run, N15_CSA, 'csa') # Test the value. - if relax_data_store.res[self.run][1].csa != -170*1e-6: + if relax_data_store.res[self.run][1].csa != N15_CSA: print "The CSA value has not been set correctly." return @@ -1250,15 +1251,15 @@ self.relax.interpreter._Sequence.read(self.run, file='noe.500.out', dir=path) # Set the CSA value and bond length simultaneously. - self.relax.interpreter._Value.set(self.run, [-170 * 1e-6, 1.02 * 1e-10], ['csa', 'bond_length']) + self.relax.interpreter._Value.set(self.run, [N15_CSA, NH_BOND_LENGTH], ['csa', 'bond_length']) # Test the CSA value. - if relax_data_store.res[self.run][1].csa != -170*1e-6: + if relax_data_store.res[self.run][1].csa != N15_CSA: print "The CSA value has not been set correctly." return # Test the bond length. - if relax_data_store.res[self.run][1].r != 1.02 * 1e-10: + if relax_data_store.res[self.run][1].r != NH_BOND_LENGTH: print "The bond length has not been set correctly." return