mailr27357 - /trunk/test_suite/unit_tests/_lib/_sequence_alignment/test_align_protein.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 - 15:52:
Author: bugman
Date: Thu Jan 29 15:52:16 2015
New Revision: 27357

URL: http://svn.gna.org/viewcvs/relax?rev=27357&view=rev
Log:
Fixes for the unit tests of the _lib._sequence_alignment.test_align_protein 
module.

The Test_align_protein.test_align_pairwise_PAM250 unit test was accidentally 
duplicated due to a
copy and paste error.  And the 
lib.sequence_alignment.align_protein.align_pairwise() function now
also returns the alignment score.


Modified:
    trunk/test_suite/unit_tests/_lib/_sequence_alignment/test_align_protein.py

Modified: 
trunk/test_suite/unit_tests/_lib/_sequence_alignment/test_align_protein.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/unit_tests/_lib/_sequence_alignment/test_align_protein.py?rev=27357&r1=27356&r2=27357&view=diff
==============================================================================
--- 
trunk/test_suite/unit_tests/_lib/_sequence_alignment/test_align_protein.py  
(original)
+++ 
trunk/test_suite/unit_tests/_lib/_sequence_alignment/test_align_protein.py  
Thu Jan 29 15:52:16 2015
@@ -30,57 +30,6 @@
 class Test_align_protein(TestCase):
     """Unit tests for the lib.sequence_alignment.align_protein relax 
module."""
 
-    def test_align_pairwise_PAM250(self):
-        """Test the Needleman-Wunsch sequence alignment for two protein 
sequences using the PAM250 substitution matrix.
-
-        This uses the sequences:
-
-            - 
'IHAAEEKDWKTAYSYbgFYEAFEGYdsidspkaitslkymllckimlntpedvqalvsgkla',
-            - 
'LHAADEKDFKTAFSYabiggapFYEAFEGYdsvdekvsaltalkymllckvmldlpdevnsllsakl'.
-
-        From online servers, the results with a gap open penalty of 5 and 
gap extend of 0.5 should be::
-
-            https://www.ebi.ac.uk/Tools/psa/emboss_needle/
-            EMBOSS_001          
IHAAEEKDWKTAYSYb--g---FYEAFEGYdsidspk--aitslkymllckimlntpedvqalvsgkla
-                                :|||:|||.|||:||.  |   ||||||||||:|. |  
|:|:||||||||:||:.|::|::|:|:|| 
-            EMBOSS_001          
LHAADEKDFKTAFSYabiggapFYEAFEGYdsvde-kvsaltalkymllckvmldlpdevnsllsakl-
-
-            http://web.expasy.org/cgi-bin/sim/sim.pl?prot
-            UserSeq1            
IHAAEEKDWKTAYSYBG-----FYEAFEGYDSIDSPK--AITSLKYMLLCKIMLNTPEDVQALVSGKL
-            UserSeq2            
LHAADEKDFKTAFSYABIGGAPFYEAFEGYDSVDE-KVSALTALKYMLLCKVMLDLPDEVNSLLSAKL
-                                 *** *** *** **       ********** *  *  * * 
******** **  *  *  * * **
-        """
-
-        # The sequences.
-        seq1 = 
'IHAAEEKDWKTAYSYbgFYEAFEGYdsidspkaitslkymllckimlntpedvqalvsgkla'
-        seq2 = 
'LHAADEKDFKTAFSYabiggapFYEAFEGYdsvdekvsaltalkymllckvmldlpdevnsllsakl'
-        print(seq1)
-        print(seq2)
-
-        # Perform the alignment.
-        align1, align2, gaps = align_pairwise(seq1, seq2, matrix='PAM250', 
gap_open_penalty=5.0, gap_extend_penalty=0.5)
-        print(align1)
-        print(align2)
-        print(gaps)
-
-        # Check the alignment.
-        self.assertEqual(align1, 
'IHAAEEKDWKTAYSYB--G---FYEAFEGYDSIDSPK--AITSLKYMLLCKIMLNTPEDVQALVSGKLA')
-        self.assertEqual(align2, 
'LHAADEKDFKTAFSYABIGGAPFYEAFEGYDSVDE-KVSALTALKYMLLCKVMLDLPDEVNSLLSAKL-')
-
-        # The gap matrix.
-        real_gaps = zeros((2, 69), int16)
-        real_gaps[0, 16] = 1
-        real_gaps[0, 17] = 1
-        real_gaps[0, 19] = 1
-        real_gaps[0, 20] = 1
-        real_gaps[0, 21] = 1
-        real_gaps[0, 37] = 1
-        real_gaps[0, 38] = 1
-        real_gaps[1, 35] = 1
-        real_gaps[1, 68] = 1
-        for i in range(2):
-            for j in range(68):
-                self.assertEqual(gaps[i, j], real_gaps[i][j])
     def test_align_pairwise(self):
         """Test the Needleman-Wunsch sequence alignment for two protein 
sequences.
 
@@ -109,7 +58,8 @@
         print(seq2)
 
         # Perform the alignment.
-        align1, align2, gaps = align_pairwise(seq1, seq2, matrix='BLOSUM62', 
gap_open_penalty=5.0, gap_extend_penalty=1.0)
+        score, align1, align2, gaps = align_pairwise(seq1, seq2, 
matrix='BLOSUM62', gap_open_penalty=5.0, gap_extend_penalty=1.0)
+        print(score)
         print(align1)
         print(align2)
         print(gaps)
@@ -160,7 +110,8 @@
         print(seq2)
 
         # Perform the alignment.
-        align1, align2, gaps = align_pairwise(seq1, seq2, matrix='PAM250', 
gap_open_penalty=5.0, gap_extend_penalty=0.5)
+        score, align1, align2, gaps = align_pairwise(seq1, seq2, 
matrix='PAM250', gap_open_penalty=5.0, gap_extend_penalty=0.5)
+        print(score)
         print(align1)
         print(align2)
         print(gaps)




Related Messages


Powered by MHonArc, Updated Thu Jan 29 16:00:02 2015