Author: bugman
Date: Thu Jan 22 19:55:49 2015
New Revision: 27280

URL: http://svn.gna.org/viewcvs/relax?rev=27280&view=rev
Log:
Created the Test_align_protein.test_align_pairwise_PAM250 unit test.

This is in the unit test module _lib._sequence_alignment.test_align_protein.  
It check the protein
alignment function lib.sequence_alignment.align_protein.align_pairwise() 
together with the PAM250
substitution matrix.


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=27280&r1=27279&r2=27280&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 22 19:55:49 2015
@@ -79,3 +79,56 @@
         for i in range(2):
             for j in range(68):
                 self.assertEqual(gaps[i, j], real_gaps[i][j])
+
+
+    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])


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits

Reply via email to