Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (5)
Convert benchmark scripts from Python2 to Python3 using 2to3 even if not used in package
· a277e55e
Andreas Tille
authored
Dec 15, 2019
a277e55e
routine-update: Standards-Version: 4.4.1
· 9d2f2770
Andreas Tille
authored
Dec 15, 2019
9d2f2770
R-U: autopkgtest: s/ADTTMP/AUTOPKGTEST_TMP/g
· 8e8982f9
Andreas Tille
authored
Dec 15, 2019
8e8982f9
Set upstream metadata fields: Bug-Database, Repository, Repository-Browse.
· fdd17356
Andreas Tille
authored
Dec 15, 2019
fdd17356
routine-update: Ready to upload to unstable
· bb4d0b2f
Andreas Tille
authored
Dec 15, 2019
bb4d0b2f
Show whitespace changes
Inline
Side-by-side
debian/changelog
View file @
bb4d0b2f
adapterremoval (2.3.1-2)
UNRELEASED
; urgency=medium
adapterremoval (2.3.1-2)
unstable
; urgency=medium
* Build-Depends: markdown instead of python-markdown
-- Andreas Tille <tille@debian.org> Mon, 02 Sep 2019 08:59:12 +0200
Closes: #942927
* Convert benchmark scripts from Python2 to Python3 using 2to3 even
if not used in package
* Standards-Version: 4.4.1
* autopkgtest: s/ADTTMP/AUTOPKGTEST_TMP/g
* Set upstream metadata fields: Bug-Database, Repository, Repository-
Browse.
-- Andreas Tille <tille@debian.org> Sun, 15 Dec 2019 15:21:21 +0100
adapterremoval (2.3.1-1) unstable; urgency=medium
...
...
debian/control
View file @
bb4d0b2f
...
...
@@ -9,7 +9,7 @@ Build-Depends: debhelper-compat (= 12),
libbz2-dev,
libgtest-dev,
markdown
Standards-Version: 4.4.
0
Standards-Version: 4.4.
1
Vcs-Browser: https://salsa.debian.org/med-team/adapterremoval
Vcs-Git: https://salsa.debian.org/med-team/adapterremoval.git
Homepage: https://github.com/MikkelSchubert/adapterremoval
...
...
@@ -46,7 +46,7 @@ Description: rapid adapter trimming, identification, and read merging (example d
#Package: adapter-benchmark
#Architecture: all
#Depends: ${misc:Depends},
# python,
# python
3
,
# adapterremoval,
# cutadapt,
# ea-utils,
...
...
debian/patches/2to3.patch
0 → 100644
View file @
bb4d0b2f
Description: Convert benchmark scripts from Python2 to Python3 using 2to3 even if not used in package
Bug-Debian: https://bugs.debian.org/942927
Author: Andreas Tille <tille@debian.org>
Last-Update: Sun, 15 Dec 2019 15:12:53 +0100
--- a/benchmark/benchmark.sh
+++ b/benchmark/benchmark.sh
@@ -194,7 +194,7 @@
function shuffle_and_run()
echo > /dev/stderr
echo "Shuffling batch ..." > /dev/stderr
- python -c "import sys, random
+ python3 -c "import sys, random
lines = sys.stdin.readlines()
random.shuffle(lines)
sys.stdout.write(''.join(lines))" |
--- a/benchmark/scripts/evaluate.py
+++ b/benchmark/scripts/evaluate.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Mikkel Schubert <MikkelSch@gmail.com>
#
@@ -131,10 +131,10 @@
class Summary(object):
def missing_reads(expectations, se_mode):
if se_mode:
reads = [(key, [pair[0], None])
- for key, pair in expectations.iteritems()
+ for key, pair in expectations.items()
if pair[0] is not None]
else:
- reads = [(key, pair) for key, pair in expectations.iteritems()
+ reads = [(key, pair) for key, pair in expectations.items()
if pair != [None, None]]
max_errors = 0
@@ -238,7 +238,7 @@
def evaluate(args, expectations, trimmed
eval_func(args, expectations, stat, record)
if args.dimers_are_discarded:
- for key, pair in expectations.items():
+ for key, pair in list(expectations.items()):
if args.read_mode in ("SE", "MIXED_SE"):
pair[1] = None
@@ -313,7 +313,7 @@
def read_expected_lengths(args):
results = collections.defaultdict(lambda: [None, None])
for line in open_ro(args.read_info):
if line.startswith("@"):
- record = dict(zip(header, line.rstrip().split('\t')))
+ record = dict(list(zip(header, line.rstrip().split('\t'))))
name = record["readId"][1:]
name, mate = name.split("/")
--- a/benchmark/scripts/evaluate_dmux.py
+++ b/benchmark/scripts/evaluate_dmux.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Mikkel Schubert <MikkelSch@gmail.com>
#
@@ -54,7 +54,7 @@
def read_barcodes(filename):
results = {}
for line in open_ro(filename):
if line.startswith("@"):
- record = dict(zip(header, line.rstrip().split('\t')))
+ record = dict(list(zip(header, line.rstrip().split('\t'))))
name = record["readId"].split("/")[0]
results[name] = "_".join((record["barcode_1"], record["barcode_2"]))
@@ -90,7 +90,7 @@
def main(argv):
if expectations[name] == barcode:
correct += 1
else:
- print expectations[name], barcode
+ print(expectations[name], barcode)
total += 1
handle.readline()
@@ -98,7 +98,7 @@
def main(argv):
handle.readline()
header = handle.readline()
- print total, correct
+ print(total, correct)
return 0
--- a/benchmark/scripts/evaluate_id.py
+++ b/benchmark/scripts/evaluate_id.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Mikkel Schubert <MikkelSch@gmail.com>
#
@@ -56,7 +56,7 @@
class evalulate_minion(object):
def __call__(self, readlen, insert_mean, replicate, fpath):
prefix = os.path.join(fpath, "mate")
- for method, result in self._parse_report_minion(prefix).items():
+ for method, result in list(self._parse_report_minion(prefix).items()):
self._results[(readlen, insert_mean, method)][replicate] = result
def finalize(self):
@@ -88,7 +88,7 @@
class evalulate_minion(object):
results.append(result)
result = {}
else:
- key, value = map(str.strip, line.split("=", 1))
+ key, value = list(map(str.strip, line.split("=", 1)))
result[key] = value
if result:
@@ -132,13 +132,13 @@
class evalulate_adapterrm(object):
def print_rows(program, results):
rows = []
for (readlen, insert_mean, method), replicates in sorted(results.items()):
- mean_pcr1 = numpy.mean([repl["PCR1"] for repl in replicates.values()])
- mean_pcr2 = numpy.mean([repl["PCR2"] for repl in replicates.values()])
+ mean_pcr1 = numpy.mean([repl["PCR1"] for repl in list(replicates.values())])
+ mean_pcr2 = numpy.mean([repl["PCR2"] for repl in list(replicates.values())])
rows.append((method, readlen, insert_mean, mean_pcr1, mean_pcr2))
for row in sorted(rows):
- print "\t".join(map(str, row))
+ print("\t".join(map(str, row)))
def main(argv):
@@ -149,14 +149,14 @@
def main(argv):
}
for run in os.listdir(args.root):
- readlen, insert_mean, replicate = map(int, run.split("_"))
+ readlen, insert_mean, replicate = list(map(int, run.split("_")))
for program in os.listdir(os.path.join(args.root, run)):
if program in eval_funcs:
fpath = os.path.join(args.root, run, program)
eval_funcs[program](readlen, insert_mean, replicate, fpath)
- print "\t".join(("Method", "ReadLen", "InsertMean", "PCR1", "PCR2"))
+ print("\t".join(("Method", "ReadLen", "InsertMean", "PCR1", "PCR2")))
for program, func in sorted(eval_funcs.items()):
print_rows(program, func.finalize())
--- a/benchmark/scripts/extend_profile.py
+++ b/benchmark/scripts/extend_profile.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Mikkel Schubert <MikkelSch@gmail.com>
#
@@ -84,13 +84,13 @@
def main(argv):
elif not line_s or line_s.startswith("#") or line_s == "<<END":
if rows:
for row in sorted(rows):
- print "\t".join(map(str, row))
+ print("\t".join(map(str, row)))
rows = []
in_table = False
in_table_header = None
else:
- row = dict(zip(in_table_header,
- map(try_cast, line_s.split('\t'))))
+ row = dict(list(zip(in_table_header,
+ list(map(try_cast, line_s.split('\t'))))))
row["Cycle"] = row["Cycle"] * 2
rows.append(tuple(row[key] for key in in_table_header))
row["Cycle"] = row["Cycle"] - 1
@@ -99,10 +99,10 @@
def main(argv):
elif line.startswith("["):
in_table = True
- print line,
+ print(line, end=' ')
for row in sorted(rows):
- print "\t".join(map(str, row))
+ print("\t".join(map(str, row)))
return 0
--- a/benchmark/scripts/merge_tables.py
+++ b/benchmark/scripts/merge_tables.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Mikkel Schubert <MikkelSch@gmail.com>
#
@@ -58,18 +58,18 @@
def main(argv):
assert False, fpath
for line in handle:
- rows.append(dict(zip(header, line.rstrip().split('\t'))))
+ rows.append(dict(list(zip(header, line.rstrip().split('\t')))))
rows[-1]["Nth"] = str(int(replicate)) # Strip leading zeros
rows[-1]["ReadLen"] = readlen
keys.insert(0, "Nth")
keys.insert(0, "ReadLen")
- print "\t".join(keys)
+ print("\t".join(keys))
rows = ["\t".join(row.get(key, "NA") for key in keys) for row in rows]
rows.sort()
for row in rows:
- print row
+ print(row)
return 0
--- a/benchmark/scripts/shuffle_fasta.py
+++ b/benchmark/scripts/shuffle_fasta.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Mikkel Schubert <MikkelSch@gmail.com>
#
@@ -55,15 +55,15 @@
def shuffle(rng, seq):
def main(argv):
args = parse_args(argv)
if args.seed is None:
- args.seed = random.randint(0, sys.maxint)
+ args.seed = random.randint(0, sys.maxsize)
rng = random.Random(args.seed)
name, sequence = read_fasta(args.file)
- print "Seed =", args.seed
- print "Seq =", sequence
+ print("Seed =", args.seed)
+ print("Seq =", sequence)
- for _ in xrange(args.replicates - 1):
- print "New =", shuffle(rng, sequence)
+ for _ in range(args.replicates - 1):
+ print("New =", shuffle(rng, sequence))
return 0
--- a/benchmark/scripts/tabulate.py
+++ b/benchmark/scripts/tabulate.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Mikkel Schubert <MikkelSch@gmail.com>
#
@@ -43,7 +43,7 @@
def read_table(fpath, filter_func):
for line in handle:
fields = line.rstrip().split("\t")
assert len(fields) == len(header), (header, fields)
- row = dict(zip(header, fields))
+ row = dict(list(zip(header, fields)))
name = row["Name"]
if name.endswith("_gz") or name.endswith("_bz2"):
@@ -90,17 +90,17 @@
def _collapse_basic(rows):
subdd[key_nth] = row
- for key, values in results.iteritems():
+ for key, values in results.items():
assert len(values) == max_nth and max(values) == max_nth, values
collapsed_rows = []
value_keys = ("SEN", "SPC", "PPV", "NPV", "MCC", "Rate")
- for rows in results.itervalues():
+ for rows in results.values():
result = {}
for key in value_keys:
- if any((key in row) for row in rows.itervalues()):
- values = tuple(float(row[key]) for row in rows.itervalues())
+ if any((key in row) for row in rows.values()):
+ values = tuple(float(row[key]) for row in rows.values())
result[key] = "%.3f" % (numpy.mean(values),)
for key in keys:
@@ -138,17 +138,17 @@
def _collapse_throughput(rows):
subdd[key] = row["Rate"]
- for key, values in results.iteritems():
+ for key, values in results.items():
assert len(values) == max_nth and max(values) == max_nth, values
collapsed_rows = []
value_keys = tuple(sorted(rate_keys))
- for rows in results.itervalues():
+ for rows in results.values():
result = {}
for key in value_keys:
- if any((key in row) for row in rows.itervalues()):
- values = tuple(float(row[key]) for row in rows.itervalues())
+ if any((key in row) for row in rows.values()):
+ values = tuple(float(row[key]) for row in rows.values())
result[key] = "%.1f" % (numpy.mean(values),)
for key in keys:
@@ -193,9 +193,9 @@
def main(argv):
for row in sorted(rows):
output_rows.append(tuple(str(row.get(key, "NA")) for key in keys))
- print "\t".join(keys)
+ print("\t".join(keys))
for row in sorted(output_rows):
- print "\t".join(row)
+ print("\t".join(row))
return 0
debian/patches/series
View file @
bb4d0b2f
adapt-benchmarking.patch
reduce_benchmark_length.patch
delete_adapterremoval1x_completely.patch
2to3.patch
debian/tests/run-unit-test
View file @
bb4d0b2f
#!/bin/sh -e
pkg
=
adapterremoval
if
[
"
$A
DT
TMP
"
=
""
]
;
then
A
DT
TMP
=
`
mktemp
-d
/tmp/
${
pkg
}
-test
.XXXXXX
`
if
[
"
$A
UTOPKGTEST_
TMP
"
=
""
]
;
then
A
UTOPKGTEST_
TMP
=
`
mktemp
-d
/tmp/
${
pkg
}
-test
.XXXXXX
`
fi
cd
$A
DT
TMP
cd
$A
UTOPKGTEST_
TMP
cp
-a
/usr/share/doc/
${
pkg
}
/examples/
*
.
find
.
-name
"*.gz"
-exec
gunzip
\{\}
\;
...
...
debian/upstream/metadata
View file @
bb4d0b2f
...
...
@@ -20,3 +20,6 @@ Registry:
Entry: NA
- Name: SciCrunch
Entry: SCR_011834
Bug-Database: https://github.com/MikkelSchubert/adapterremoval/issues
Repository: https://github.com/MikkelSchubert/adapterremoval.git
Repository-Browse: https://github.com/MikkelSchubert/adapterremoval