mailr14875 - in /1.3/test_suite: shared_data/align_data/tb.txt system_tests/__init__.py system_tests/rdc.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on October 17, 2011 - 18:31:
Author: bugman
Date: Mon Oct 17 18:31:38 2011
New Revision: 14875

URL: http://svn.gna.org/viewcvs/relax?rev=14875&view=rev
Log:
Created a system test with RDC data for loading RDCs from a file with spin ID 
strings at the start.


Added:
    1.3/test_suite/shared_data/align_data/tb.txt   (with props)
    1.3/test_suite/system_tests/rdc.py
Modified:
    1.3/test_suite/system_tests/__init__.py

Added: 1.3/test_suite/shared_data/align_data/tb.txt
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/shared_data/align_data/tb.txt?rev=14875&view=auto
==============================================================================
--- 1.3/test_suite/shared_data/align_data/tb.txt (added)
+++ 1.3/test_suite/shared_data/align_data/tb.txt Mon Oct 17 18:31:38 2011
@@ -1,0 +1,10 @@
+
+# spin_id               RDCs                 RDC_error           
+#CaM:5&:THR@3&@N              -26.2501958629                  1.0
+#CaM:6&:GLU@5&@N               9.93081766942                  1.0
+#CaM:7&:GLU@7&@N               7.26317614156                  1.0
+#CaM:8&:GLN@9&@N              -1.24840526981                 None
+#CaM:9&:ILE@11&@N              5.31803314334                  1.0
+#CaM:10&:ALA@13&@N             14.0362909456                  1.0
+#CaM:11&:GLU@15&@N             1.33652530397                 None
+#CaM:12&:PHE@17&@N             -1.6021670281                 None

Propchange: 1.3/test_suite/shared_data/align_data/tb.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 1.3/test_suite/system_tests/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/__init__.py?rev=14875&r1=14874&r2=14875&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/__init__.py (original)
+++ 1.3/test_suite/system_tests/__init__.py Mon Oct 17 18:31:38 2011
@@ -50,6 +50,7 @@
 from pdc import Pdc
 from peak_lists import Peak_lists
 from pipes import Pipes
+from rdc import Rdc
 from relax_data import Relax_data
 from relax_fit import Relax_fit
 from results import Results
@@ -81,6 +82,7 @@
            'pdc',
            'peak_lists'
            'pipes',
+           'rdc',
            'relax_data',
            'relax_fit',
            'results',
@@ -149,6 +151,7 @@
             suite_array.append(TestLoader().loadTestsFromTestCase(Pdc))
             
suite_array.append(TestLoader().loadTestsFromTestCase(Peak_lists))
             suite_array.append(TestLoader().loadTestsFromTestCase(Pipes))
+            suite_array.append(TestLoader().loadTestsFromTestCase(Rdc))
             
suite_array.append(TestLoader().loadTestsFromTestCase(Relax_data))
             suite_array.append(TestLoader().loadTestsFromTestCase(Relax_fit))
             suite_array.append(TestLoader().loadTestsFromTestCase(Results))

Added: 1.3/test_suite/system_tests/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/rdc.py?rev=14875&view=auto
==============================================================================
--- 1.3/test_suite/system_tests/rdc.py (added)
+++ 1.3/test_suite/system_tests/rdc.py Mon Oct 17 18:31:38 2011
@@ -1,0 +1,63 @@
+###############################################################################
+#                                                                            
 #
+# Copyright (C) 2011 Edward d'Auvergne                                       
 #
+#                                                                            
 #
+# This file is part of the program relax.                                    
 #
+#                                                                            
 #
+# relax is free software; you can redistribute it and/or modify              
 #
+# it under the terms of the GNU General Public License as published by       
 #
+# the Free Software Foundation; either version 2 of the License, or          
 #
+# (at your option) any later version.                                        
 #
+#                                                                            
 #
+# relax is distributed in the hope that it will be useful,                   
 #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of             
 #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              
 #
+# GNU General Public License for more details.                               
 #
+#                                                                            
 #
+# You should have received a copy of the GNU General Public License          
 #
+# along with relax; if not, write to the Free Software                       
 #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
 #
+#                                                                            
 #
+###############################################################################
+
+# Module docstring.
+"""RDC-based system tests."""
+
+
+# Python module imports.
+from os import sep
+
+# relax module imports.
+from base_classes import SystemTestCase
+from generic_fns.mol_res_spin import count_spins, spin_loop
+from status import Status; status = Status()
+
+
+class Rdc(SystemTestCase):
+    """Class for testing RDC operations."""
+
+    def test_rdc_load(self):
+        """Test for the loading of some RDC data with the spin ID format."""
+
+        # Create a data pipe.
+        self.interpreter.pipe.create('test', 'N-state')
+
+        # Data directory.
+        dir = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'align_data'+sep
+
+        # Load the spins.
+        self.interpreter.sequence.read(file='tb.txt', dir=dir, spin_id_col=1)
+
+        # Load the RDCs.
+        self.interpreter.rdc.read(align_id='tb', file='tb.txt', dir=dir, 
spin_id_col=1, data_col=2, error_col=3)
+
+        # The RDCs.
+        rdcs = [ -26.2501958629, 9.93081766942, 7.26317614156, 
-1.24840526981, 5.31803314334, 14.0362909456, 1.33652530397, -1.6021670281]
+
+        # Checks.
+        self.assertEqual(count_spins(), 8)
+        i = 0
+        for spin in spin_loop():
+            self.assertAlmostEqual(rdcs[i], spin.rdc['tb'])
+            i += 1
+




Related Messages


Powered by MHonArc, Updated Tue Oct 18 09:00:02 2011