commit/galaxy-central: jgoecks: Fixes for commit 4317a15.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/c7bd5efd3e31/ Changeset: c7bd5efd3e31 User: jgoecks Date: 2013-04-04 17:39:32 Summary: Fixes for commit 4317a15. Affected #: 1 file diff -r aad18e2fd35d0d323b8fe01d321dbb8a65bcc740 -r c7bd5efd3e3140a1ad0de22bf3a02e4ef8e4a948 lib/galaxy/visualization/data_providers/genome.py --- a/lib/galaxy/visualization/data_providers/genome.py +++ b/lib/galaxy/visualization/data_providers/genome.py @@ -981,15 +981,24 @@ if op == 0: # Match # Transform Ms to =s and Xs. new_op = [] - while read_pos < op_len: + total_count = 0 + while total_count < op_len and ref_seq_pos < len( ref_seq ): match, count = counter( read_seq, read_pos, ref_seq, ref_seq_pos ) + # Use min because count cannot exceed remainder of operation. + count = min( count, op_len - total_count ) if match: new_op = 7 else: new_op = 8 + new_cigar.append( ( new_op, count ) ) + total_count += count read_pos += count ref_seq_pos += count - new_cigar.append( ( new_op, count ) ) + + # If part of read falls outside of ref_seq dat, then leave + # part as M. + if total_count < op_len: + new_cigar.append( ( 0, op_len - total_count ) ) elif op == 1: # Insertion new_cigar.append( op_tuple ) elif op in [ 2, 3, 5, 6 ]: # Deletion, Skip, Soft Clipping or Padding Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org