Author: bugman Date: Tue Feb 4 15:29:24 2014 New Revision: 22115 URL: http://svn.gna.org/viewcvs/relax?rev=22115&view=rev Log: Created the Noe.test_bug_21591_noe_calculation_fail system test. This is to catch bug #21591 (https://gna.org/bugs/?21591) submitted by Martin Ballaschk (https://gna.org/users/mab). This is the complete failure of the NOE analysis. The peak lists attached to the bug report have been included in the test suite to create the system test. Added: trunk/test_suite/shared_data/peak_lists/noe.140109.8.001.list trunk/test_suite/shared_data/peak_lists/noe.140109.8.002.list Modified: trunk/test_suite/system_tests/noe.py Added: trunk/test_suite/shared_data/peak_lists/noe.140109.8.001.list URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/shared_data/peak_lists/noe.140109.8.001.list?rev=22115&view=auto ============================================================================== --- trunk/test_suite/shared_data/peak_lists/noe.140109.8.001.list (added) +++ trunk/test_suite/shared_data/peak_lists/noe.140109.8.001.list Tue Feb 4 15:29:24 2014 @@ -1,0 +1,3 @@ + Assignment w1 w2 Data Height + + G120N-HN 101.980 9.089 7471594 Added: trunk/test_suite/shared_data/peak_lists/noe.140109.8.002.list URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/shared_data/peak_lists/noe.140109.8.002.list?rev=22115&view=auto ============================================================================== --- trunk/test_suite/shared_data/peak_lists/noe.140109.8.002.list (added) +++ trunk/test_suite/shared_data/peak_lists/noe.140109.8.002.list Tue Feb 4 15:29:24 2014 @@ -1,0 +1,3 @@ + Assignment w1 w2 Data Height + + G120N-HN 101.980 9.089 3888023 Modified: trunk/test_suite/system_tests/noe.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/noe.py?rev=22115&r1=22114&r2=22115&view=diff ============================================================================== --- trunk/test_suite/system_tests/noe.py (original) +++ trunk/test_suite/system_tests/noe.py Tue Feb 4 15:29:24 2014 @@ -62,6 +62,61 @@ "2AT7_fmf_mol1 12 PHE 150 N 0.803029108487728 0.0199040298831904 \n", "2AT7_fmf_mol1 13 ASN 170 N 0.829415981681132 0.0339996453012768 \n", "2AT7_fmf_mol1 14 LYS 184 N 0.755789564728523 0.0250941717735858 \n" + ] + + # Printout of the real and generated data. + print("\n\nThe real data:") + for i in range(len(lines)): + print(repr(data[i])) + print("\nThe generated data:") + for i in range(len(lines)): + print(repr(lines[i])) + print("\n") + + # Check each line. + for i in range(len(lines)): + self.assertEqual(data[i], lines[i]) + + + def test_bug_21591_noe_calculation_fail(self): + """Catch U{bug #21591<https://gna.org/bugs/?21591>}, the failure of the NOE analysis.""" + + # Generate the sequence. + self.interpreter.spin.create(mol_name='XYZ_mol1', res_num=120, res_name='GLY', spin_num=1865, spin_name='N') + + # Load the reference spectrum and saturated spectrum peak intensities. + path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'peak_lists' + self.interpreter.spectrum.read_intensities(file='noe.140109.8.001.list', dir=path, spectrum_id='ref_ave') + self.interpreter.spectrum.read_intensities(file='noe.140109.8.002.list', dir=path, spectrum_id='sat_ave') + + # Set the spectrum types. + self.interpreter.noe.spectrum_type('ref', 'ref_ave') + self.interpreter.noe.spectrum_type('sat', 'sat_ave') + + # Set the errors. + self.interpreter.spectrum.baseplane_rmsd(error=1.3e06, spectrum_id='ref_ave') + self.interpreter.spectrum.baseplane_rmsd(error=1.4e06, spectrum_id='sat_ave') + + # Peak intensity error analysis. + self.interpreter.spectrum.error_analysis() + + # Calculate the NOEs. + self.interpreter.calc() + + # Save the NOEs. + self.interpreter.value.write(param='noe', file=ds.tmpfile) + + # Open the NOE output file. + file = open(ds.tmpfile) + lines = file.readlines() + file.close() + + # How the file should look like. + data = [ + "# Parameter description: The NOE.\n", + "#\n", + "# mol_name res_num res_name spin_num spin_name value error \n", + "XYZ_mol1 120 GLY 1865 N 0.5203739657160172 0.20810473864150658 \n", ] # Printout of the real and generated data.