last-dotplot: read annotations a bit faster
authorMartin C. Frith
Fri Jul 31 14:18:38 2020 +0900 (11 days ago)
changeset 10738ec299b42e28
parent 1072 e43ecf1c3fb6
child 1074 170ab6c64728
last-dotplot: read annotations a bit faster
scripts/last-dotplot
     1.1 --- a/scripts/last-dotplot	Fri Jul 31 10:18:25 2020 +0900
     1.2 +++ b/scripts/last-dotplot	Fri Jul 31 14:18:38 2020 +0900
     1.3 @@ -591,6 +591,8 @@
     1.4          seqRanges = rangeDict[seqName]
     1.5          beg = int(w[1])
     1.6          end = int(w[2])
     1.7 +        if all(beg >= i[2] or end <= i[1] for i in seqRanges):
     1.8 +            continue
     1.9          layer = 900
    1.10          color = "#fbf"
    1.11          if len(w) > 4:
    1.12 @@ -619,12 +621,15 @@
    1.13              fields = fields[1:]
    1.14          seqName = fields[1]
    1.15          if seqName not in rangeDict: continue
    1.16 +        seqRanges = rangeDict[seqName]
    1.17          #strand = fields[2]
    1.18          cdsBeg = int(fields[5])
    1.19          cdsEnd = int(fields[6])
    1.20          exonBegs = commaSeparatedInts(fields[8])
    1.21          exonEnds = commaSeparatedInts(fields[9])
    1.22          for beg, end in zip(exonBegs, exonEnds):
    1.23 +            if all(beg >= i[2] or end <= i[1] for i in seqRanges):
    1.24 +                continue
    1.25              yield 300, opts.exon_color, seqName, beg, end
    1.26              b = max(beg, cdsBeg)
    1.27              e = min(end, cdsEnd)
    1.28 @@ -650,6 +655,8 @@
    1.29          else:
    1.30              continue
    1.31          seqRanges = rangeDict[seqName]
    1.32 +        if all(beg >= i[2] or end <= i[1] for i in seqRanges):
    1.33 +            continue
    1.34          if repeatClass in ("Low_complexity", "Simple_repeat", "Satellite"):
    1.35              yield 200, "#fbf", seqName, beg, end
    1.36          elif (strand == "+") != (seqRanges[0][3] > 1):