scripts/last-dotplot
changeset 847 3ca7aa4b27a8
parent 846 1f46ab956351
child 850 db0ddc92f2ec
     1.1 --- a/scripts/last-dotplot	Tue Apr 04 12:15:35 2017 +0900
     1.2 +++ b/scripts/last-dotplot	Tue Apr 04 14:46:49 2017 +0900
     1.3 @@ -84,7 +84,7 @@
     1.4              if w[4] == "-": beg1 -= seqlen1
     1.5              chr2, beg2, seqlen2 = w[6], int(w[7]), int(w[10])
     1.6              if w[9] == "-": beg2 -= seqlen2
     1.7 -            blocks = list(tabBlocks(beg1, beg2, w[11]))
     1.8 +            blocks = tabBlocks(beg1, beg2, w[11])
     1.9              yield chr1, seqlen1, chr2, seqlen2, blocks
    1.10          elif line[0] == "s":  # MAF format
    1.11              if mafCount == 0:
    1.12 @@ -94,7 +94,7 @@
    1.13              else:
    1.14                  chr2, beg2, seqlen2, seq2 = w[1], int(w[2]), int(w[5]), w[6]
    1.15                  if w[4] == "-": beg2 -= seqlen2
    1.16 -                blocks = list(mafBlocks(beg1, beg2, seq1, seq2))
    1.17 +                blocks = mafBlocks(beg1, beg2, seq1, seq2)
    1.18                  yield chr1, seqlen1, chr2, seqlen2, blocks
    1.19                  mafCount = 0
    1.20  
    1.21 @@ -141,7 +141,7 @@
    1.22          if not range1: continue
    1.23          range2 = rangeFromSeqName(seqRanges2, seqName2, seqLen2)
    1.24          if not range2: continue
    1.25 -        b = list(croppedBlocks(blocks, range1, range2))
    1.26 +        b = list(croppedBlocks(list(blocks), range1, range2))
    1.27          if not b: continue
    1.28          aln = seqName1, seqName2, b
    1.29          alignments.append(aln)
    1.30 @@ -276,7 +276,7 @@
    1.31      if not fileName: return
    1.32      for line in myOpen(fileName):
    1.33          w = line.split()
    1.34 -        if not w or w[0][0] == "#": continue
    1.35 +        if not w: continue
    1.36          seqName = w[0]
    1.37          if seqName not in seqLimits: continue
    1.38          cropBeg, cropEnd = seqLimits[seqName]
    1.39 @@ -363,8 +363,7 @@
    1.40      min_pos = seq_starts[0]
    1.41      max_pos = seq_starts[-1] + seq_pix[-1]
    1.42      height = max(zip(*name_sizes)[1])
    1.43 -    labels = [make_label(i, j, k, l) for i, j, k, l in
    1.44 -              zip(seqNames, name_sizes, seq_starts, seq_pix)]
    1.45 +    labels = map(make_label, seqNames, name_sizes, seq_starts, seq_pix)
    1.46      labels = [i for i in labels if i[1] >= min_pos and i[2] <= max_pos]
    1.47      labels.sort()
    1.48      labels = get_nonoverlapping_labels(labels, opts.label_space)
    1.49 @@ -414,6 +413,8 @@
    1.50                                                   opts.pix_tween_seqs, margin1)
    1.51      seq_pix2, seq_starts2, height = get_pix_info(seq_sizes2, bp_per_pix,
    1.52                                                   opts.pix_tween_seqs, margin2)
    1.53 +    warn("width:  " + str(width))
    1.54 +    warn("height: " + str(height))
    1.55  
    1.56      origins1 = dict(seqOrigins(seqNames1, seq_starts1, seqLimits1, bp_per_pix))
    1.57      origins2 = dict(seqOrigins(seqNames2, seq_starts2, seqLimits2, bp_per_pix))