Skip to content
Commits on Source (8)
smalt (0.7.6-9) UNRELEASED; urgency=medium
* Use 2to3 to port to Python3
Closes: #938501
* debhelper-compat 12
* Standards-Version: 4.4.0
* 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.
TODO: Fix some Python3 issues in test scripts
-- Andreas Tille <tille@debian.org> Thu, 05 Sep 2019 15:07:37 +0200
smalt (0.7.6-8) unstable; urgency=medium
* debhelper 11
......
......@@ -3,15 +3,15 @@ Maintainer: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.
Uploaders: Andreas Tille <tille@debian.org>
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.0
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
......
Description: Use 2to3 to port to Python3
Bug-Debian: https://bugs.debian.org/938501
Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 05 Sep 2019 15:07:37 +0200
--- a/misc/SAM.py
+++ b/misc/SAM.py
@@ -85,7 +85,7 @@ class Sam:
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 @@ class Sam:
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 @@ class Sam:
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 @@ class Sam:
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 @@ class Sam:
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 @@ def fetchNextRead(infil, read):
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 @@ def fetchNextPair(infil, samA, samB):
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 @@ def openFile(filnam, mode):
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 @@ if __name__ == '__main__':
from sys import argv, exit
if len(argv) < 3:
- print "usage: %s <SAM file (input)> <mapping score threshold>" % argv[0]
+ print("usage: %s <SAM file (input)> <mapping score threshold>" % argv[0])
exit(1)
infilnam = argv[1]
@@ -360,36 +360,36 @@ if __name__ == '__main__':
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)
--- a/test/bam_cigar_test.py
+++ b/test/bam_cigar_test.py
@@ -164,19 +164,19 @@ def testSAMfilesAreIdentical(filnamA, fi
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():
+ for i in list(SAM_TEST_FIELDS.keys()):
okflg = fldA[i] == fldB[i]
if not okflg and i == 0:
# samtools-0.1.18 view -h produces non-printing char
# 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
--- a/test/formats.py
+++ b/test/formats.py
@@ -45,9 +45,9 @@ class Cigar:
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 +66,11 @@ class Cigar:
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):
@@ -118,10 +118,10 @@ def getNextCigarPair(infil, cigA, cigB,
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 +151,6 @@ if __name__ == "__main__":
infil = openFile(argv[1])
while not cig.next(infil):
- print cig.qnam
+ print(cig.qnam)
infil.close()
--- a/test/mthread_test.py
+++ b/test/mthread_test.py
@@ -57,12 +57,12 @@ def cmpCigarFiles(cigfilA, cigfilB, is_v
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))
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 @@ if __name__ == '__main__':
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!")
--- a/test/results_split_test.py
+++ b/test/results_split_test.py
@@ -35,7 +35,7 @@ READSEQS = ("@SIM_000000000_contig5121_0
"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
--- a/test/splitReads_test.py
+++ b/test/splitReads_test.py
@@ -79,13 +79,13 @@ def checkOutput(cigfilnam, expected_tup)
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 @@ def checkOutput(cigfilnam, expected_tup)
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:
--- a/test/testdata.py
+++ b/test/testdata.py
@@ -139,9 +139,9 @@ class DataFiles:
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 @@ def openFile(filnam, mode = 'r'):
else:
oufil = open(filnam, mode)
except:
- print "ERROR when opening file '%s'" % filnam
+ print("ERROR when opening file '%s'" % filnam)
exit(1)
return oufil
#bam_cigar_test_makefile.patch
#try_to_fix_automake.patch
2to3.patch
......@@ -5,3 +5,5 @@ Registry:
Entry: SCR_000544
- Name: bio.tools
Entry: Smalt
Archive: SourceForge
Bug-Submit: hp3@sanger.ac.uk
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)))