Change last-dotplot's verbosity
authorMartin C. Frith
Thu Jun 15 13:42:42 2017 +0900 (2017-06-15)
changeset 8665182d8528ce9
parent 865 230d1abe4c5d
child 867 f9ec9c71d72e
Change last-dotplot's verbosity
doc/last-dotplot.txt
scripts/last-dotplot
     1.1 --- a/doc/last-dotplot.txt	Thu Jun 15 13:22:41 2017 +0900
     1.2 +++ b/doc/last-dotplot.txt	Thu Jun 15 13:42:42 2017 +0900
     1.3 @@ -59,6 +59,8 @@
     1.4  
     1.5    -h, --help
     1.6        Show a help message, with default option values, and exit.
     1.7 +  -v, --verbose
     1.8 +      Show progress messages & data about the plot.
     1.9    -1 PATTERN, --seq1=PATTERN
    1.10        Which sequences to show from the 1st (horizontal) genome.
    1.11    -2 PATTERN, --seq2=PATTERN
     2.1 --- a/scripts/last-dotplot	Thu Jun 15 13:22:41 2017 +0900
     2.2 +++ b/scripts/last-dotplot	Thu Jun 15 13:42:42 2017 +0900
     2.3 @@ -21,8 +21,9 @@
     2.4      return open(fileName)
     2.5  
     2.6  def warn(message):
     2.7 -    prog = os.path.basename(sys.argv[0])
     2.8 -    sys.stderr.write(prog + ": " + message + "\n")
     2.9 +    if opts.verbose:
    2.10 +        prog = os.path.basename(sys.argv[0])
    2.11 +        sys.stderr.write(prog + ": " + message + "\n")
    2.12  
    2.13  def croppedBlocks(blocks, range1, range2):
    2.14      cropBeg1, cropEnd1 = range1
    2.15 @@ -185,6 +186,11 @@
    2.16      if sortOpt == 1:
    2.17          seqNames.sort(key=natural_sort_key)
    2.18      seqSizes = [seqLimits[i][1] - seqLimits[i][0] for i in seqNames]
    2.19 +    for i in seqNames:
    2.20 +        r = seqLimits[i]
    2.21 +        out = i, str(r[0]), str(r[1])
    2.22 +        warn("\t".join(out))
    2.23 +    warn("")
    2.24      if sortOpt == 2:
    2.25          seqRecords = sorted(zip(seqSizes, seqNames), reverse=True)
    2.26          seqSizes = [i[0] for i in seqRecords]
    2.27 @@ -545,6 +551,8 @@
    2.28     or: ..."""
    2.29      description = "Draw a dotplot of pair-wise sequence alignments in MAF or tabular format."
    2.30      op = optparse.OptionParser(usage=usage, description=description)
    2.31 +    op.add_option("-v", "--verbose", action="count",
    2.32 +                  help="show progress messages & data about the plot")
    2.33      op.add_option("-1", "--seq1", metavar="PATTERN", action="append",
    2.34                    default=[],
    2.35                    help="which sequences to show from the 1st genome")