scripts/last-dotplot
changeset 938 65969d4d464d
parent 937 8a4fadbe6080
child 941 f3f1ec72542f
     1.1 --- a/scripts/last-dotplot	Mon May 14 11:42:55 2018 +0900
     1.2 +++ b/scripts/last-dotplot	Mon May 14 14:15:33 2018 +0900
     1.3 @@ -18,8 +18,15 @@
     1.4  import itertools, optparse, os, re, sys
     1.5  
     1.6  # Try to make PIL/PILLOW work:
     1.7 -try: from PIL import Image, ImageDraw, ImageFont, ImageColor
     1.8 -except ImportError: import Image, ImageDraw, ImageFont, ImageColor
     1.9 +try:
    1.10 +    from PIL import Image, ImageDraw, ImageFont, ImageColor
    1.11 +except ImportError:
    1.12 +    import Image, ImageDraw, ImageFont, ImageColor
    1.13 +
    1.14 +try:
    1.15 +    from future_builtins import zip
    1.16 +except ImportError:
    1.17 +    pass
    1.18  
    1.19  def myOpen(fileName):  # faster than fileinput
    1.20      if fileName is None:
    1.21 @@ -75,7 +82,7 @@
    1.22  def mafBlocks(beg1, beg2, seq1, seq2):
    1.23      '''Get the gapless blocks of an alignment, from MAF format.'''
    1.24      size = 0
    1.25 -    for x, y in itertools.izip(seq1, seq2):
    1.26 +    for x, y in zip(seq1, seq2):
    1.27          if x == "-":
    1.28              if size:
    1.29                  yield beg1, beg2, size