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


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

This is the relax-commits mailing list
[email protected]

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