scripts/last-dotplot
changeset 895 8eb06508b3ed
parent 878 20f5c97a3cfd
child 896 2238466f36bd
     1.1 --- a/scripts/last-dotplot	Tue Oct 03 18:25:07 2017 +0900
     1.2 +++ b/scripts/last-dotplot	Thu Nov 02 19:24:59 2017 +0900
     1.3 @@ -307,7 +307,7 @@
     1.4          beg = int(w[1])
     1.5          end = int(w[2])
     1.6          layer = 900
     1.7 -        color = "#ffe4ff"
     1.8 +        color = "#fbf"
     1.9          if len(w) > 4:
    1.10              if w[4] != ".":
    1.11                  layer = float(w[4])
    1.12 @@ -315,9 +315,9 @@
    1.13                  if len(w) > 8 and w[8].count(",") == 2:
    1.14                      color = "rgb(" + w[8] + ")"
    1.15                  elif w[5] == "+":
    1.16 -                    color = "#fff4f4"
    1.17 +                    color = "#ffe8e8"
    1.18                  elif w[5] == "-":
    1.19 -                    color = "#f4f4ff"
    1.20 +                    color = "#e8e8ff"
    1.21          yield layer, color, seqName, beg, end
    1.22  
    1.23  def commaSeparatedInts(text):
    1.24 @@ -363,11 +363,11 @@
    1.25          else:
    1.26              continue
    1.27          if repeatClass in ("Low_complexity", "Simple_repeat"):
    1.28 -            yield 200, "#ffe4ff", seqName, beg, end
    1.29 +            yield 200, "#fbf", seqName, beg, end
    1.30          elif strand == "+":
    1.31 -            yield 100, "#fff4f4", seqName, beg, end
    1.32 +            yield 100, "#ffe8e8", seqName, beg, end
    1.33          else:
    1.34 -            yield 100, "#f4f4ff", seqName, beg, end
    1.35 +            yield 100, "#e8e8ff", seqName, beg, end
    1.36  
    1.37  def isExtraFirstGapField(fields):
    1.38      return fields[4].isdigit()
    1.39 @@ -433,8 +433,8 @@
    1.40              nonoverlapping_labels.append(i)
    1.41      return nonoverlapping_labels
    1.42  
    1.43 -def get_axis_image(seqNames, name_sizes, seq_starts, seq_pix, textRot,
    1.44 -                   textAln, font, image_mode, opts):
    1.45 +def axisImage(seqNames, name_sizes, seq_starts, seq_pix, textRot,
    1.46 +              textAln, font, image_mode, opts):
    1.47      '''Make an image of axis labels.'''
    1.48      min_pos = seq_starts[0]
    1.49      max_pos = seq_starts[-1] + seq_pix[-1]
    1.50 @@ -445,7 +445,7 @@
    1.51      minPixTweenLabels = 0 if textRot else opts.label_space
    1.52      labels = get_nonoverlapping_labels(labels, minPixTweenLabels)
    1.53      image_size = (margin, max_pos) if textRot else (max_pos, margin)
    1.54 -    im = Image.new(image_mode, image_size, opts.border_color)
    1.55 +    im = Image.new(image_mode, image_size, opts.margin_color)
    1.56      draw = ImageDraw.Draw(im)
    1.57      for i in labels:
    1.58          base = margin - i[4] if textAln else 0
    1.59 @@ -538,12 +538,12 @@
    1.60              elif store_value == 3: im.putpixel(xy, overlap_color)
    1.61  
    1.62      if opts.fontsize != 0:
    1.63 -        axis1 = get_axis_image(seqLabels1, labelSizes1, seq_starts1, seq_pix1,
    1.64 -                               textRot1, False, font, image_mode, opts)
    1.65 +        axis1 = axisImage(seqLabels1, labelSizes1, seq_starts1, seq_pix1,
    1.66 +                          textRot1, False, font, image_mode, opts)
    1.67          if textRot1:
    1.68              axis1 = axis1.transpose(Image.ROTATE_90)
    1.69 -        axis2 = get_axis_image(seqLabels2, labelSizes2, seq_starts2, seq_pix2,
    1.70 -                               textRot2, textRot2, font, image_mode, opts)
    1.71 +        axis2 = axisImage(seqLabels2, labelSizes2, seq_starts2, seq_pix2,
    1.72 +                          textRot2, textRot2, font, image_mode, opts)
    1.73          if not textRot2:
    1.74              axis2 = axis2.transpose(Image.ROTATE_270)
    1.75          im.paste(axis1, (0, 0))
    1.76 @@ -595,9 +595,10 @@
    1.77                    help="trim unaligned sequence flanks from the 2nd genome")
    1.78      op.add_option("--border-pixels", metavar="INT", type="int", default=1,
    1.79                    help="number of pixels between sequences (default=%default)")
    1.80 -    op.add_option("--border-color", metavar="COLOR", default="#dcdcdc",
    1.81 +    op.add_option("--border-color", metavar="COLOR", default="black",
    1.82                    help="color for pixels between sequences (default=%default)")
    1.83 -    # xxx --margin-color?
    1.84 +    op.add_option("--margin-color", metavar="COLOR", default="#dcdcdc",
    1.85 +                  help="margin color")
    1.86  
    1.87      og = optparse.OptionGroup(op, "Text options")
    1.88      og.add_option("-f", "--fontfile", metavar="FILE",
    1.89 @@ -630,9 +631,9 @@
    1.90                    help="read genome1 genes from genePred file")
    1.91      og.add_option("--genePred2", metavar="FILE",
    1.92                    help="read genome2 genes from genePred file")
    1.93 -    og.add_option("--exon-color", metavar="COLOR", default="#dfd",
    1.94 +    og.add_option("--exon-color", metavar="COLOR", default="PaleGreen",
    1.95                    help="color for exons (default=%default)")
    1.96 -    og.add_option("--cds-color", metavar="COLOR", default="#bdb",
    1.97 +    og.add_option("--cds-color", metavar="COLOR", default="LimeGreen",
    1.98                    help="color for protein-coding regions (default=%default)")
    1.99      op.add_option_group(og)
   1.100  
   1.101 @@ -643,7 +644,7 @@
   1.102                    help="read genome2 unsequenced gaps from agp or gap file")
   1.103      og.add_option("--bridged-color", metavar="COLOR", default="yellow",
   1.104                    help="color for bridged gaps (default: %default)")
   1.105 -    og.add_option("--unbridged-color", metavar="COLOR", default="pink",
   1.106 +    og.add_option("--unbridged-color", metavar="COLOR", default="orange",
   1.107                    help="color for unbridged gaps (default: %default)")
   1.108      op.add_option_group(og)
   1.109      (opts, args) = op.parse_args()