mailr27371 - /trunk/lib/sequence_alignment/msa.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 - 19:18:
Author: bugman
Date: Thu Jan 29 19:18:23 2015
New Revision: 27371

URL: http://svn.gna.org/viewcvs/relax?rev=27371&view=rev
Log:
Improvement for the lib.sequence_alignment.msa.central_star() function.

The strings and gap matrix returned by the function have been reordered to 
match the input
sequences.


Modified:
    trunk/lib/sequence_alignment/msa.py

Modified: trunk/lib/sequence_alignment/msa.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/sequence_alignment/msa.py?rev=27371&r1=27370&r2=27371&view=diff
==============================================================================
--- trunk/lib/sequence_alignment/msa.py (original)
+++ trunk/lib/sequence_alignment/msa.py Thu Jan 29 19:18:23 2015
@@ -141,12 +141,19 @@
     # Rebuild the alignment lists and create a gap matrix.
     strings = []
     M = len(Sc_prime)
-    gaps = zeros((N, M), int16)
     strings.append(Sc_prime)
     for i in range(N-1):
         strings.append(''.join(string_lists[i]))
     for i in range(N):
         strings[i] = strings[i].replace('X', '-')
+
+    # Restore the original sequence ordering.
+    string = strings.pop(0)
+    strings.insert(Sc_index, string)
+
+    # Create the gap matrix.
+    gaps = zeros((N, M), int16)
+    for i in range(N):
         for j in range(M):
             if strings[i][j] == '-':
                 gaps[i, j] = 1




Related Messages


Powered by MHonArc, Updated Thu Jan 29 19:20:02 2015