Add gz reading to: dotplot postmask train convert
authorMartin C. Frith
Tue Sep 26 14:25:17 2017 +0900 (2017-09-26)
changeset 875592295375eb1
parent 874 0602563ef4e2
child 876 bf8efe69f160
Add gz reading to: dotplot postmask train convert
scripts/last-dotplot
scripts/last-postmask
scripts/last-train
scripts/maf-convert
test/last-postmask-test.out
test/last-postmask-test.sh
test/last-test.sh
     1.1 --- a/scripts/last-dotplot	Fri Sep 22 19:00:34 2017 +0900
     1.2 +++ b/scripts/last-dotplot	Tue Sep 26 14:25:17 2017 +0900
     1.3 @@ -9,6 +9,7 @@
     1.4  # according to the number of aligned nt-pairs within it, but the
     1.5  # result is too faint.  How can this be done better?
     1.6  
     1.7 +import gzip
     1.8  import fnmatch, itertools, optparse, os, re, sys
     1.9  
    1.10  # Try to make PIL/PILLOW work:
    1.11 @@ -18,6 +19,8 @@
    1.12  def myOpen(fileName):  # faster than fileinput
    1.13      if fileName == "-":
    1.14          return sys.stdin
    1.15 +    if fileName.endswith(".gz"):
    1.16 +        return gzip.open(fileName)
    1.17      return open(fileName)
    1.18  
    1.19  def warn(message):
     2.1 --- a/scripts/last-postmask	Fri Sep 22 19:00:34 2017 +0900
     2.2 +++ b/scripts/last-postmask	Tue Sep 26 14:25:17 2017 +0900
     2.3 @@ -12,8 +12,16 @@
     2.4  # Limitations: doesn't (yet) handle sequence quality data,
     2.5  # frameshifts, or generalized affine gaps.
     2.6  
     2.7 +import gzip
     2.8  import itertools, optparse, os, signal, sys
     2.9  
    2.10 +def myOpen(fileName):
    2.11 +    if fileName == "-":
    2.12 +        return sys.stdin
    2.13 +    if fileName.endswith(".gz"):
    2.14 +        return gzip.open(fileName)
    2.15 +    return open(fileName)
    2.16 +
    2.17  def getScoreMatrix(rowHeads, colHeads, matrix, deleteCost, insertCost):
    2.18      defaultScore = min(map(min, matrix))
    2.19      scoreMatrix = [[defaultScore for i in range(128)] for j in range(128)]
    2.20 @@ -91,15 +99,12 @@
    2.21      if seqs: printIfGood(maf, seqs, scoreMatrix, aDel, aIns, minScore)
    2.22  
    2.23  def lastPostmask(args):
    2.24 -    if args:
    2.25 -        for i in args:
    2.26 -            if i == "-":
    2.27 -                doOneFile(sys.stdin)
    2.28 -            else:
    2.29 -                with open(i) as f:
    2.30 -                    doOneFile(f)
    2.31 -    else:
    2.32 -        doOneFile(sys.stdin)
    2.33 +    if not args:
    2.34 +        args = ["-"]
    2.35 +    for i in args:
    2.36 +        f = myOpen(i)
    2.37 +        doOneFile(f)
    2.38 +        f.close()
    2.39  
    2.40  if __name__ == "__main__":
    2.41      signal.signal(signal.SIGPIPE, signal.SIG_DFL)  # avoid silly error message
     3.1 --- a/scripts/last-train	Fri Sep 22 19:00:34 2017 +0900
     3.2 +++ b/scripts/last-train	Tue Sep 26 14:25:17 2017 +0900
     3.3 @@ -1,11 +1,14 @@
     3.4  #! /usr/bin/env python
     3.5  # Copyright 2015 Martin C. Frith
     3.6  
     3.7 +import gzip
     3.8  import math, optparse, os, random, signal, subprocess, sys, tempfile
     3.9  
    3.10  def myOpen(fileName):  # faster than fileinput
    3.11      if fileName == "-":
    3.12          return sys.stdin
    3.13 +    if fileName.endswith(".gz"):
    3.14 +        return gzip.open(fileName)
    3.15      return open(fileName)
    3.16  
    3.17  def randomSample(things, sampleSize):
    3.18 @@ -27,29 +30,30 @@
    3.19      if not fileNames:
    3.20          fileNames = ["-"]
    3.21      for name in fileNames:
    3.22 -        with myOpen(name) as f:
    3.23 -            seqType = 0
    3.24 -            for line in f:
    3.25 -                if seqType == 0:
    3.26 -                    if line[0] == ">":
    3.27 -                        seqType = 1
    3.28 -                        seq = []
    3.29 -                    elif line[0] == "@":
    3.30 -                        seqType = 2
    3.31 -                        lineType = 1
    3.32 -                elif seqType == 1:  # fasta
    3.33 -                    if line[0] == ">":
    3.34 -                        yield "".join(seq), ""
    3.35 -                        seq = []
    3.36 -                    else:
    3.37 -                        seq.append(line.rstrip())
    3.38 -                elif seqType == 2:  # fastq
    3.39 -                    if lineType == 1:
    3.40 -                        seq = line.rstrip()
    3.41 -                    elif lineType == 3:
    3.42 -                        yield seq, line.rstrip()
    3.43 -                    lineType = (lineType + 1) % 4
    3.44 -            if seqType == 1: yield "".join(seq), ""
    3.45 +        f = myOpen(name)
    3.46 +        seqType = 0
    3.47 +        for line in f:
    3.48 +            if seqType == 0:
    3.49 +                if line[0] == ">":
    3.50 +                    seqType = 1
    3.51 +                    seq = []
    3.52 +                elif line[0] == "@":
    3.53 +                    seqType = 2
    3.54 +                    lineType = 1
    3.55 +            elif seqType == 1:  # fasta
    3.56 +                if line[0] == ">":
    3.57 +                    yield "".join(seq), ""
    3.58 +                    seq = []
    3.59 +                else:
    3.60 +                    seq.append(line.rstrip())
    3.61 +            elif seqType == 2:  # fastq
    3.62 +                if lineType == 1:
    3.63 +                    seq = line.rstrip()
    3.64 +                elif lineType == 3:
    3.65 +                    yield seq, line.rstrip()
    3.66 +                lineType = (lineType + 1) % 4
    3.67 +        if seqType == 1: yield "".join(seq), ""
    3.68 +        f.close()
    3.69  
    3.70  def isGoodChunk(chunk):
    3.71      for i in chunk:
     4.1 --- a/scripts/maf-convert	Fri Sep 22 19:00:34 2017 +0900
     4.2 +++ b/scripts/maf-convert	Tue Sep 26 14:25:17 2017 +0900
     4.3 @@ -7,8 +7,16 @@
     4.4  # Genome FAQ, not e.g. "MIRA assembly format".
     4.5  
     4.6  from itertools import *
     4.7 +import gzip
     4.8  import math, optparse, os, signal, sys
     4.9  
    4.10 +def myOpen(fileName):
    4.11 +    if fileName == "-":
    4.12 +        return sys.stdin
    4.13 +    if fileName.endswith(".gz"):
    4.14 +        return gzip.open(fileName)
    4.15 +    return open(fileName)
    4.16 +
    4.17  def maxlen(s):
    4.18      return max(map(len, s))
    4.19  
    4.20 @@ -335,16 +343,17 @@
    4.21  def readSequenceLengths(fileNames):
    4.22      """Read name & length of topmost sequence in each maf block."""
    4.23      for i in fileNames:
    4.24 -        with open(i) as f:
    4.25 -            fields = None
    4.26 -            for line in f:
    4.27 -                if fields:
    4.28 -                    if line.isspace():
    4.29 -                        fields = None
    4.30 -                else:
    4.31 -                    if line[0] == "s":
    4.32 -                        fields = line.split()
    4.33 -                        yield fields[1], fields[5]
    4.34 +        f = myOpen(i)
    4.35 +        fields = None
    4.36 +        for line in f:
    4.37 +            if fields:
    4.38 +                if line.isspace():
    4.39 +                    fields = None
    4.40 +            else:
    4.41 +                if line[0] == "s":
    4.42 +                    fields = line.split()
    4.43 +                    yield fields[1], fields[5]
    4.44 +        f.close()
    4.45  
    4.46  def naturalSortKey(s):
    4.47      """Return a key that sorts strings in "natural" order."""
    4.48 @@ -372,11 +381,9 @@
    4.49              print "@SQ\tSN:%s\tLN:%s" % (k, sequenceLengths[k])
    4.50  
    4.51      if opts.dictfile:
    4.52 -        if opts.dictfile == "-":
    4.53 -            copyDictFile(sys.stdin)
    4.54 -        else:
    4.55 -            with open(opts.dictfile) as f:
    4.56 -                copyDictFile(f)
    4.57 +        f = myOpen(opts.dictfile)
    4.58 +        copyDictFile(f)
    4.59 +        f.close()
    4.60  
    4.61      if opts.readgroup:
    4.62          print "@RG\t" + "\t".join(opts.readgroup.split())
    4.63 @@ -787,15 +794,12 @@
    4.64          if isFormat(formatName, "tabular"):
    4.65              opts.isKeepComments = True
    4.66  
    4.67 -    if fileNames:
    4.68 -        for i in fileNames:
    4.69 -            if i == "-":
    4.70 -                mafConvertOneFile(opts, formatName, sys.stdin)
    4.71 -            else:
    4.72 -                with open(i) as f:
    4.73 -                    mafConvertOneFile(opts, formatName, f)
    4.74 -    else:
    4.75 -        mafConvertOneFile(opts, formatName, sys.stdin)
    4.76 +    if not fileNames:
    4.77 +        fileNames = ["-"]
    4.78 +    for i in fileNames:
    4.79 +        f = myOpen(i)
    4.80 +        mafConvertOneFile(opts, formatName, f)
    4.81 +        f.close()
    4.82  
    4.83      if not opts.noheader:
    4.84          if isFormat(formatName, "html"):
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/test/last-postmask-test.out	Tue Sep 26 14:25:17 2017 +0900
     5.3 @@ -0,0 +1,224 @@
     5.4 +TEST last-postmask 102.maf
     5.5 +# LAST version 761
     5.6 +#
     5.7 +# a=14 b=3 A=19 B=3 e=110 d=90 x=109 y=44 z=109 D=10 E=1.70365e+07
     5.8 +# R=01 u=0 s=2 S=1 M=0 T=0 m=50 l=1 n=50 k=1 w=1000 t=4.43034 j=3 Q=0
     5.9 +# /home/martin/data/genome/hg38/last/hg38naas-NEAR
    5.10 +# Reference sequences=195 normal letters=2934876451
    5.11 +# lambda=0.21715 K=0.343777
    5.12 +#
    5.13 +#    A  C  G  T
    5.14 +# A  6 -18 -8 -20
    5.15 +# C -20  6 -21 -12
    5.16 +# G -10 -21  6 -21
    5.17 +# T -21 -11 -20  6
    5.18 +#
    5.19 +a score=138 EG2=3.3e+04 E=0.13
    5.20 +s chr3 23607556 23 + 198295559 ACGTTCTGGTTTATGTTTCCTTG
    5.21 +s 102       673 23 +       699 ACGTTCTGGTTTATGTTTCCTTG
    5.22 +
    5.23 +a score=125 EG2=5.6e+05 E=2.2
    5.24 +s chr2 240456631 25 + 242193529 TGGGCAGCCTGGATGGGTG--CACAGG
    5.25 +s 102         91 27 +       699 TGGGCAGCCTGGATGGGTGTCCACAGG
    5.26 +
    5.27 +a score=120 EG2=1.7e+06 E=6.5
    5.28 +s chr10 124281394 20 + 133797422 GGCACCGCCATCTTGGCCTC
    5.29 +s 102         618 20 +       699 GGCACCGCCATCTTGGCCTC
    5.30 +
    5.31 +a score=118 EG2=2.6e+06 E=10
    5.32 +s chr5 93489542 22 + 181538259 CGGTACCAAATCTGCAGTATTT
    5.33 +s 102         6 22 +       699 CGGTACCAGATCTGCAGTATTT
    5.34 +
    5.35 +a score=118 EG2=2.6e+06 E=10
    5.36 +s chr14 80332129 27 + 107043718 CCTTCCCCAGGTATCTGTGTTGTTCAC
    5.37 +s 102        640 27 +       699 CCTTCCCCATGTATCTGCGTTGTTCAC
    5.38 +
    5.39 +a score=117 EG2=3.2e+06 E=13
    5.40 +s chr8 76840858 51 + 145138636 ATCCAGCTTGGCCACCAGCCACTTTACCTACCAGCGTGGCCTGG-TGCTGGG
    5.41 +s 102       425 40 +       699 ATCCAGCTTGGCCACC-GCCAC-------ACCAGC----CCCGGCTGCTGGG
    5.42 +
    5.43 +a score=116 EG2=4e+06 E=16
    5.44 +s chr3 152862893 27 + 198295559 TAGGTGGGCAGCCTGGCATGAGGTGTC
    5.45 +s 102         87 25 +       699 TAGGTGGGCAGCCTGG-ATG-GGTGTC
    5.46 +
    5.47 +a score=114 EG2=6.1e+06 E=24
    5.48 +s chr5 74376577 19 + 181538259 ACCAGATCTGCAGTATTTT
    5.49 +s 102        10 19 +       699 ACCAGATCTGCAGTATTTT
    5.50 +
    5.51 +a score=114 EG2=6.1e+06 E=24
    5.52 +s chr7 157969523 22 + 159345973 GGCAGGCTGGGTGCTGCCTGGG
    5.53 +s 102        493 22 +       699 GGCAGGCTGGGTGCTGCTTGGG
    5.54 +
    5.55 +a score=114 EG2=6.1e+06 E=24
    5.56 +s chr21 14291180 29 + 46709983 CCTACTTACGTTCTGGTTGTCATGTTTCC
    5.57 +s 102        666 27 +      699 CCTGCTTACGTTCTGGTT-T-ATGTTTCC
    5.58 +
    5.59 +a score=114 EG2=6.1e+06 E=24
    5.60 +s chrX 83302601 19 + 156040895 GGTTTATGTTTCCTTGAGT
    5.61 +s 102       680 19 +       699 GGTTTATGTTTCCTTGAGT
    5.62 +
    5.63 +a score=113 EG2=7.6e+06 E=30
    5.64 +s chr5 173701199 23 + 181538259 GCTTGGGCCATGGTGG--GCTCCTG
    5.65 +s 102        508 25 +       699 GCTTGGGCCATGGTGGCCGCTCCTG
    5.66 +
    5.67 +a score=112 EG2=9.4e+06 E=37
    5.68 +s chr3 127741375 27 + 198295559 GCTGGATGCCAGGGCAGGCTGGGTGCT
    5.69 +s 102        485 23 +       699 GCTGG----CAGGGCAGGCTGGGTGCT
    5.70 +
    5.71 +a score=112 EG2=9.4e+06 E=37
    5.72 +s chr4 3839062 21 + 190214555 TGGCCACCACCACACCAGCCC
    5.73 +s 102      433 21 +       699 TGGCCACCGCCACACCAGCCC
    5.74 +
    5.75 +a score=112 EG2=9.4e+06 E=37
    5.76 +s chr18 55335092 21 + 80373285 AGTGTGCCGGCCACAATCATG
    5.77 +s 102        256 21 +      699 AGTGTGCCGGCCACGATCATG
    5.78 +
    5.79 +a score=110 EG2=1.5e+07 E=58
    5.80 +s chr3 186865651 21 + 198295559 CCACGCCAGCCCCGGCTGCTG
    5.81 +s 102        442 21 +       699 CCACACCAGCCCCGGCTGCTG
    5.82 +
    5.83 +a score=110 EG2=1.5e+07 E=58
    5.84 +s chr5 169763615 29 + 181538259 TGGCAGGGCAGGCTGGACAGCTGCTGCTT
    5.85 +s 102        487 25 +       699 TGGCAGGGCAGGCTGG---G-TGCTGCTT
    5.86 +
    5.87 +a score=110 EG2=1.5e+07 E=58
    5.88 +s chr7 65260306 21 + 159345973 CCACGCCAGCCCCGGCTGCTG
    5.89 +s 102       442 21 +       699 CCACACCAGCCCCGGCTGCTG
    5.90 +
    5.91 +a score=110 EG2=1.5e+07 E=58
    5.92 +s chr19 47072201 36 + 58617616 CAGAGCCGAAGGTCATGGGCCCCAGACCAGGACTCC
    5.93 +s 102        371 32 +      699 CAG-GCCGAAGGTCATGGGCCACAG---AGAACTCC
    5.94 +
    5.95 +a score=110 EG2=1.5e+07 E=58
    5.96 +s chr20 4034147 21 + 64444167 CCACGCCAGCCCCGGCTGCTG
    5.97 +s 102       442 21 +      699 CCACACCAGCCCCGGCTGCTG
    5.98 +
    5.99 +a score=954 EG2=3.7e-73 E=1e-78
   5.100 +s chr19 1390855 197 + 58617616 GCCCGGCCTCCGCAGAGTTCTCTGTGGCCCATGACCTTCGGCCTGGCCTGCTGCGCCGTGGAGATGATGCACATGGCAGCACCCCGCTACGACATGGACCGCTTTGGCGTGGTCTTCCGCGCCAGCccgcgccagtccgACGTCATGATCGTGGCCGGCACACTCA---CCAACAAGATGGCCCCAGCGCTTCGCAAGGT
   5.101 +s 102       289 189 -      699 GCCCG----CCG--GAGTTCTCTGTGGCCCATGACCTTCGGCCTGGCCTGCTGCGCCGTGGAGATGATGCGCATGGCAGCACCCCGCTACGACATGGACCGC--CGGC--GGTCTTCCGCGCCAGCccgcgccagtccgACGTCATGATCGTGGCCGGCACACTCACCGCCAACAAGATGGCCCCAGCGC-TCGCAAGGT
   5.102 +
   5.103 +a score=495 EG2=7.1e-30 E=2.5e-35
   5.104 +s chr19 1388829 109 + 58617616 CAGCACCCAGCCTGCCCTGCCAAAGGCCAG-AGCCGTGGCTCCCAAACCCAGCAGCCGGGGCGAGTATG-TGGTGGCCAAGCTGGATGACCTCGTCAACTGGGCCCGCCGG
   5.105 +s 102       190 108 -      699 CAGCACCCAGCCTGCCCTGCCA---GCCAGGAGCCGTGGCTCCCAAACccagcagccggggcTGGTGTGGCGGTGGCCAAGCTGGATGACCTCGTCAACTGGGCCCGCCGG
   5.106 +
   5.107 +a score=321 EG2=1.8e-13 E=6.8e-19
   5.108 +s chr19 1388523 70 + 58617616 GCTCCAGCGTGGG-CCCGGCTGTGCAGGCACGAGGTGTCCATCAG-AGCGTGGCCACCGATGGCCCAAGCAG
   5.109 +s 102       124 69 -      699 GCTCCAGCGTGGGCCCCGGCTGTGCAGGCACGAGGTGTCCATCAGGAGC--GGCCACC-ATGGCCCAAGCAG
   5.110 +
   5.111 +a score=320 EG2=2.3e-13 E=8.4e-19
   5.112 +s chr19 1393240 91 + 58617616 GCTGCGCCAACGGAGGAGGCTACTACCACTATTCCTACTCGGTGGTGAGGGGCTGCGACCGCATCGTGCCCGTGGACATCTACATCCCAGG
   5.113 +s 102       521 80 -      699 GCTGCGCCAACGGAGGAGGCTACTACCACTATTCCTA-TC---GGTGAGGCG----GACCGCATCGTGCCTGTGGACACC--CAT-CCAGG
   5.114 +
   5.115 +a score=291 EG2=1.2e-10 E=4.6e-16
   5.116 +s chr19 1395387 97 + 58617616 CAGGCTGCCCACCTACGGCCGAGGCCCTGC-TCTACGGCATCCTGCAGCTGcaGAGGAAGATCAAG-CGGGAGCGG-------AGGCTGCAGATCTGGTACCGCAG
   5.117 +s 102       597 99 -      699 CAGGCTGCCCACCTACGGCCGAGGCCCTGCCTCTACGG--TCCCGCAGCCGTAG-TGAAGATC--GCCGGGAGCGACAAAAATA--CTGCAGATCTGGTACCGCAG
   5.118 +
   5.119 +a score=237 EG2=1.5e-05 E=5.8e-11
   5.120 +s chr19 1391116 47 + 58617616 AGGTCTA-CGACCAGATGCCGGAGCCGCGCTACGTGGTCTCCATGGGG
   5.121 +s 102       474 47 -      699 AGGTCTAGCGACCAGATGCCGGAGCCGCGCTACGTGGT-TCCATGGGG
   5.122 +
   5.123 +a score=215 EG2=0.0018 E=7e-09
   5.124 +s chr19 1387807 40 + 58617616 CAGCTCCTGGCCT--GCGCGGCTTCCGGATCCTTGGTCTGCG
   5.125 +s 102        83 42 -      699 CAGCTCCTGGCCTGCGCGCGGCTTCCGGATCCTTGGTCTGCG
   5.126 +
   5.127 +a score=178 EG2=5.6 E=2.2e-05
   5.128 +s chr19 1383910 32 + 58617616 GAAGGCCGAGGCCAAGATGGCGGTGCTGTCAG
   5.129 +s 102        54 32 -      699 GAAGGCCGAGGCCAAGATGGCGGTGCCGTCAG
   5.130 +
   5.131 +a score=133 EG2=9.9e+04 E=0.39
   5.132 +s chr7 101590379 41 + 159345973 CCACCACGGGACCAGAGCAGCACCCAGCCTGCC--GCCAGCCA
   5.133 +s 102        175 41 -       699 CCACCATGG-CCCA-AGCAGCACCCAGCCTGCCCTGCCAGCCA
   5.134 +
   5.135 +a score=126 EG2=4.5e+05 E=1.8
   5.136 +s chr19 17615430 21 + 58617616 GGAAGGCCGAGGCCAAGATGG
   5.137 +s 102         53 21 -      699 GGAAGGCCGAGGCCAAGATGG
   5.138 +
   5.139 +a score=124 EG2=7e+05 E=2.7
   5.140 +s chr19 18430559 29 + 58617616 ACCCAGCTGAGCTGCCCTGCCAGCCAGGA
   5.141 +s 102        194 25 -      699 ACCCAGC----CTGCCCTGCCAGCCAGGA
   5.142 +
   5.143 +a score=121 EG2=1.3e+06 E=5.3
   5.144 +s chr8 98433261 30 + 145138636 CAGCACCTCTGTCAGCCTGCCCTGCCAGCC
   5.145 +s 102       190 25 -       699 CAGCACC-----CAGCCTGCCCTGCCAGCC
   5.146 +
   5.147 +a score=120 EG2=1.7e+06 E=6.5
   5.148 +s chr4 54783704 36 + 190214555 AGCCAGGAGCTGTGGCTCCCAACTGCAATCCCAGCA
   5.149 +s 102       211 30 -       699 AGCCAGGAGCCGTGGCTCCCAA-----A-Cccagca
   5.150 +
   5.151 +a score=119 EG2=2.1e+06 E=8.1
   5.152 +s chr3 130609408 26 + 198295559 GCAGCACTCAGCCTGCCCTTGCCAGC
   5.153 +s 102        189 25 -       699 GCAGCACCCAGCCTGCCCT-GCCAGC
   5.154 +
   5.155 +a score=117 EG2=3.2e+06 E=13
   5.156 +s chr3 37588376 38 + 198295559 GCATGCGTG--TGTGGACACCCATCCAAGCTTCGTCCACC
   5.157 +s 102       573 37 -       699 GCAT-CGTGCCTGTGGACACCCATCCAGGCT--GCCCACC
   5.158 +
   5.159 +a score=116 EG2=4e+06 E=16
   5.160 +s chr16 722483 30 + 90338345 GGATACCCATCCAGGCTGCCCCCGGACCTA
   5.161 +s 102      586 26 -      699 GGACACCCATCCAGGCTGCCC----ACCTA
   5.162 +
   5.163 +a score=115 EG2=4.9e+06 E=19
   5.164 +s chr10 126932869 41 + 133797422 AGGCCAAGAACTGGGCCCAGTGTCACCGTCAGCTCCTGGCC
   5.165 +s 102          62 33 -       699 AGGCCAAGA--TGG---CGGTG---CCGTCAGCTCCTGGCC
   5.166 +
   5.167 +a score=115 EG2=4.9e+06 E=19
   5.168 +s chr22 46458800 22 + 50818468 CAGATACATGGGAAAGGCCGAG
   5.169 +s 102         42 22 -      699 CAGATACATGGGGAAGGCCGAG
   5.170 +
   5.171 +a score=114 EG2=6.1e+06 E=24
   5.172 +s chr3 89815479 19 + 198295559 CCATGGCCCAAGCAGCACC
   5.173 +s 102       178 19 -       699 CCATGGCCCAAGCAGCACC
   5.174 +
   5.175 +a score=114 EG2=6.1e+06 E=24
   5.176 +s chr6 1842831 19 + 170805979 CAGCCAGGAGCCGTGGCTC
   5.177 +s 102      210 19 -       699 CAGCCAGGAGCCGTGGCTC
   5.178 +
   5.179 +a score=114 EG2=6.1e+06 E=24
   5.180 +s chr7 100370596 19 + 159345973 CAGCCAGGAGCCGTGGCTC
   5.181 +s 102        210 19 -       699 CAGCCAGGAGCCGTGGCTC
   5.182 +
   5.183 +a score=114 EG2=6.1e+06 E=24
   5.184 +s chr12 19357535 19 + 133275309 GCACCCAGCCTGCCCTGCC
   5.185 +s 102        192 19 -       699 GCACCCAGCCTGCCCTGCC
   5.186 +
   5.187 +a score=114 EG2=6.1e+06 E=24
   5.188 +s chr17 19172450 19 + 83257441 CAGCCAGGAGCCGTGGCTC
   5.189 +s 102        210 19 -      699 CAGCCAGGAGCCGTGGCTC
   5.190 +
   5.191 +a score=114 EG2=6.1e+06 E=24
   5.192 +s chr17 29190069 19 + 83257441 GCCCTGCCAGCCAGGAGCC
   5.193 +s 102        203 19 -      699 GCCCTGCCAGCCAGGAGCC
   5.194 +
   5.195 +a score=114 EG2=6.1e+06 E=24
   5.196 +s chr17 58670490 19 + 83257441 CAGCCAGGAGCCGTGGCTC
   5.197 +s 102        210 19 -      699 CAGCCAGGAGCCGTGGCTC
   5.198 +
   5.199 +a score=114 EG2=6.1e+06 E=24
   5.200 +s chr20 17684744 19 + 64444167 GTGCCTGTGGACACCCATC
   5.201 +s 102        578 19 -      699 GTGCCTGTGGACACCCATC
   5.202 +
   5.203 +a score=114 EG2=6.1e+06 E=24
   5.204 +s chr21 43027934 19 + 46709983 CCAGCCTGCCCTGCCAGCC
   5.205 +s 102        196 19 -      699 CCAGCCTGCCCTGCCAGCC
   5.206 +
   5.207 +a score=114 EG2=6.1e+06 E=24
   5.208 +s chrX 39928416 19 + 156040895 CAGCCAGGAGCCGTGGCTC
   5.209 +s 102       210 19 -       699 CAGCCAGGAGCCGTGGCTC
   5.210 +
   5.211 +a score=112 EG2=9.4e+06 E=37
   5.212 +s chr3 33026624 24 + 198295559 GGCCGCCATGGTCCAAGCAGCACC
   5.213 +s 102       173 24 -       699 GGCCACCATGGCCCAAGCAGCACC
   5.214 +
   5.215 +a score=111 EG2=1.2e+07 E=46
   5.216 +s chr5 177958541 23 + 181538259 GCCCCGGCTGTGGAGGCACGAGG
   5.217 +s 102        136 23 -       699 GCCCCGGCTGTGCAGGCACGAGG
   5.218 +
   5.219 +a score=110 EG2=1.5e+07 E=58
   5.220 +s chr6 170257701 26 + 170805979 AGCACCCAGCCTGCCCTTGTCCAGCC
   5.221 +s 102        191 24 -       699 AGCACCCAGCCTGCCCT-G-CCAGCC
   5.222 +
   5.223 +a score=110 EG2=1.5e+07 E=58
   5.224 +s chr15 78230485 25 + 101991189 CAGGAGCAGCCACCATGGCCACAAG
   5.225 +s 102        166 24 -       699 CAGGAGCGGCCACCATGGCC-CAAG
   5.226 +
   5.227 +
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/test/last-postmask-test.sh	Tue Sep 26 14:25:17 2017 +0900
     6.3 @@ -0,0 +1,16 @@
     6.4 +#! /bin/sh
     6.5 +
     6.6 +try () {
     6.7 +    echo TEST "$@"
     6.8 +    eval "$@"
     6.9 +    echo
    6.10 +}
    6.11 +
    6.12 +cd $(dirname $0)
    6.13 +
    6.14 +PATH=../src:../scripts:$PATH
    6.15 +
    6.16 +{
    6.17 +    try last-postmask 102.maf
    6.18 +} |
    6.19 +diff -u $(basename $0 .sh).out -
     7.1 --- a/test/last-test.sh	Fri Sep 22 19:00:34 2017 +0900
     7.2 +++ b/test/last-test.sh	Tue Sep 26 14:25:17 2017 +0900
     7.3 @@ -196,7 +196,9 @@
     7.4  rm f.* r.*
     7.5  
     7.6  ./last-pair-test.sh
     7.7 +./last-postmask-test.sh
     7.8  ./last-split-test.sh
     7.9 +./last-train-test.sh
    7.10  ./maf-convert-test.sh
    7.11  
    7.12  # Test: lastdb, lastal, last-split, maf-sort, maf-join