mailr27345 - /trunk/test_suite/unit_tests/_lib/_structure/_internal/test_coordinates.py


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

Header


Content

Posted by edward on January 29, 2015 - 13:23:
Author: bugman
Date: Thu Jan 29 13:23:58 2015
New Revision: 27345

URL: http://svn.gna.org/viewcvs/relax?rev=27345&view=rev
Log:
Simplified the Test_coordinates.test_common_residues unit test by removing 
many residues.

This is from the _lib._structure._internal.test_coordinates unit test module.


Modified:
    trunk/test_suite/unit_tests/_lib/_structure/_internal/test_coordinates.py

Modified: 
trunk/test_suite/unit_tests/_lib/_structure/_internal/test_coordinates.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/unit_tests/_lib/_structure/_internal/test_coordinates.py?rev=27345&r1=27344&r2=27345&view=diff
==============================================================================
--- trunk/test_suite/unit_tests/_lib/_structure/_internal/test_coordinates.py 
  (original)
+++ trunk/test_suite/unit_tests/_lib/_structure/_internal/test_coordinates.py 
  Thu Jan 29 13:23:58 2015
@@ -36,30 +36,39 @@
         # The gap matrices.
         gap_matrices = [
             array([
-                [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1],
-                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0]
+                [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
             ], int16),
             array([
-                [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1],
-                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0]
+                [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1],
+                [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0]
             ], int16)
         ]
-        seq1 =     
'TEEQIAEFKEAFSLFDKDGDGTITTKELGTVMRSLGQNPTEAELQDMINEVDADG**'
-        seq2 = 
'ADQLTEEQIAEFKEAFSLFDKDGDGTITTKELGTVMRSLGQNPTEAELQDMINEVDADGNGTIDFPEFLTMMARKM**'
-        seq3 =    
'LTEEQIAEFKEAFSLFDKDGDGTITTKELGTVMRSLGQNPTEAELQDMINEVDADGNGTIDFPEFLTMMAR**'
+        seq1 =     'TEEQVDADGGT'
+        seq2 = 'ADQLTEEQVDADGNGTIDFPEFLTMMARKM'
+        seq3 =    'LTEEQMINEVDAGNGTIDFPEFLTMMAR'
 
         # Determine the common residues.
-        skip = coordinates.common_residues(gap_matrices=gap_matrices, 
one_letter_codes=[seq1, seq2, seq3])
+        skip, gapped_strings = 
coordinates.common_residues(gap_matrices=gap_matrices, 
one_letter_codes=[seq1, seq2, seq3], seq=True)
 
         # The expected skipping matrices.
         N = len(seq1)
         skip_real = [
-            [0]*N,
+            [0]*4 + [1]*4 + [0]*(N-8),
             [1]*4 + [0]*N + [1]*(len(seq2)-N-4),
             [1] + [0]*N + [1]*(len(seq3)-N-1)
         ]
+
+        # The expected gapped strings.
+        gapped_seq1 = '----TEEQ----VDA-G-GT----------------'
+        gapped_seq2 = '----TEEQ----VDA-G-GT----------------'
+        gapped_seq3 = '----TEEQMINEVDA-G-GT----------------'
+        gapped_real = [gapped_seq1, gapped_seq2, gapped_seq3]
 
         # Checks.
         for i in range(3):
             print("Sequence %i" % (i+1))
             self.assertEqual(len(skip_real[i]), len(skip[i]))
+            for j in range(len(skip_real[i])):
+                self.assertEqual(skip_real[i][j], skip[i][j])
+            #self.assertEqual(gapped_real[i], gapped_strings[i])




Related Messages


Powered by MHonArc, Updated Thu Jan 29 13:40:02 2015