diff -Nru smalt-0.7.6/debian/changelog smalt-0.7.6/debian/changelog --- smalt-0.7.6/debian/changelog 2018-10-24 19:08:08.000000000 +0000 +++ smalt-0.7.6/debian/changelog 2020-01-03 10:44:39.000000000 +0000 @@ -1,3 +1,23 @@ +smalt (0.7.6-9) unstable; urgency=medium + + * Team upload. + + [ Andreas Tille ] + * Use 2to3 to port to Python3 + Closes: #938501 + * debhelper-compat 12 + * Standards-Version: 4.4.1 + * Remove trailing whitespace in debian/changelog + * Use secure URI in debian/watch. + * Use secure URI in Homepage field. + * Set upstream metadata fields: Archive, Bug-Submit. + * autopkgtest: s/ADTTMP/AUTOPKGTEST_TMP/g + + [ Michael R. Crusoe ] + * Fixed the remaining Python3 issues in test scripts + + -- Michael R. Crusoe Fri, 03 Jan 2020 11:44:39 +0100 + smalt (0.7.6-8) unstable; urgency=medium * debhelper 11 @@ -46,7 +66,7 @@ smalt (0.7.6-4) unstable; urgency=medium * cme fix dpkg-control - * Use autotools-dev / since dh-autoreconf does not work this hopefully also + * Use autotools-dev / since dh-autoreconf does not work this hopefully also Closes: #765256 -- Andreas Tille Tue, 14 Oct 2014 13:33:15 +0200 diff -Nru smalt-0.7.6/debian/compat smalt-0.7.6/debian/compat --- smalt-0.7.6/debian/compat 2018-10-24 19:08:08.000000000 +0000 +++ smalt-0.7.6/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -11 diff -Nru smalt-0.7.6/debian/control smalt-0.7.6/debian/control --- smalt-0.7.6/debian/control 2018-10-24 19:08:08.000000000 +0000 +++ smalt-0.7.6/debian/control 2020-01-03 10:44:39.000000000 +0000 @@ -3,15 +3,15 @@ Uploaders: Andreas Tille Section: science Priority: optional -Build-Depends: debhelper (>= 11~), +Build-Depends: debhelper-compat (= 12), zlib1g-dev, - python, + python3, samtools, libbambamc-dev -Standards-Version: 4.2.1 +Standards-Version: 4.4.1 Vcs-Browser: https://salsa.debian.org/med-team/smalt Vcs-Git: https://salsa.debian.org/med-team/smalt.git -Homepage: http://www.sanger.ac.uk/science/tools/smalt-0 +Homepage: https://www.sanger.ac.uk/science/tools/smalt-0 Package: smalt Architecture: any @@ -41,8 +41,7 @@ Package: smalt-examples Architecture: all -Depends: ${shlibs:Depends}, - ${misc:Depends} +Depends: ${misc:Depends} Description: Sequence Mapping and Alignment Tool (examples) SMALT efficiently aligns DNA sequencing reads with a reference genome. Reads from a wide range of sequencing platforms, for example Illumina, diff -Nru smalt-0.7.6/debian/patches/2to3.patch smalt-0.7.6/debian/patches/2to3.patch --- smalt-0.7.6/debian/patches/2to3.patch 1970-01-01 00:00:00.000000000 +0000 +++ smalt-0.7.6/debian/patches/2to3.patch 2020-01-03 10:37:07.000000000 +0000 @@ -0,0 +1,392 @@ +Description: Use 2to3 to port to Python3 +Bug-Debian: https://bugs.debian.org/938501 +Author: Andreas Tille +Last-Update: Thu, 05 Sep 2019 15:07:37 +0200 + +--- smalt.orig/misc/SAM.py ++++ smalt/misc/SAM.py +@@ -85,7 +85,7 @@ + self.tags[tagnam] = (typ, fld) + self.ok = True + else: +- if is_verbose: print "NOT PARSED '%s'" % lin ++ if is_verbose: print("NOT PARSED '%s'" % lin) + self.blank() + + def clip(self): +@@ -106,7 +106,7 @@ + return (typ, isCorrect, s, e) + + def strand(self): +- print "(%i, %s)" % (self.flag, bool(self.flag & Sam.FLAG_STRAND)) ++ print("(%i, %s)" % (self.flag, bool(self.flag & Sam.FLAG_STRAND))) + return bool(self.flag & Sam.FLAG_STRAND) + + def calcUnclippedStart(self): +@@ -207,7 +207,7 @@ + if bool(self.flag & Sam.FLAG_STRAND): + (seq, qual, okflg) = self.reverseComplement() + if not okflg: +- print "ERROR: when reverse complementing sequence!" ++ print("ERROR: when reverse complementing sequence!") + exit(1) + else: + seq = self.nt +@@ -218,7 +218,7 @@ + def asFastq(self, clip=0): + namstr, seq, qual = self.asFastqStr() + if clip >= len(self.nt): +- print "ERROR: clipped fragment > sequence length\n%s" % (self.qname) ++ print("ERROR: clipped fragment > sequence length\n%s" % (self.qname)) + return Sam.FASTQ_FORMAT % (namstr, seq[clip:], qual[clip:]) + + def reverseComplement(self): +@@ -245,7 +245,7 @@ + if not lin: break + self.parse(lin, is_verbose) + if self.ok: break +- if is_verbose: print "not parsed: %s" % lin ++ if is_verbose: print("not parsed: %s" % lin) + return not lin # True if EOF + + +@@ -259,7 +259,7 @@ + break + read.parse(lin) + if not read.ok: +- print "not parsed: %s" % lin ++ print("not parsed: %s" % lin) + continue + break + #print read.target.varnum() +@@ -291,8 +291,8 @@ + errflg = True + + if errflg: +- print "ERROR: unexpected pair flags.\n%s\n%s\n%s\n%s" % \ +- (samA.qname, samA.strFlags(), samB.qname, samB.strFlags()) ++ print("ERROR: unexpected pair flags.\n%s\n%s\n%s\n%s" % \ ++ (samA.qname, samA.strFlags(), samB.qname, samB.strFlags())) + exit(1) + + return (isEOF, switch_flag) +@@ -307,7 +307,7 @@ + else: + oufil = open(filnam, mode) + except: +- print "ERROR when opening file '%s'" % filnam ++ print("ERROR when opening file '%s'" % filnam) + exit(1) + + return oufil +@@ -316,7 +316,7 @@ + from sys import argv, exit + + if len(argv) < 3: +- print "usage: %s " % argv[0] ++ print("usage: %s " % argv[0]) + exit(1) + + infilnam = argv[1] +@@ -360,36 +360,36 @@ + if mnam == old_qnam: + if read.rname != old_rnam: + chimictr = chimictr + 1 +- print "[%i, %i]%s: rname1: %s, rname2: %s" % \ +- (readctr, chimictr, mnam, old_rnam, read.rname) ++ print("[%i, %i]%s: rname1: %s, rname2: %s" % \ ++ (readctr, chimictr, mnam, old_rnam, read.rname)) + + else: + # a 'proper' pair +- print "%s %i %i %x" % (read.qname, abs(read.isize), read.mapq, int(read.flag)) ++ print("%s %i %i %x" % (read.qname, abs(read.isize), read.mapq, int(read.flag))) + propctr = propctr + 1 + isizarr.append(abs(read.isize)) + else: + lowqctr = lowqctr + 1 + if readctr % 100000 == 0: +- print "%i reads ..." % readctr ++ print("%i reads ..." % readctr) + pairctr = pairctr/2 + + infil.close() + +- print "%i out of a total of %i reads (%5.2f%%) were mapped." % \ +- (readctr - nomapctr, readctr, 100*float(readctr - nomapctr)/readctr) +- print "%i out of a total of %i reads (%5.2f%%) mapped with a mapping score > %i" % \ +- (minqctr, readctr, 100*float(minqctr)/readctr, Sam.MAPQ_NONRANDOM) ++ print("%i out of a total of %i reads (%5.2f%%) were mapped." % \ ++ (readctr - nomapctr, readctr, 100*float(readctr - nomapctr)/readctr)) ++ print("%i out of a total of %i reads (%5.2f%%) mapped with a mapping score > %i" % \ ++ (minqctr, readctr, 100*float(minqctr)/readctr, Sam.MAPQ_NONRANDOM)) + if Sam.MAPQ_NONRANDOM != mapq_min: +- print "%i out of a total of %i reads (%5.2f%%) mapped with a mapping score > %i" % \ +- (highqctr, readctr, 100*float(highqctr)/readctr, mapq_min) ++ print("%i out of a total of %i reads (%5.2f%%) mapped with a mapping score > %i" % \ ++ (highqctr, readctr, 100*float(highqctr)/readctr, mapq_min)) + + if pairctr > 0: +- print "%i out of a total of %i reads (%5.2f%%) mapped as a proper pair with a mapping score > %i" % \ +- (propctr, readctr, 100*float(propctr)/readctr, mapq_min) +- print "%i of %i pairs (%6.3f%%) with a mapping score >= %i mapped to different chromosomes" % \ +- (chimictr, pairctr, 200*float(chimictr)/pairctr, mapq_min) ++ print("%i out of a total of %i reads (%5.2f%%) mapped as a proper pair with a mapping score > %i" % \ ++ (propctr, readctr, 100*float(propctr)/readctr, mapq_min)) ++ print("%i of %i pairs (%6.3f%%) with a mapping score >= %i mapped to different chromosomes" % \ ++ (chimictr, pairctr, 200*float(chimictr)/pairctr, mapq_min)) + else: +- print "There were no reads mapped as pairs." ++ print("There were no reads mapped as pairs.") + + exit(0) +--- smalt.orig/test/bam_cigar_test.py ++++ smalt/test/bam_cigar_test.py +@@ -142,30 +142,30 @@ + def testSAMfilesAreIdentical(filnamA, filnamB): + from testdata import openFile + +- infilA = openFile(filnamA) +- infilB = openFile(filnamB) ++ infilA = openFile(filnamA, 'rb') ++ infilB = openFile(filnamB, 'rb') + + while 1: + linA = infilA.readline() +- if not linA or linA[0]!="@": ++ if not linA or linA[0]!= 64: # same as b"@" + break + + while 1: + linB = infilB.readline() +- if not linB or linB[0]!="@": ++ if not linB or linB[0]!= 64: # same as b"@" + break + + okflg = False + + while linA and linB: +- fldA = linA.split('\t') +- fldB = linB.split('\t') ++ fldA = linA.split(b'\t') ++ fldB = linB.split(b'\t') + + okflg = len(fldA) == len(fldB) + + if not okflg: +- print "lines differ in the number of fields:\n%s\n%s\n" % \ +- (linA.strip(), linB.strip()) ++ print("lines differ in the number of fields:\n%s\n%s\n" % \ ++ (linA.strip(), linB.strip())) + break + + for i in SAM_TEST_FIELDS.keys(): +@@ -175,8 +175,8 @@ + # directly after header + okflg = fldA[i][1:] == fldB[i] or fldA[i] == fldB[i][1:] + if not okflg: +- print "lines differ in %s:\n%s\n%s\n" % \ +- (SAM_TEST_FIELDS[i], linA.strip(), linB.strip()) ++ print("lines differ in %s:\n%s\n%s\n" % \ ++ (SAM_TEST_FIELDS[i], linA.strip(), linB.strip())) + break + if not okflg: + break +--- smalt.orig/test/formats.py ++++ smalt/test/formats.py +@@ -24,6 +24,7 @@ + # # + ############################################################################# + ############################################################################# ++from operator import ne + + class Cigar: + from re import compile +@@ -45,9 +46,9 @@ + self.parse(lin) + okflg = self.ok + if Cigar.DEBUG: +- print "DEBUG:Cigar.next %s" % (okflg) ++ print("DEBUG:Cigar.next %s" % (okflg)) + if Cigar.DEBUG: +- print "DEBUG:Cigar.next returns %s" % (isEOF) ++ print("DEBUG:Cigar.next returns %s" % (isEOF)) + return isEOF + + def parse(self, lin): +@@ -66,11 +67,11 @@ + self.cigar.strip() + self.ok = True + if Cigar.DEBUG: +- print "DEBUG:Cigar.parse('%s')::'%s'" % (self.lin, self.cigar) ++ print("DEBUG:Cigar.parse('%s')::'%s'" % (self.lin, self.cigar)) + else: + lin.strip() + if lin[0] != '#': +- print "not parsed: %s" % (lin) ++ print("not parsed: %s" % (lin)) + self._blank() + + def getMateNo(self): +@@ -101,6 +102,15 @@ + if rv: return rv + + return cmp(other.sseg[1], self.sseg[1]) ++ ++ def __ne__(self, other): ++ rv = ne(self.snam, other.snam) ++ if rv: return rv ++ ++ rv = ne(self.sseg[0], other.sseg[0]) ++ if rv: return rv ++ ++ return ne(other.sseg[1], self.sseg[1]) + + def getNextCigarPair(infil, cigA, cigB, mateno_check = True): + isOk = False +@@ -118,10 +128,10 @@ + isOk = True + if not isEOF and mateno_check: + if cigA.qnam[-2] != cigB.qnam[-2]: +- print "ERROR: read names don't match %s, %s" % (cigA.qnam, cigB.qnam) ++ print("ERROR: read names don't match %s, %s" % (cigA.qnam, cigB.qnam)) + isOk = False + elif cigA.getMateNo() != 1 or cigB.getMateNo() != 2: +- print "ERROR in mate number %s [1] and %s [2]" % (cigA.qnam, cigB.qnam) ++ print("ERROR in mate number %s [1] and %s [2]" % (cigA.qnam, cigB.qnam)) + isOk = False + + return (isOk, isEOF) +@@ -151,6 +161,6 @@ + infil = openFile(argv[1]) + + while not cig.next(infil): +- print cig.qnam ++ print(cig.qnam) + + infil.close() +--- smalt.orig/test/mthread_test.py ++++ smalt/test/mthread_test.py +@@ -57,12 +57,12 @@ + break + if cigA1 != cigB1: + if is_verbose: +- print "Not matching:\n%s\n%s" % (cigA1.lin, cigB1.lin) ++ print("Not matching:\n%s\n%s" % (cigA1.lin, cigB1.lin)) + if cigA1.mapq > MAPQ_THRESH and cigB1.mapq > MAPQ_THRESH: +- exit("Discrepancy:\n%s\n%s" % (cigA1.lin, cigB1.lin)) ++ exit("Discrepancy:\n%s\n%s\ncigA1.mapq=%i > MAPQ_THRESH=%i and cigB1.mapq=%i > MAPQ_THRESH=%i" % (cigA1.lin, cigB1.lin, cigA1.mapq, MAPQ_THRESH, cigB1.mapq, MAPQ_THRESH)) + if cigA2 != cigB2: + if is_verbose: +- print "Not matching:\n%s\n%s" % (cigA2.lin, cigB2.lin) ++ print("Not matching:\n%s\n%s" % (cigA2.lin, cigB2.lin)) + if cigA2.mapq > MAPQ_THRESH and cigB2.mapq > MAPQ_THRESH: + exit("Discrepancy:\n%s\n%s" % (cigA2.lin, cigB2.lin)) + ctr = ctr + 1 +@@ -93,7 +93,7 @@ + + isOK, pairctr = cmpCigarFiles(oufilnam_ref, oufilnam_thread, VERBOSE) + if VERBOSE: +- print "Test ok=%s, number of pairs = %i" % (isOK, pairctr) ++ print("Test ok=%s, number of pairs = %i" % (isOK, pairctr)) + if not isOK or pairctr != n_pairs_expected: + exit("Using smalt in multi-threaded mode gave inconsistent results!") + +--- smalt.orig/test/results_split_test.py ++++ smalt/test/results_split_test.py +@@ -35,7 +35,7 @@ + "AAAAGAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA\n"\ + "+\n"\ + "daBZddeYdBfe`fBf`ecfdfcf`c\eacXdbLe^b``ccadK]e]^_T"\ +- "fccbcd\Tffb^Yfdfdf^efa\[fbfdad`X\Ue_^eBfcfcfNfdf^!\n" ++ "fccbcd\Tffb^Yfdfdf^efa\[fbfdad`X\\Ue_^eBfcfcfNfdf^!\n" + ) + + # cigar:S:16 SIM_000000000_contig5121_000000001_5120_R_20m/1 20 1 - contig5121 1 20 + 20 M 20 +--- smalt.orig/test/splitReads_test.py ++++ smalt/test/splitReads_test.py +@@ -79,13 +79,13 @@ + while not cig.next(infil): + if linctr > n_tup: + allok = False +- print "ERROR: %i cigar lines, expected %i" % \ +- (linctr, n_tup) ++ print("ERROR: %i cigar lines, expected %i" % \ ++ (linctr, n_tup)) + break + mateno = cig.getMateNo() + observed_tup = (cig.mapcls, mateno, cig.qseg, cig.snam, cig.sseg) + if observed_tup not in expected_tup: +- print "ERROR: unexpected tuple: ", observed_tup ++ print("ERROR: unexpected tuple: ", observed_tup) + allok = False + break + +@@ -94,7 +94,7 @@ + + for i in range(n_tup): + if not okflgs[i]: +- print "ERROR: could not find tuple: ", expected_tup[i] ++ print("ERROR: could not find tuple: ", expected_tup[i]) + allok = False + + if not allok: +--- smalt.orig/test/testdata.py ++++ smalt/test/testdata.py +@@ -62,7 +62,7 @@ + if len(filnam) < 4 or filnam[-3:] != '.gz': fn_from = fn_from + '.gz' + fn_to = path.join(DataFiles.WORKDIR, filnam) + infil = openFile(fn_from, 'r') +- oufil = openFile(fn_to, 'w') ++ oufil = openFile(fn_to, 'wb') + self.logfil_out.write("unpacking '%s' -> '%s'\n" % (fn_from, fn_to)) + while 1: + lin = infil.readline() +@@ -139,9 +139,9 @@ + for filnam in (self.datafiles + self.tmpfiles): + if access(filnam, F_OK): + remove(filnam) +- if is_verbose: print "Removed file '%s'" % filnam ++ if is_verbose: print("Removed file '%s'" % filnam) + else: +- print "Could not access file '%s'" % filnam ++ print("Could not access file '%s'" % filnam) + self.datafiles = [] + self.tmpfiles = [] + try: +@@ -159,7 +159,7 @@ + else: + oufil = open(filnam, mode) + except: +- print "ERROR when opening file '%s'" % filnam ++ print("ERROR when opening file '%s'" % filnam) + exit(1) + + return oufil +--- smalt.orig/test/sample_test.py ++++ smalt/test/sample_test.py +@@ -1,5 +1,7 @@ + # test sampling of insert lengths + ++from operator import ne ++ + PROGNAM = "../src/smalt" + REF_FASTA_NAME = "genome_1.fa.gz" + READ_PREFIX = "gen1l75i300e0" +@@ -105,12 +107,12 @@ + break + ctr2 = ctr2 + 1 + +- if cmp(cig1.qnam, cig2.qnam): ++ if ne(cig1.qnam, cig2.qnam): + exit("readnames don't match: '%s' vs '%s'" % \ + (cig1.qnam, cig2.qnam)) +- if cmp(cig1,cig2) and cig1.mapq > 5 and cig2.mapq > 5: +- exit("mappings don't match for read '%s'" % \ +- cig1.qnam) ++ if ne(cig1,cig2) and cig1.mapq > 5 and cig2.mapq > 5: ++ exit("mappings don't match for read '{}'; cig1: {}, cig2: {}, sig1.mapq: {}, sig2.mapq: {}".format( ++ cig1.qnam, cig1, cig2, cig1.mapq, cig2.mapq)) + infil2.close() + infil1.close() + diff -Nru smalt-0.7.6/debian/patches/series smalt-0.7.6/debian/patches/series --- smalt-0.7.6/debian/patches/series 2018-10-24 19:08:08.000000000 +0000 +++ smalt-0.7.6/debian/patches/series 2019-12-25 12:03:01.000000000 +0000 @@ -1,2 +1,3 @@ #bam_cigar_test_makefile.patch #try_to_fix_automake.patch +2to3.patch diff -Nru smalt-0.7.6/debian/tests/run-unit-test smalt-0.7.6/debian/tests/run-unit-test --- smalt-0.7.6/debian/tests/run-unit-test 2018-10-24 19:08:08.000000000 +0000 +++ smalt-0.7.6/debian/tests/run-unit-test 2020-01-03 10:41:01.000000000 +0000 @@ -2,11 +2,11 @@ #debug=1 -if [ "$ADTTMP" = "" ] ; then - ADTTMP=`mktemp -d /tmp/smalt-test.XXXXXX` +if [ "$AUTOPKGTEST_TMP" = "" ] ; then + AUTOPKGTEST_TMP=`mktemp -d /tmp/smalt-test.XXXXXX` fi -cd $ADTTMP -cp -a /usr/share/doc/smalt/test/* $ADTTMP +cd $AUTOPKGTEST_TMP +cp -a /usr/share/doc/smalt/test/* $AUTOPKGTEST_TMP gunzip *.py.gz data/*.bam.gz TESTS="splitReads_test.py @@ -35,7 +35,7 @@ #python $tst #rm -f smalt_Xali_test else - python $tst + python3 $tst fi done diff -Nru smalt-0.7.6/debian/upstream/metadata smalt-0.7.6/debian/upstream/metadata --- smalt-0.7.6/debian/upstream/metadata 2018-10-24 19:08:08.000000000 +0000 +++ smalt-0.7.6/debian/upstream/metadata 2019-12-25 11:45:26.000000000 +0000 @@ -5,3 +5,7 @@ Entry: SCR_000544 - Name: bio.tools Entry: Smalt + - Name: conda:bioconda + Entry: smalt +Archive: SourceForge +Bug-Submit: hp3@sanger.ac.uk diff -Nru smalt-0.7.6/debian/watch smalt-0.7.6/debian/watch --- smalt-0.7.6/debian/watch 2018-10-24 19:08:08.000000000 +0000 +++ smalt-0.7.6/debian/watch 2019-12-25 11:45:26.000000000 +0000 @@ -1,2 +1,2 @@ version=3 -http://sf.net/smalt/smalt-(\d[\d\.]+)\.(?:tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) +https://sf.net/smalt/smalt-(\d[\d\.]+)\.(?:tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))