scripts/last-dotplot
changeset 855 09a9d7ef13ae
parent 852 f3b6c666afad
child 856 d086361eabec
     1.1 --- a/scripts/last-dotplot	Tue May 02 14:04:09 2017 +0900
     1.2 +++ b/scripts/last-dotplot	Wed May 17 18:29:32 2017 +0900
     1.3 @@ -296,14 +296,12 @@
     1.4          b = max(beg, cropBeg)
     1.5          e = min(end, cropEnd)
     1.6          if b >= e: continue
     1.7 +        color = 255, 228, 255
     1.8          if len(w) > 8:
     1.9              color = tuple(map(int, w[8].split(",")))
    1.10          elif len(w) > 5:
    1.11              if   w[5] == "+": color = 255, 244, 244
    1.12              elif w[5] == "-": color = 244, 244, 255
    1.13 -            else:             color = 255, 228, 255
    1.14 -        else:
    1.15 -            color = 255, 228, 255
    1.16          yield seqName, b, e, color
    1.17  
    1.18  def isExtraFirstGapField(fields):
    1.19 @@ -417,23 +415,23 @@
    1.20      warn("choosing bp per pixel...")
    1.21      pix_limit1 = opts.width  - margin1
    1.22      pix_limit2 = opts.height - margin2
    1.23 -    bp_per_pix1 = get_bp_per_pix(seqSizes1, opts.border_pixels, pix_limit1)
    1.24 -    bp_per_pix2 = get_bp_per_pix(seqSizes2, opts.border_pixels, pix_limit2)
    1.25 -    bp_per_pix = max(bp_per_pix1, bp_per_pix2)
    1.26 -    warn("bp per pixel = " + str(bp_per_pix))
    1.27 +    bpPerPix1 = get_bp_per_pix(seqSizes1, opts.border_pixels, pix_limit1)
    1.28 +    bpPerPix2 = get_bp_per_pix(seqSizes2, opts.border_pixels, pix_limit2)
    1.29 +    bpPerPix = max(bpPerPix1, bpPerPix2)
    1.30 +    warn("bp per pixel = " + str(bpPerPix))
    1.31  
    1.32 -    seq_pix1, seq_starts1, width  = get_pix_info(seqSizes1, bp_per_pix,
    1.33 +    seq_pix1, seq_starts1, width  = get_pix_info(seqSizes1, bpPerPix,
    1.34                                                   opts.border_pixels, margin1)
    1.35 -    seq_pix2, seq_starts2, height = get_pix_info(seqSizes2, bp_per_pix,
    1.36 +    seq_pix2, seq_starts2, height = get_pix_info(seqSizes2, bpPerPix,
    1.37                                                   opts.border_pixels, margin2)
    1.38      warn("width:  " + str(width))
    1.39      warn("height: " + str(height))
    1.40  
    1.41 -    origins1 = dict(seqOrigins(seqNames1, seq_starts1, seqLimits1, bp_per_pix))
    1.42 -    origins2 = dict(seqOrigins(seqNames2, seq_starts2, seqLimits2, bp_per_pix))
    1.43 +    origins1 = dict(seqOrigins(seqNames1, seq_starts1, seqLimits1, bpPerPix))
    1.44 +    origins2 = dict(seqOrigins(seqNames2, seq_starts2, seqLimits2, bpPerPix))
    1.45  
    1.46      warn("processing alignments...")
    1.47 -    hits = alignmentPixels(width, height, alignments, bp_per_pix,
    1.48 +    hits = alignmentPixels(width, height, alignments, bpPerPix,
    1.49                             origins1, origins2)
    1.50      warn("done")
    1.51  
    1.52 @@ -447,20 +445,20 @@
    1.53  
    1.54      beds1 = list(readBed(opts.bed1, seqLimits1))
    1.55      beds2 = list(readBed(opts.bed2, seqLimits2))
    1.56 -    drawAnnotations(im, beds1, origins1, margin2, height, True, bp_per_pix)
    1.57 -    drawAnnotations(im, beds2, origins2, margin1, width, False, bp_per_pix)
    1.58 +    drawAnnotations(im, beds1, origins1, margin2, height, True, bpPerPix)
    1.59 +    drawAnnotations(im, beds2, origins2, margin1, width, False, bpPerPix)
    1.60  
    1.61      gaps1 = list(readGaps(opts.gap1, seqLimits1))
    1.62      gaps2 = list(readGaps(opts.gap2, seqLimits2))
    1.63      # draw bridged gaps first, then unbridged gaps on top:
    1.64      drawUnsequencedGaps(im, gaps1, origins1, margin2, height, True, "yes",
    1.65 -                        bp_per_pix, opts.bridged_color)
    1.66 +                        bpPerPix, opts.bridged_color)
    1.67      drawUnsequencedGaps(im, gaps2, origins2, margin1, width, False, "yes",
    1.68 -                        bp_per_pix, opts.bridged_color)
    1.69 +                        bpPerPix, opts.bridged_color)
    1.70      drawUnsequencedGaps(im, gaps1, origins1, margin2, height, True, "no",
    1.71 -                        bp_per_pix, opts.unbridged_color)
    1.72 +                        bpPerPix, opts.unbridged_color)
    1.73      drawUnsequencedGaps(im, gaps2, origins2, margin1, width, False, "no",
    1.74 -                        bp_per_pix, opts.unbridged_color)
    1.75 +                        bpPerPix, opts.unbridged_color)
    1.76  
    1.77      for i in range(height):
    1.78          for j in range(width):