scripts/last-dotplot
changeset 877 f5f93e51ef53
parent 875 592295375eb1
child 878 20f5c97a3cfd
     1.1 --- a/scripts/last-dotplot	Tue Sep 26 14:25:17 2017 +0900
     1.2 +++ b/scripts/last-dotplot	Tue Oct 03 11:10:47 2017 +0900
     1.3 @@ -468,24 +468,24 @@
     1.4  
     1.5      i1 = getSeqInfo(opts.sort1, seqNames1, seqLimits1,
     1.6                      font, opts.fontsize, image_mode, opts.lengths1)
     1.7 -    seqNames1, seqSizes1, seqLabels1, labelSizes1, margin1 = i1
     1.8 +    seqNames1, seqSizes1, seqLabels1, labelSizes1, tMargin = i1
     1.9  
    1.10      i2 = getSeqInfo(opts.sort2, seqNames2, seqLimits2,
    1.11                      font, opts.fontsize, image_mode, opts.lengths2)
    1.12 -    seqNames2, seqSizes2, seqLabels2, labelSizes2, margin2 = i2
    1.13 +    seqNames2, seqSizes2, seqLabels2, labelSizes2, lMargin = i2
    1.14  
    1.15      warn("choosing bp per pixel...")
    1.16 -    pix_limit1 = opts.width  - margin1
    1.17 -    pix_limit2 = opts.height - margin2
    1.18 +    pix_limit1 = opts.width  - lMargin
    1.19 +    pix_limit2 = opts.height - tMargin
    1.20      bpPerPix1 = get_bp_per_pix(seqSizes1, opts.border_pixels, pix_limit1)
    1.21      bpPerPix2 = get_bp_per_pix(seqSizes2, opts.border_pixels, pix_limit2)
    1.22      bpPerPix = max(bpPerPix1, bpPerPix2)
    1.23      warn("bp per pixel = " + str(bpPerPix))
    1.24  
    1.25      seq_pix1, seq_starts1, width  = get_pix_info(seqSizes1, bpPerPix,
    1.26 -                                                 opts.border_pixels, margin1)
    1.27 +                                                 opts.border_pixels, lMargin)
    1.28      seq_pix2, seq_starts2, height = get_pix_info(seqSizes2, bpPerPix,
    1.29 -                                                 opts.border_pixels, margin2)
    1.30 +                                                 opts.border_pixels, tMargin)
    1.31      warn("width:  " + str(width))
    1.32      warn("height: " + str(height))
    1.33  
    1.34 @@ -509,13 +509,13 @@
    1.35                              readRmsk(opts.rmsk1, seqLimits1),
    1.36                              readGenePred(opts, opts.genePred1, seqLimits1),
    1.37                              readGaps(opts, opts.gap1, seqLimits1))
    1.38 -    b1 = bedBoxes(beds1, seqLimits1, origins1, margin2, height, True, bpPerPix)
    1.39 +    b1 = bedBoxes(beds1, seqLimits1, origins1, tMargin, height, True, bpPerPix)
    1.40  
    1.41      beds2 = itertools.chain(readBed(opts.bed2, seqLimits2),
    1.42                              readRmsk(opts.rmsk2, seqLimits2),
    1.43                              readGenePred(opts, opts.genePred2, seqLimits2),
    1.44                              readGaps(opts, opts.gap2, seqLimits2))
    1.45 -    b2 = bedBoxes(beds2, seqLimits2, origins2, margin1, width, False, bpPerPix)
    1.46 +    b2 = bedBoxes(beds2, seqLimits2, origins2, lMargin, width, False, bpPerPix)
    1.47  
    1.48      boxes = sorted(itertools.chain(b1, b2))
    1.49      drawAnnotations(im, boxes)
    1.50 @@ -538,11 +538,11 @@
    1.51          im.paste(axis2, (0, 0))
    1.52  
    1.53      for i in seq_starts1[1:]:
    1.54 -        box = i - opts.border_pixels, margin2, i, height
    1.55 +        box = i - opts.border_pixels, tMargin, i, height
    1.56          im.paste(opts.border_color, box)
    1.57  
    1.58      for i in seq_starts2[1:]:
    1.59 -        box = margin1, i - opts.border_pixels, width, i
    1.60 +        box = lMargin, i - opts.border_pixels, width, i
    1.61          im.paste(opts.border_color, box)
    1.62  
    1.63      im.save(args[1])