Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (6)
Python3 port of two simple scripts using 2to3
· 0e129e52
Andreas Tille
authored
Jul 12, 2019
0e129e52
Use Python3
· bd57cd29
Andreas Tille
authored
Jul 12, 2019
bd57cd29
Another try to run the test suite which does not work yet. Asked on google group for any hints.
· b87cb9bb
Andreas Tille
authored
Jul 12, 2019
b87cb9bb
Restore old directory layout
· 810a8721
Andreas Tille
authored
Jul 12, 2019
810a8721
Fix code to fix perl interpreter
· db5bbada
Andreas Tille
authored
Jul 12, 2019
db5bbada
Upload to unstable
· 3cc99788
Andreas Tille
authored
Jul 12, 2019
3cc99788
Show whitespace changes
Inline
Side-by-side
debian/changelog
View file @
3cc99788
stacks (2.41+dfsg-1)
UNRELEASED
; urgency=medium
stacks (2.41+dfsg-1)
unstable
; urgency=medium
* New upstream version
* debhelper 12
...
...
@@ -9,8 +9,9 @@ stacks (2.41+dfsg-1) UNRELEASED; urgency=medium
* Removed stacks-web package since the code for the web service
was removed from upstream source and the package has no active
users according to popcon anyway
* Python3 port of two simple scripts using 2to3
-- Andreas Tille <tille@debian.org>
Wed
, 1
0
Jul 2019 2
1:58
:3
0
+0200
-- Andreas Tille <tille@debian.org>
Fri
, 1
2
Jul 2019 2
0:40
:3
3
+0200
stacks (2.2+dfsg-1) unstable; urgency=medium
...
...
debian/control
View file @
3cc99788
...
...
@@ -5,7 +5,6 @@ Uploaders: Tim Booth <tbooth@ceh.ac.uk>,
Section: science
Priority: optional
Build-Depends: debhelper (>= 12~),
python,
zlib1g-dev,
libbam-dev,
libsparsehash-dev,
...
...
@@ -20,10 +19,10 @@ Package: stacks
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
${python:Depends},
samtools,
libdbi-perl
Recommends: libspreadsheet-writeexcel-perl
Recommends: libspreadsheet-writeexcel-perl,
python3
Conflicts: stacks-web
Provides: stacks-web
Replaces: stacks-web
...
...
debian/patches/2to3.patch
0 → 100644
View file @
3cc99788
Author: Andreas Tille <tille@debian.org>
Last-Update: Wed, 10 Jul 2019 21:58:30 +0200
Description: Result of 2to3 port to Python3
--- a/scripts/count_fixed_catalog_snps.py
+++ b/scripts/count_fixed_catalog_snps.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
import optparse
import sys
@@ -39,7 +39,7 @@
def parse_command_line():
batch_id = int(opts.batch_id)
if len(path) == 0 or os.path.exists(path) == False:
- print >> sys.stderr, "You must specify a valid path to Stacks input files."
+ print("You must specify a valid path to Stacks input files.", file=sys.stderr)
p.print_help()
sys.exit()
@@ -62,10 +62,10 @@
def find_stacks_files(path, files):
pos = entry.find(".matches.tsv")
if (pos != -1):
files.append(entry[0:pos])
- print >> sys.stderr, "Found", len(files), "Stacks samples."
+ print("Found", len(files), "Stacks samples.", file=sys.stderr)
except:
- print >> sys.stderr, "Unable to read files from Stacks directory, '" + path + "'"
+ print("Unable to read files from Stacks directory, '" + path + "'", file=sys.stderr)
def parse_cigar(cigar, components):
@@ -143,14 +143,14 @@
def count_sample_snps(path, file, sample
matches[sample_locus] = cat_locus
else:
if cat_locus != matches[sample_locus]:
- print >> sys.stderr, "Error: sample locus", sample_locus, "matches more than one catalog locus."
+ print("Error: sample locus", sample_locus, "matches more than one catalog locus.", file=sys.stderr)
if len(cigar) > 0:
if sample_locus not in cigars:
cigars[sample_locus] = cigar
else:
if cigar != cigars[sample_locus]:
- print >> sys.stderr, "Error: sample locus", sample_locus, "has multiple cigar alignments."
+ print("Error: sample locus", sample_locus, "has multiple cigar alignments.", file=sys.stderr)
fh.close()
@@ -279,23 +279,23 @@
find_stacks_files(path, files)
#
i = 1
for file in files:
- print >> sys.stderr, "Processing file", str(i), "of", len(files), "['" + file + "']"
+ print("Processing file", str(i), "of", len(files), "['" + file + "']", file=sys.stderr)
cnt = count_sample_snps(path, file, sample_snps)
- print >> sys.stderr, " Found", cnt, "heterozygous SNPs in sample."
+ print(" Found", cnt, "heterozygous SNPs in sample.", file=sys.stderr)
i += 1
total_snps = 0
for locus in sample_snps:
for col in sample_snps[locus]:
total_snps += 1
-print >> sys.stderr, "Found", total_snps, "variable sites across the population."
+print("Found", total_snps, "variable sites across the population.", file=sys.stderr)
#
# Count all the SNPs found in the catalog.
#
-print >> sys.stderr, "Processing the catalog"
+print("Processing the catalog", file=sys.stderr)
cnt = count_catalog_snps(path, batch_id, catalog_snps)
-print >> sys.stderr, " Found", cnt, "heterozygous SNPs in the catalog."
+print(" Found", cnt, "heterozygous SNPs in the catalog.", file=sys.stderr)
#
# Count all the SNPs in the catalog but not in any sample: these are the fixed differences cstacks identified.
@@ -315,7 +315,7 @@
for locus in catalog_snps:
fixed_snps += 1
for col in sample_snps[locus]:
if col not in c:
- print "Locus:", locus, "col:", col, "Catalog SNPs:", catalog_snps[locus], "Sample SNPs:", sample_snps[locus]
+ print("Locus:", locus, "col:", col, "Catalog SNPs:", catalog_snps[locus], "Sample SNPs:", sample_snps[locus])
-print >> sys.stderr, "Found", total_snps, "SNPs across all samples and in the catalog."
-print >> sys.stderr, "Found", fixed_snps, "fixed SNPs only in the catalog."
+print("Found", total_snps, "SNPs across all samples and in the catalog.", file=sys.stderr)
+print("Found", fixed_snps, "fixed SNPs only in the catalog.", file=sys.stderr)
--- a/scripts/integrate_alignments.py
+++ b/scripts/integrate_alignments.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
import optparse
import sys
@@ -49,7 +49,7 @@
def parse_command_line():
batch_id = int(opts.batch_id)
if len(out_path) == 0 or os.path.exists(out_path) == False:
- print >> sys.stderr, "You must specify a valid path to write files to."
+ print("You must specify a valid path to write files to.", file=sys.stderr)
p.print_help()
sys.exit()
@@ -57,12 +57,12 @@
def parse_command_line():
out_path += "/"
if len(aln_path) == 0 or os.path.exists(aln_path) == False:
- print >> sys.stderr, "You must specify a valid path to a SAM file containing catalog locus alignments."
+ print("You must specify a valid path to a SAM file containing catalog locus alignments.", file=sys.stderr)
p.print_help()
sys.exit()
if len(path) == 0 or os.path.exists(path) == False:
- print >> sys.stderr, "You must specify a valid path to Stacks input files."
+ print("You must specify a valid path to Stacks input files.", file=sys.stderr)
p.print_help()
sys.exit()
@@ -85,10 +85,10 @@
def find_stacks_files(path, files):
pos = entry.find(".matches.tsv")
if (pos != -1):
files.append(entry[0:pos])
- print >> sys.stderr, "Found", len(files), "Stacks samples."
+ print("Found", len(files), "Stacks samples.", file=sys.stderr)
except:
- print >> sys.stderr, "Unable to read files from Stacks directory, '", path, "'"
+ print("Unable to read files from Stacks directory, '", path, "'", file=sys.stderr)
def parse_catalog_alignments(aln_path, alns):
@@ -115,7 +115,7 @@
def parse_catalog_alignments(aln_path, a
alns[locus] = (chr, bp, "+");
fh.close()
- print >> sys.stderr, "Loaded", len(alns), "catalog locus alignments from '", aln_path, "'."
+ print("Loaded", len(alns), "catalog locus alignments from '", aln_path, "'.", file=sys.stderr)
def convert_sample(path, file, out_path, alns):
@@ -414,14 +414,14 @@
parse_catalog_alignments(aln_path, alns)
i = 1
for file in files:
- print >> sys.stderr, "Processing file", str(i), "of", len(files), "['" + file + "']"
+ print("Processing file", str(i), "of", len(files), "['" + file + "']", file=sys.stderr)
cnt = convert_sample(path, file, out_path, alns)
- print >> sys.stderr, " Added alignments for", cnt, "loci."
+ print(" Added alignments for", cnt, "loci.", file=sys.stderr)
i += 1
#
# Now process the catalog.
#
-print >> sys.stderr, "Processing the catalog"
+print("Processing the catalog", file=sys.stderr)
cnt = convert_catalog(path, batch_id, out_path, alns)
-print >> sys.stderr, " Added alignments for", cnt, "catalog loci."
+print(" Added alignments for", cnt, "catalog loci.", file=sys.stderr)
debian/patches/series
View file @
3cc99788
script-exe-paths
use_debian_packaged_htslib.patch
2to3.patch
debian/rules
View file @
3cc99788
...
...
@@ -8,7 +8,7 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/default.mk
%:
dh $@
--with python2
dh $@
override_dh_auto_install:
dh_auto_install --no-parallel
...
...
@@ -19,13 +19,14 @@ override_dh_auto_configure:
--with-bam-lib-path=/usr/lib
override_dh_install:
dh_install
# Skip this bit if not building stacks
!
cd debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)/bin
||
\
mkdir -p debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)
mv debian/$(DEB_SOURCE)/usr/bin debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)
cd debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)/bin
&&
\
for f in *.pl ; do \
ln -s "$$f" "`basename $$f .pl`" ; \
sed -i '1s?^#!/usr/bin/env.*perl?#!/usr/bin/perl?' $$f ; \
done
dh_install
override_dh_link:
dh_link
...
...
@@ -37,8 +38,14 @@ override_dh_link:
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
#ln -s /usr/share/automake-1.14/tap-driver.sh tests/tap-driver.sh
if [ -e /usr/share/automake-1.16/tap-driver.sh ] ; then \
ln -s /usr/share/automake-1.16/tap-driver.sh tests/tap-driver.sh ; \
else \
echo "Make sure /usr/share/automake-*/tap-driver.sh exists and is linked" ; \
false ; \
fi
# dh_auto_test
rm tests/tap-driver.sh
# FIXME: Does not work even after this trick. See
# https://groups.google.com/forum/#!msg/stacks-users/TA2tMEqb4Mg/pQy4fUCYi9kJ
true
...
...
debian/stacks.install
View file @
3cc99788
debian
/
stacks
/
usr
/
bin
usr
/
lib
/
stacks
debian
/
bin
/*
usr
/
bin