[med-svn] [Git][med-team/kmer][master] Final Python2 to Python3 adjustements

Andreas Tille gitlab at salsa.debian.org
Mon May 18 07:17:35 BST 2020



Andreas Tille pushed to branch master at Debian Med / kmer


Commits:
955305cc by Antoni Villalonga at 2020-05-18T03:20:53+02:00
Final Python2 to Python3 adjustements

- - - - -


3 changed files:

- debian/atac.install
- debian/patches/2to3.patch
- debian/rules


Changes:

=====================================
debian/atac.install
=====================================
@@ -52,8 +52,8 @@ installdir/lib/dedashMatches.py	/usr/lib/atac/lib
 installdir/lib/fillIntraRunGaps.py	/usr/lib/atac/lib
 installdir/lib/mkstats.py	/usr/lib/atac/lib
 installdir/lib/squeezeIntraRunGaps.py	/usr/lib/atac/lib
-installdir/lib/halignmodule.so	/usr/lib/atac/lib
-installdir/lib/localAlignerInterfacemodule.so	/usr/lib/atac/lib
+installdir/lib/halign.so	/usr/lib/atac/lib
+installdir/lib/localAlignerInterface.so	/usr/lib/atac/lib
 
 # seatac
 installdir/bin/seatac /usr/lib/atac/bin


=====================================
debian/patches/2to3.patch
=====================================
@@ -5,7 +5,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
 
 --- a/Makefile.wiki
 +++ b/Makefile.wiki
-@@ -1370,9 +1370,9 @@ there the <tt>_OS|FULL_</tt> is useful,
+@@ -1370,9 +1370,9 @@
  install LAPACK in all sorts of ways.
  
  <pre>
@@ -25,7 +25,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
  """
  The environmental variable "PYTHONPATH" is a colon separated list
-@@ -28,12 +28,9 @@ import fillIntraRunGaps
+@@ -28,12 +28,9 @@
  
  #import dedashMatches
  
@@ -40,7 +40,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
  def cvm(f,x,y):
      # A cvm variant (flag ? y : x) = (x,y)[f]
-@@ -58,7 +55,7 @@ class GlobalParam:
+@@ -58,7 +55,7 @@
      
  
  def usage (*_):
@@ -49,7 +49,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  # end def
  
  def filterByMatchLength( inpfile, outfile, minimum_length):
-@@ -69,7 +66,7 @@ def filterByMatchLength( inpfile, outfil
+@@ -69,7 +66,7 @@
              FM = MatchRecord.MatchRecord(line)
              if (FM.x_length >= minimum_length and
                  FM.y_length >= minimum_length ):
@@ -58,7 +58,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              # end if
          # end if
      # end for
-@@ -90,7 +87,7 @@ def onlyKeepLongRuns ( inpfile, outname,
+@@ -90,7 +87,7 @@
              SL = FM.x_length
              if FL != None and FL.runid != FM.runid :
                  for x in store:
@@ -67,7 +67,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  # end for
                  store = []
                  lenInMatches = SL
-@@ -102,10 +99,10 @@ def onlyKeepLongRuns ( inpfile, outname,
+@@ -102,10 +99,10 @@
                  store.append(FM)
              else:
                  for x in store:
@@ -80,7 +80,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              # end if
              FL = FM
          # end if
-@@ -142,10 +139,10 @@ def coalesceMatches ( inpfile, outfile,
+@@ -142,10 +139,10 @@
              assert(py >= 0)
              assert(ny >= 0)
              if (not (not needs_to_share_diagonal or nx == ny)):
@@ -95,7 +95,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              # end if
              assert((hghHitPX == None or (not needs_to_share_diagonal) or nx == ny))
              forward = (curF.x_orientation == curF.y_orientation)
-@@ -182,7 +179,7 @@ def coalesceMatches ( inpfile, outfile,
+@@ -182,7 +179,7 @@
                      firstF.y_start = lowHitPY
                      firstF.x_length = hghHitPX - lowHitPX
                      firstF.y_length = hghHitPY - lowHitPY
@@ -104,7 +104,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  # end if
                  firstF = curF
                  lowHitPX = lowMerPX
-@@ -209,7 +206,7 @@ def coalesceMatches ( inpfile, outfile,
+@@ -209,7 +206,7 @@
          firstF.y_start = lowHitPY
          firstF.x_length = hghHitPX - lowHitPX
          firstF.y_length = hghHitPY - lowHitPY
@@ -113,7 +113,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
      return
  # end def
-@@ -243,12 +240,12 @@ def boxRecovery( inpfile, rawfile, outna
+@@ -243,12 +240,12 @@
                      if( rawline[0] == 'M'):
                          rawMatch = MatchRecord.MatchRecord(rawline)
                          if(rawMatch.sameAs(rightMatch)):
@@ -128,7 +128,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                              # end if
                          # end if
                      # end if
-@@ -260,7 +257,7 @@ def boxRecovery( inpfile, rawfile, outna
+@@ -260,7 +257,7 @@
                      if( rawline[0] == 'M'):
                          rawMatch = MatchRecord.MatchRecord(rawline)
                          if(rawMatch.sameAs(rightMatch)):
@@ -137,7 +137,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                              break
                          else: 
                              # print >>STDERR, "Discard rawMatch=", rawMatch
-@@ -281,7 +278,7 @@ def boxRecovery( inpfile, rawfile, outna
+@@ -281,7 +278,7 @@
  class AtacDriver(AtacFile.AtacFile):
      def runOld(self):
          self.globals['atacAlgorithmVersion'] = str(17)
@@ -146,7 +146,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
          # The ATAC globals used by this script:
          opt_t = int(self.globals['globalMatchMinSize'])
-@@ -295,7 +292,7 @@ class AtacDriver(AtacFile.AtacFile):
+@@ -295,7 +292,7 @@
          assemblyFile2 = self.globals['assemblyFile2']
  
          boxRecoveryOn = 0  # Deprecated for same species comparisons 2003/09/09.
@@ -155,7 +155,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              boxRecoveryOn = int(self.globals['boxRecoveryOn'])
              
          t0 = time.time()
-@@ -309,24 +306,24 @@ class AtacDriver(AtacFile.AtacFile):
+@@ -309,24 +306,24 @@
          redo = 0
          keep = 0
          step = 0
@@ -189,7 +189,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  outfile = MyFile.myfile()
                  UniqueFilter.main( self.matches, outfile)
                  self.matches = outfile
-@@ -334,11 +331,11 @@ class AtacDriver(AtacFile.AtacFile):
+@@ -334,11 +331,11 @@
                  self.checkpoint(outprefix)
  
          step += 1
@@ -205,7 +205,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              outfile = MyFile.myfile()
              filterByMatchLength( self.matches, outfile, opt_t)
              self.matches = outfile
-@@ -346,15 +343,15 @@ class AtacDriver(AtacFile.AtacFile):
+@@ -346,15 +343,15 @@
              self.checkpoint(outprefix)
  
          step += 1
@@ -226,7 +226,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              outprefix += '.trim'
              self.checkpoint(outprefix)
  
-@@ -363,11 +360,11 @@ class AtacDriver(AtacFile.AtacFile):
+@@ -363,11 +360,11 @@
              rawfile = self.matches
  
          step += 1
@@ -242,7 +242,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              tempdata = PerfectRuns.formPerfectRuns(self.matches,
                                                     MatchRecord.sortInXorderAP,
                                                     MatchRecord.sortInYorderAP,
-@@ -378,22 +375,22 @@ class AtacDriver(AtacFile.AtacFile):
+@@ -378,22 +375,22 @@
          # end if
  
          step += 1
@@ -273,7 +273,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              tempdata = PerfectRuns.formPerfectRuns(self.matches,
                                         MatchRecord.sortInYorderAP,
                                         MatchRecord.sortInXorderAP, maxdiff, 'r')
-@@ -405,16 +402,16 @@ class AtacDriver(AtacFile.AtacFile):
+@@ -405,16 +402,16 @@
  
              # This is a box recovery step.
              step += 1
@@ -296,7 +296,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  tempdata = boxRecovery( self.matches, rawfile, outprefix)
                  self.matches = tempdata
                  outprefix += '.br'
-@@ -422,12 +419,12 @@ class AtacDriver(AtacFile.AtacFile):
+@@ -422,12 +419,12 @@
              # end if
  
              step += 1
@@ -314,7 +314,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  tempdata = PerfectRuns.formPerfectRuns(self.matches,
                                         MatchRecord.sortInXorderAP,
                                         MatchRecord.sortInYorderAP, maxdiff, 'r')
-@@ -436,11 +433,11 @@ class AtacDriver(AtacFile.AtacFile):
+@@ -436,11 +433,11 @@
                  self.checkpoint(outprefix)
  
          step += 1
@@ -330,7 +330,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              tempdata = MyFile.myfile()
              squeezeIntraRunGaps.mainLoop(
                  self.matches,
-@@ -454,39 +451,39 @@ class AtacDriver(AtacFile.AtacFile):
+@@ -454,39 +451,39 @@
              self.checkpoint(outprefix)
  
          step += 1
@@ -385,7 +385,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                      self.globals['fillIntraRunGapsMaxGap'] = 100000
                  fillIntraRunGapsErate = float(self.globals['fillIntraRunGapsErate'])
                  fillIntraRunGapsMaxGap = int(self.globals['fillIntraRunGapsMaxGap'])
-@@ -499,11 +496,11 @@ class AtacDriver(AtacFile.AtacFile):
+@@ -499,11 +496,11 @@
                  self.checkpoint(outprefix)
  
              step += 1
@@ -401,7 +401,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  tempdata = MyFile.myfile()
                  TrimMatchOverlaps.trimMatchOverlapsInBoth(self.matches,tempdata,'u')
                  self.matches = tempdata
-@@ -522,7 +519,7 @@ class localExecutable :
+@@ -522,7 +519,7 @@
          self.name = name
      def run(self,argline,inpfile,outfile):
          cmd = "%s %s %s %s" % (self.name,argline,inpfile,outfile)
@@ -410,7 +410,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          iret = os.system(cmd)
          assert(iret == 0)
  
-@@ -533,14 +530,14 @@ def main(runName):
+@@ -533,14 +530,14 @@
      obj = AtacDriver(runName)
  
      t1 = time.time()
@@ -430,7 +430,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
      assemblyId1 = obj.globals['assemblyId1']
      assemblyId2 = obj.globals['assemblyId2']
-@@ -560,33 +557,33 @@ def main(runName):
+@@ -560,33 +557,33 @@
      assert(os.path.exists(assemblyFile1+".idxStore"))
      assert(os.path.exists(assemblyFile2+".idxStore"))
  
@@ -474,7 +474,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
      obj.checkpoint(runName + ".chained.atac")
  
-@@ -594,7 +591,7 @@ def main(runName):
+@@ -594,7 +591,7 @@
  
  if __name__ == '__main__':
      if (len(sys.argv) == 1):
@@ -491,7 +491,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  # Looking in /usr/local/ir/bin on the Compaqs for the correct Python interpreter.
  # export PYTHONPATH=${PYTHONPATH}:$WORK/cds/IR/COMPASS/src/AtacPipeline
  
-@@ -58,15 +58,15 @@ class AtacFile:
+@@ -58,15 +58,15 @@
          elif(linetype == 'M'):
              fields = line.split()
              if(fields[1] == 'r'):
@@ -511,7 +511,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              assert(0)
          # end if
      # end def
-@@ -75,16 +75,16 @@ class AtacFile:
+@@ -75,19 +75,19 @@
          self.globals["modificationDate"] = time.asctime()
          fp = open(filename,"w")
          for line in self.metacommands:
@@ -530,10 +530,14 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
 +            print(line, file=fp)
          self.matches.seek(0)
          for line in self.matches:
-             fp.write(line)
+-            fp.write(line)
++            fp.write(line.decode("utf-8"))
+         self.matches.seek(0)
+         self.runs.seek(0)
+         for line in self.runs:
 --- a/atac-driver/chainer/python/IdxStore.py
 +++ b/atac-driver/chainer/python/IdxStore.py
-@@ -12,7 +12,7 @@ def createIndexedFasta( prefix, nickname
+@@ -12,7 +12,7 @@
    # This is a class method (as opposed to an object method).
    # This method creates an indexed FASTA file on disk.
  
@@ -542,7 +546,18 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
    the_uid = None
    defline = None
-@@ -45,7 +45,7 @@ def createIndexedFasta( prefix, nickname
+@@ -20,8 +20,8 @@
+   linenumber = 0
+   cur_offset = 0
+ 
+-  FASTA    = file( prefix, "r")
+-  IDXSTORE = file( prefix + ".idxStore", "w")
++  FASTA    = open( prefix, "r")
++  IDXSTORE = open( prefix + ".idxStore", "w")
+   for line in FASTA:
+     linenumber += 1
+     line = line.strip()
+@@ -45,7 +45,7 @@
          cur_offset += seq_length + 1;
          # remember the UNIX newline inserted by print.
  
@@ -551,7 +566,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
        # end if
  
        # Now process the new data.
-@@ -73,7 +73,7 @@ def createIndexedFasta( prefix, nickname
+@@ -73,7 +73,7 @@
      cur_offset += seq_length + 1;
      # remember the UNIX newline inserted by print.
  
@@ -560,7 +575,25 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
    # end if
  
    FASTA.close()
-@@ -196,7 +196,7 @@ def convertIndexToUID (  x_prefix, y_pre
+@@ -107,7 +107,7 @@
+     self.iid2seq_offset = []
+ 
+     filename = prefix + ".idxStore"
+-    idxstore = file(filename, "r");
++    idxstore = open(filename, "r");
+ 
+     the_iid=0;
+     while 1:
+@@ -129,7 +129,7 @@
+       the_iid += 1;
+ 
+     filename = prefix
+-    self.seqstore = file(filename, "r");
++    self.seqstore = open(filename, "r");
+     return
+   
+ 
+@@ -196,7 +196,7 @@
              FM = MatchRecord.MatchRecord(line)
              FM.x_scaf_uid = the_x_uid[FM.x_scaf_uid]
              FM.y_scaf_uid = the_y_uid[FM.y_scaf_uid]
@@ -577,7 +610,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
  import sys, os, copy, string, tempfile
  
-@@ -153,7 +153,7 @@ def convertBrianRecordFormat( inpfile, o
+@@ -153,7 +153,7 @@
      for line in inpfile:
          lineCount += 1
          if(lineCount % 100000 == 0):
@@ -586,7 +619,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          FB = line.split()
          orientation = (FB[0][1:]=='f')
          FM = MatchRecord("M x . . . 0 0 0 . 0 0 0 0\n")
-@@ -169,9 +169,9 @@ def convertBrianRecordFormat( inpfile, o
+@@ -169,9 +169,9 @@
          FM.identifier    = ""
          FM.extend        = {}
          #FM.mismatches   = 0
@@ -600,7 +633,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  # end def
 --- a/atac-driver/chainer/python/MyFile.py
 +++ b/atac-driver/chainer/python/MyFile.py
-@@ -1,9 +1,9 @@
+@@ -1,22 +1,32 @@
 -#!/usr/bin/env python
 -import sys, os, copy, tempfile, cStringIO
 +#!/usr/bin/python3
@@ -612,8 +645,39 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
 +class myfile():
      "A temporary anonymous file"
      def __init__(self):
-         filename = tempfile.mktemp()
-@@ -27,8 +27,8 @@ class ListLikeFileIter:
+-        filename = tempfile.mktemp()
+-        #print >>sys.stderr, "myfile: creating " + filename
+-        file.__init__(self,filename,"w+")
++        self.tmpfile = tempfile.NamedTemporaryFile(delete=False)
++        self.name = self.tmpfile.name
+     def __del__(self):                 
+-        #print >>sys.stderr, "myfile: deleting " + self.name
+         self.close()
+-        os.system("rm -f " + self.name)
++        return os.unlink(self.name)
++    def __iter__(self):
++        line = self.tmpfile.readline()
++        if line:
++            yield line
++        else:
++            return
++    def write(self, data):
++        return self.tmpfile.write(data.encode())
++    def flush(self):
++        return self.tmpfile.flush()
++    def seek(self, pos):
++        return self.tmpfile.seek(pos)
++    def close(self):
++        return self.tmpfile.close()
+     def link(self,othername):
+-        #print >>sys.stderr, "myfile: linking %s to %s" % ( self.name, othername)
+-        self.flush()
+-        os.system("ln -f %s %s" % (self.name, othername))
++        return os.symlink(self.name, othername, target_is_directory=False)
+ 
+ class ListLikeFileIter:
+     # See http://www.python.org/peps/pep-0234.html
+@@ -27,8 +37,8 @@
          self._fileIter = iter(self._fileptr.readline,"")
      def __del__(self):
          self._fileptr.close()
@@ -624,7 +688,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          if line:
              return line
          else:
-@@ -37,7 +37,7 @@ class ListLikeFileIter:
+@@ -37,7 +47,7 @@
      def __getitem__(self,ii):
          # For files, the list location ii is ignored.
          # line = self._fileptr.readline()
@@ -633,7 +697,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          if line:
              return line
          else:
-@@ -50,14 +50,14 @@ class ListLikeFile:
+@@ -50,14 +60,14 @@
      def __init__(self):
          #self._filename = tempfile.mktemp()
          #self._fileptr = open(self._filename,"w")
@@ -650,7 +714,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          #return iter(self._fileptr)
          #return ListLikeFileIter(self._filename)
          return iter(self._list)
-@@ -69,34 +69,34 @@ class ListLikeFile:
+@@ -69,34 +79,34 @@
  
  def tester():
      x = ListLikeFile()
@@ -711,7 +775,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  # Looking in /usr/local/ir/bin on the Compaqs for the correct Python interpreter.
  # export PYTHONPATH=${PYTHONPATH}:$WORK/cds/IR/COMPASS/src/AtacPipeline
  
-@@ -32,7 +32,7 @@ def createSignedEnumeration(inpfile):
+@@ -32,7 +32,7 @@
              srank = cvm(forwardX == forwardY, p, -p)
              p += 1
              FM.extend['srank'] = srank
@@ -720,7 +784,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          # end if
      # end while
      return outfile
-@@ -91,20 +91,20 @@ def findPerfectRuns ( inpfile, maxJump,
+@@ -91,20 +91,20 @@
                          sorted_by_y = (y_ls <= y_rs)
  
                          if(not(sorted_by_x or sorted_by_y)):
@@ -750,7 +814,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  # endif
                  if(
                      (left.x_scaf_uid != right.x_scaf_uid) or  # check first axis id
-@@ -117,7 +117,7 @@ def findPerfectRuns ( inpfile, maxJump,
+@@ -117,7 +117,7 @@
              # end if
              lastpr = pr
              right.runid = "%s%d" % (runIdPrefix,runid,)   # Assign the run id in the same slot as the signed rank.
@@ -759,7 +823,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              left = right
          # end if
      # end for
-@@ -127,22 +127,22 @@ def findPerfectRuns ( inpfile, maxJump,
+@@ -127,22 +127,22 @@
  def formPerfectRuns ( inpfile, firstSort, secondSort, maxJump, runIdPrefix ):
      inpfile.seek(0)
      step = 0
@@ -786,7 +850,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
      step += 1
      outfile = findPerfectRuns( tmpfile, maxJump, runIdPrefix)
      
-@@ -161,8 +161,8 @@ def runsAsMatches(inpfile):
+@@ -161,8 +161,8 @@
              curF = MatchRecord.MatchRecord(line)
              if ((lastF == None) or (curF.runid != lastF.runid)):
                  if ((lastF != None) and (firstF.x_scaf_uid != lastF.x_scaf_uid)):
@@ -797,7 +861,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  # end if
                  assert((lastF==None) or (firstF.x_scaf_uid == lastF.x_scaf_uid))
                  assert((lastF==None) or (firstF.y_scaf_uid == lastF.y_scaf_uid))
-@@ -187,7 +187,7 @@ def runsAsMatches(inpfile):
+@@ -187,7 +187,7 @@
                      lastF.x_length = endX - startX
                      lastF.y_length = endY - startY
                      lastF.runFill = runFill
@@ -806,7 +870,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  # end if
                  firstF = curF
                  runFill = 0
-@@ -218,14 +218,14 @@ def runsAsMatches(inpfile):
+@@ -218,14 +218,14 @@
          lastF.x_length = endX - startX
          lastF.y_length = endY - startY
          lastF.runFill = runFill
@@ -831,7 +895,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
  import sys
  import MyFile
-@@ -41,10 +41,10 @@ def coalesceMatches ( inpfile, outfile,
+@@ -41,10 +41,10 @@
              assert(py >= 0)
              assert(ny >= 0)
              if (not (not needs_to_share_diagonal or nx == ny)):
@@ -846,7 +910,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              # end if
              assert((hghHitPX == None or (not needs_to_share_diagonal) or nx == ny))
              forward = (curF.x_orientation == curF.y_orientation)
-@@ -81,7 +81,7 @@ def coalesceMatches ( inpfile, outfile,
+@@ -81,7 +81,7 @@
                      firstF.y_start = lowHitPY
                      firstF.x_length = hghHitPX - lowHitPX
                      firstF.y_length = hghHitPY - lowHitPY
@@ -855,7 +919,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  # end if
                  firstF = curF
                  lowHitPX = lowMerPX
-@@ -108,7 +108,7 @@ def coalesceMatches ( inpfile, outfile,
+@@ -108,7 +108,7 @@
          firstF.y_start = lowHitPY
          firstF.x_length = hghHitPX - lowHitPX
          firstF.y_length = hghHitPY - lowHitPY
@@ -864,7 +928,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
      return
  # end def
-@@ -132,7 +132,7 @@ def trimMatchOverlapsInX(inpfile,outfile
+@@ -132,7 +132,7 @@
          if(line[0] == 'M'):
              right = MatchRecord.MatchRecord(line)
              if( right.subtype != trim_subtype):
@@ -873,7 +937,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  continue
              if( left == None or
                  #left.x_scaf_uid < right.x_scaf_uid):
-@@ -142,15 +142,15 @@ def trimMatchOverlapsInX(inpfile,outfile
+@@ -142,15 +142,15 @@
                  assert(left != None)
                  assert(right != None)
                  if(left.x_scaf_uid > right.x_scaf_uid):
@@ -895,7 +959,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                      #assert(0)
  
                  thisbgn = right.x_start
-@@ -177,16 +177,16 @@ def trimMatchOverlapsInX(inpfile,outfile
+@@ -177,16 +177,16 @@
                      contained += 1
                      right = None # remove this match
              if(right != None):
@@ -917,7 +981,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
      return
  
  def trimMatchOverlapsInY(inpfile,outfile, trim_subtype):
-@@ -208,7 +208,7 @@ def trimMatchOverlapsInY(inpfile,outfile
+@@ -208,7 +208,7 @@
          if(line[0] == 'M'):
              right = MatchRecord.MatchRecord(line)
              if( right.subtype != trim_subtype):
@@ -926,7 +990,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  continue
              if( left == None or
                  #left.y_scaf_uid < right.y_scaf_uid):
-@@ -218,15 +218,15 @@ def trimMatchOverlapsInY(inpfile,outfile
+@@ -218,15 +218,15 @@
                  assert(left != None)
                  assert(right != None)
                  if(left.y_scaf_uid > right.y_scaf_uid):
@@ -948,7 +1012,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                      #assert(0)
  
                  thisbgn = right.y_start
-@@ -253,16 +253,16 @@ def trimMatchOverlapsInY(inpfile,outfile
+@@ -253,16 +253,16 @@
                      contained += 1
                      right = None # remove this match
              if(right != None):
@@ -978,7 +1042,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
  import os, sys, time, tempfile
  import MyFile
-@@ -19,7 +19,7 @@ def xorIntervals( inpname, outname):
+@@ -19,7 +19,7 @@
          rghtSide = min(newstart,rghtPicket)
          if rghtSide > leftPicket:
              # interval has positive length
@@ -987,7 +1051,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          leftPicket = max(newstart,  min(rightPicket,newend))
          rghtPicket = max(leftPicket,max(rightPicket,newend))
  
-@@ -35,10 +35,10 @@ def findUniformCoverageIntervals(inpfile
+@@ -35,10 +35,10 @@
          if(recordtype == "E"):
              newposition = int(newposition)
              newchange = int(newchange)
@@ -1000,7 +1064,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              cov += newchange;
              assert(cov >= 0)
              oldaxis = newaxis; oldposition = newposition;
-@@ -65,18 +65,18 @@ def findCoverageIntervals( inpfile, outf
+@@ -65,18 +65,18 @@
                      axis = fields[8]
                      bgn = int(fields[9])
                      end = bgn+int(fields[10])
@@ -1024,7 +1088,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
      tmpfile4.close()
      os.system("rm -f " + tmpname)
      outfile.seek(0)
-@@ -111,7 +111,7 @@ def applyOneKeepMask( inpfile, outfile,
+@@ -111,7 +111,7 @@
      try:   # StopIteration exception from either iterator gets us out
          while 1:
              if(iline == None):
@@ -1033,7 +1097,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  (subtype, qa, qs, ql, cov, ) = iline.split()
                  assert(subtype=='C')
                  cov= int(cov)
-@@ -123,10 +123,10 @@ def applyOneKeepMask( inpfile, outfile,
+@@ -123,10 +123,10 @@
                  qe = qs + ql
  
              if(mline == None):
@@ -1046,7 +1110,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                      mline = None
                      continue
                  FM = MatchRecord.MatchRecord(mline)
-@@ -177,8 +177,8 @@ def applyOneKeepMask( inpfile, outfile,
+@@ -177,8 +177,8 @@
                  FT.x_length = trimmedLength
                  FT.y_length = trimmedLength
                  if debug:
@@ -1057,7 +1121,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
                  # We must insure that the match identifier is still unique.
                  if last_matchid == FM.matchid :
-@@ -194,7 +194,7 @@ def applyOneKeepMask( inpfile, outfile,
+@@ -194,7 +194,7 @@
                      else:
                          FT.matchid = FT.matchid + "y" + str(subcount)
                  
@@ -1066,7 +1130,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  # we need to get a new one
                  if(qe < me):
                      iline = None
-@@ -205,7 +205,7 @@ def applyOneKeepMask( inpfile, outfile,
+@@ -205,7 +205,7 @@
          # If there are any left over non-match lines, then output them!
          for mline in inpiter:
              if(mline[0] != "M"):
@@ -1075,7 +1139,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
  def applyBothKeepMasks( inpfile, outfile ):
  
-@@ -238,7 +238,7 @@ def applyBothKeepMasks( inpfile, outfile
+@@ -238,7 +238,7 @@
      findCoverageIntervals( inpfile, keepMaskFile, processFirstAxis)
      if debug:
          debugnum += 1; debugfile = open("debugfile.%d" % debugnum, "w")
@@ -1084,7 +1148,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              
      MatchRecord.sortInXorderAP(tmpfile2,tmpfile3)
      if debug:
-@@ -247,13 +247,13 @@ def applyBothKeepMasks( inpfile, outfile
+@@ -247,13 +247,13 @@
          #for line in tmpfile2: print >>debugfile, line,
          tmpfile3.seek(0)
          debugnum += 1; debugfile = open("debugfile.%d" % debugnum, "w")
@@ -1100,7 +1164,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          
      # Apply the keepMask for the second axis.
      # Make the sorted the keep mask intervals for the second axis.
-@@ -266,7 +266,7 @@ def applyBothKeepMasks( inpfile, outfile
+@@ -266,7 +266,7 @@
      findCoverageIntervals( inpfile, keepMaskFile, processFirstAxis)
      if debug:
          debugnum += 1; debugfile = open("debugfile.%d" % debugnum, "w")
@@ -1109,7 +1173,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
  
      MatchRecord.sortInYorderAP(tmpfile2,tmpfile3)
-@@ -276,13 +276,13 @@ def applyBothKeepMasks( inpfile, outfile
+@@ -276,13 +276,13 @@
          #for line in tmpfile2: print >>debugfile, line,
          tmpfile3.seek(0)
          debugnum += 1; debugfile = open("debugfile.%d" % debugnum, "w")
@@ -1133,7 +1197,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
  # dedashMatches.py /prod/IR02/synteny/mus-vs-rat/mouse_celera_R13_chr_20030210-vs-rat_celera_R1_chr_20030507-V3.atac.t20.l100.br.squeezed.filled.coalesced mus-vs-rat.out /prod/IR05/GENOMES/mouse_celera_R13_chr_20030210 /prod/IR05/GENOMES/rat_celera_R1_chr_20030507 MR13 RR1
  
-@@ -32,7 +32,7 @@ def subc():
+@@ -32,7 +32,7 @@
      suba()
      it = iter(subb,None)
      for y in it:
@@ -1142,7 +1206,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
  def main( inpfile, outfile, xIdx, yIdx):
      inpfile.seek(0)
-@@ -42,7 +42,7 @@ def main( inpfile, outfile, xIdx, yIdx):
+@@ -42,7 +42,7 @@
      for line in inpfile:
          lineCount += 1
          if((lineCount % 10000)==0):
@@ -1151,7 +1215,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          if(line[0] == 'M'):
              FM = MatchRecord.MatchRecord(line)
              if(FM.subtype == 'g'):
-@@ -87,11 +87,11 @@ def main( inpfile, outfile, xIdx, yIdx):
+@@ -87,11 +87,11 @@
                              mismatches += 1
                      FM.extend['mm'] = str(mismatches)
                      FM.identifier = ""  # BEWARE
@@ -1174,7 +1238,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
  import sys
  import string
-@@ -9,7 +9,7 @@ import halign
+@@ -9,7 +9,7 @@
  #import shelve
  
  # True=1
@@ -1183,7 +1247,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
  def analyzeGap(x,y,left,right,outfile,maxgap,erate,margin):
      inter_run_gap_count = 0
-@@ -33,20 +33,20 @@ def analyzeGap(x,y,left,right,outfile,ma
+@@ -33,20 +33,20 @@
          sorted_by_y = (left.y_start <= right.y_start) and \
                        (left.y_start+left.y_length <= right.y_start+right.y_length)
          if(not(sorted_by_x or sorted_by_y)):
@@ -1213,7 +1277,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          assert((not left_forward) or (sorted_by_x and sorted_by_y))
          assert((left_forward) or (not(sorted_by_x and sorted_by_y)))
  
-@@ -104,10 +104,10 @@ def analyzeGap(x,y,left,right,outfile,ma
+@@ -104,10 +104,10 @@
              parent_y_length = y_len + 2*margin
  
              if 0:
@@ -1228,7 +1292,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
              x_seq = ""
              if(x_len > 0):
-@@ -123,13 +123,13 @@ def analyzeGap(x,y,left,right,outfile,ma
+@@ -123,13 +123,13 @@
              # end if
  
              if 0:
@@ -1249,7 +1313,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  outfile.flush()
  
              try:
-@@ -156,34 +156,34 @@ def analyzeGap(x,y,left,right,outfile,ma
+@@ -156,34 +156,34 @@
                      assert(bgn1 >= 0)
                      assert(bgn2 >= 0)
                      if(not(bgn1 + len1 <= parent_x_length)):
@@ -1302,7 +1366,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                          continue
                      assert(bgn1 >= 0)
                      assert(bgn2 >= 0)
-@@ -218,11 +218,11 @@ def analyzeGap(x,y,left,right,outfile,ma
+@@ -218,11 +218,11 @@
                      #assert(bgn2+len2 <= parent_y_length)
  
                      if 0:
@@ -1319,7 +1383,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
                      halign.halignStart(x_seq[bgn1:bgn1+len1], y_seq[bgn2:bgn2+len2])
                      outfile.flush()
-@@ -246,20 +246,20 @@ def analyzeGap(x,y,left,right,outfile,ma
+@@ -246,20 +246,20 @@
                                  mismatches += 1
                          FM.extend['mm'] = str(mismatches)
                          #FM.identifier = ""  # BEWARE
@@ -1350,7 +1414,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          # end if
  
      else:
-@@ -291,7 +291,7 @@ def mainLoop( inpfile, outfile, xIdx, yI
+@@ -291,7 +291,7 @@
      for line in inpfileIter:
          if(line[0] == 'M'):
              left = MatchRecord.MatchRecord(line)
@@ -1359,7 +1423,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              countLines += 1
              break;
  
-@@ -311,7 +311,7 @@ def mainLoop( inpfile, outfile, xIdx, yI
+@@ -311,7 +311,7 @@
                  inter_run_gap_count_total += inter_run_gap_count
  
                  # Output the record which was possibly trimmed.
@@ -1368,7 +1432,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
                  countLines += 1
                  left = right
          # end if
-@@ -330,9 +330,9 @@ def main( inpname, outname):
+@@ -330,9 +330,9 @@
      assemblyFilePrefix1 = obj.globals['assemblyFilePrefix1']
      assemblyFilePrefix2 = obj.globals['assemblyFilePrefix2']
  
@@ -1388,7 +1452,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  # Must look in /usr/local/ir/bin on the Compaqs for the correct Python interpreter.
  # export PYTHONPATH=${PYTHONPATH}:$WORK/cds/IR/COMPASS/src/AtacPipeline
  
-@@ -19,7 +19,7 @@ def main(glist):
+@@ -19,7 +19,7 @@
              pattern = re.compile(r"^M [gl] ")
              for line in inpfile:
                  if(pattern.search(line)):
@@ -1397,7 +1461,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              tmpfile.close()
              os.system("celagram -c 7 -t 'gapped match lengths' %s" % (tmpname,))
  
-@@ -30,7 +30,7 @@ def main(glist):
+@@ -30,7 +30,7 @@
              pattern = re.compile(r"^M x ")
              for line in inpfile:
                  if(pattern.search(line)):
@@ -1406,7 +1470,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              tmpfile.close()
              os.system("celagram -c 7 -t 'exact match lengths' %s" % (tmpname,))
  
-@@ -41,7 +41,7 @@ def main(glist):
+@@ -41,7 +41,7 @@
              pattern = re.compile(r"^M u ")
              for line in inpfile:
                  if(pattern.search(line)):
@@ -1415,7 +1479,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              tmpfile.close()
              os.system("celagram -c 7 -t 'ungapped match lengths' %s" % (tmpname,))
  
-@@ -52,7 +52,7 @@ def main(glist):
+@@ -52,7 +52,7 @@
          pattern = re.compile(r"^M [xu] ")
          for line in inpfile:
              if(pattern.search(line)):
@@ -1424,7 +1488,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          tmpfile.close()
          os.system("celagram -c 7 -t '%s ungapped match lengths' %s" % (inpname,tmpname))
  
-@@ -63,7 +63,7 @@ def main(glist):
+@@ -63,7 +63,7 @@
          pattern = re.compile(r"^M\s*r\s")
          for line in inpfile:
              if(pattern.search(line)):
@@ -1441,7 +1505,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
  import sys
  import string
-@@ -9,7 +9,7 @@ import IdxStore
+@@ -9,7 +9,7 @@
  #import shelve
  
  # True=1
@@ -1450,7 +1514,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
          
  theIsolatedSNPcount = 0
-@@ -52,30 +52,30 @@ def analyzeGap(x,y,left,right,outfile,ma
+@@ -52,30 +52,30 @@
          sorted_by_y = (left.y_start <= right.y_start)
          dovetail_in_y = sorted_by_y and (left.y_start+left.y_length <= right.y_start+right.y_length)
          if(not(sorted_by_x or sorted_by_y)):
@@ -1496,7 +1560,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          assert((not left_forward) or (sorted_by_x and sorted_by_y))
          assert((left_forward) or (not(sorted_by_x and sorted_by_y)))
  
-@@ -157,19 +157,19 @@ def analyzeGap(x,y,left,right,outfile,ma
+@@ -157,19 +157,19 @@
              sys.stderr.write("x string lengths mismatch asked=%d got=%d\n" % (x_len,len(x_substring)))
              sys.stderr.write("x_uid= %s x_pos= %d x_len= %d y_uid= %s y_pos= %d y_len= %d\n" %
                                         (left.x_scaf_uid,x_pos,x_len,left.y_scaf_uid,y_pos,y_len))
@@ -1524,7 +1588,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          # end if
          
          assert(x_len < 0 or x_len == len(x_substring))
-@@ -357,7 +357,7 @@ def analyzeGap(x,y,left,right,outfile,ma
+@@ -357,7 +357,7 @@
                  # end if
              # end if
              # outfile.write(str(left_fill))
@@ -1533,7 +1597,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          # end if
          if(rp>0):
              right_fill = right.copy()
-@@ -386,7 +386,7 @@ def analyzeGap(x,y,left,right,outfile,ma
+@@ -386,7 +386,7 @@
                  # end if
              # end if
              #outfile.write(str(right_fill))
@@ -1542,7 +1606,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
          # end if
          
          if(0): # Start gap composition diagnostics.
-@@ -447,7 +447,7 @@ def mainLoop( inpfile, outfile, xIdx, yI
+@@ -447,7 +447,7 @@
          if(line[0] == 'M'):
              left = MatchRecord.MatchRecord(line)
              # outfile.write(str(left))
@@ -1551,7 +1615,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
              countLines += 1
              break;
  
-@@ -470,7 +470,7 @@ def mainLoop( inpfile, outfile, xIdx, yI
+@@ -470,7 +470,7 @@
  
              # Output the record which was possibly trimmed.
              #outfile.write(str(right))
@@ -1578,7 +1642,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  #                 '-I' + sysconfig.get_python_inc(plat_specific=True)]
 --- a/configure.sh
 +++ b/configure.sh
-@@ -80,14 +80,14 @@ fi
+@@ -80,14 +80,14 @@
  #  used by atac-driver/chainer only.
  #
  
@@ -1598,7 +1662,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
      echo "WARNING:  Python development environment not found."
 --- a/atac-driver/chainer/localalign/localAlignerInterfacemodule.C
 +++ b/atac-driver/chainer/localalign/localAlignerInterfacemodule.C
-@@ -227,8 +227,17 @@ registration_table[] = {
+@@ -227,8 +227,17 @@
  };
  
  
@@ -1620,7 +1684,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
 --- a/atac-driver/chainer/halign/halignmodule.C
 +++ b/atac-driver/chainer/halign/halignmodule.C
-@@ -54,7 +54,16 @@ registration_table[] = {
+@@ -54,7 +54,16 @@
    {NULL, NULL, 0, NULL}
  };
  
@@ -1641,7 +1705,7 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  }
 --- a/atac-driver/atac.pl
 +++ b/atac-driver/atac.pl
-@@ -732,7 +732,7 @@ sub makeChains {
+@@ -732,7 +732,7 @@
      #
      $ENV{'PYTHONPATH'} = "$LIBdir";
  


=====================================
debian/rules
=====================================
@@ -29,6 +29,8 @@ override_dh_auto_build:
 	    CXXLDFLAGS="$(LDFLAGS)"
 #	    WITHOUT="$(unusable)"
 	mv installdir/bin/atac.pl installdir/bin/atac
+	mv -v installdir/lib/halignmodule.so installdir/lib/halign.so
+	mv -v installdir/lib/localAlignerInterfacemodule.so installdir/lib/localAlignerInterface.so
 
 override_dh_auto_clean:
 	$(MAKE) real-clean



View it on GitLab: https://salsa.debian.org/med-team/kmer/-/commit/955305ccc8d8885e3f1451ffbd2de113435c73ab

-- 
View it on GitLab: https://salsa.debian.org/med-team/kmer/-/commit/955305ccc8d8885e3f1451ffbd2de113435c73ab
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200518/731b6a11/attachment-0001.html>


More information about the debian-med-commit mailing list