Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (3)
Fix some build issues with gcc9
· feaf2ad1
Andreas Tille
authored
Dec 22, 2019
feaf2ad1
More Python3 changes
· 43bbd4cf
Andreas Tille
authored
Dec 22, 2019
43bbd4cf
Fix Python3 dependency
· f37b7a57
Andreas Tille
authored
Dec 22, 2019
f37b7a57
Show whitespace changes
Inline
Side-by-side
debian/control
View file @
f37b7a57
...
...
@@ -5,6 +5,7 @@ Uploaders: Michael R. Crusoe <michael.crusoe@gmail.com>,
Section: science
Priority: optional
Build-Depends: debhelper-compat (= 12),
dh-python,
libsparsehash-dev,
zlib1g-dev | libz-dev,
libbamtools-dev,
...
...
@@ -24,9 +25,9 @@ Homepage: https://github.com/jts/sga
Package: sga
Architecture: any
Depends: ${shlibs:Depends},
${python3:Depends},
${misc:Depends},
samtools,
python3,
python3-ruffus,
python3-pysam
Recommends: abyss (>= 2.0.2-1)
...
...
debian/patches/2to3.patch
View file @
f37b7a57
...
...
@@ -93,3 +93,197 @@ Last-Update: Mon, 02 Sep 2019 20:18:33 +0200
marker = d['plot_marker'] if( use_markers ) else None
ax.plot(indices, q30_fraction, '-',
marker=marker, color=d['plot_color'])
--- a/src/bin/sga-joinedpe
+++ b/src/bin/sga-joinedpe
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#!/usr/bin/python3
# sga-joinpe - join the two ends of a paired end read together
# into one composite sequence. This is used to run rmdup on the pairs
import getopt
@@ -9,7 +9,7 @@
def writeJoinedRecord(out, record1, reco
join_name_1 = record1[0].split()[0][0:-2]
join_name_2 = record2[0].split()[0][0:-2]
if join_name_1 != join_name_2:
- print 'Error: Reads are incorrectly paired ', record1[0], record2[0]
+ print('Error: Reads are incorrectly paired ', record1[0], record2[0])
sys.exit(2)
join_pos = len(record1[1])
@@ -30,7 +30,7 @@
def writeSplitRecord(out, record):
if header_fields[1].find("join_pos") != -1:
join_pos = int(header_fields[1].split(":")[1])
else:
- print 'Error: joined record does not have the correct format ', record[0]
+ print('Error: joined record does not have the correct format ', record[0])
# print 'join_pos', join_pos
id1 = header_fields[0] + "/1"
@@ -76,7 +76,7 @@
def readRecord(file):
elif id[0] == "@":
isFastq = True
else:
- print 'Unknown record header: ', line
+ print('Unknown record header: ', line)
sys.exit(2)
out.append(id)
@@ -90,15 +90,15 @@
def readRecord(file):
#
def usage():
- print 'sga-joinedpe [-o outfile] FILE'
- print 'allow rmdup to be performed on entire paired end reads'
- print 'if the --join option is provided, two consequetive records in FILE will be concatenated into one read.'
- print 'if the --split option is provided, each record in FILE will be split into two'
- print '\nOptions: '
- print ' -o, --outfile=FILE Write results to FILE [default=stdout]'
- print ' --join Join the reads together'
- print ' --split Split the reads apart'
- print ' --help Print this usage message'
+ print('sga-joinedpe [-o outfile] FILE')
+ print('allow rmdup to be performed on entire paired end reads')
+ print('if the --join option is provided, two consequetive records in FILE will be concatenated into one read.')
+ print('if the --split option is provided, each record in FILE will be split into two')
+ print('\nOptions: ')
+ print(' -o, --outfile=FILE Write results to FILE [default=stdout]')
+ print(' --join Join the reads together')
+ print(' --split Split the reads apart')
+ print(' --help Print this usage message')
# Defaults
outfilename = ""
@@ -111,8 +111,8 @@
try:
"split",
"join",
"help"])
-except getopt.GetoptError, err:
- print str(err)
+except getopt.GetoptError as err:
+ print(str(err))
usage()
sys.exit(2)
@@ -127,20 +127,20 @@
for (oflag, oarg) in opts:
usage()
sys.exit(1)
else:
- print 'Unrecognized argument', oflag
+ print('Unrecognized argument', oflag)
usage()
sys.exit(0)
if len(args) != 1:
- print 'Error: Exactly one input file must be provided'
+ print('Error: Exactly one input file must be provided')
sys.exit(2)
if not join and not split:
- print 'Error: One of --join or --split must be provided'
+ print('Error: One of --join or --split must be provided')
sys.exit(2)
if join and split:
- print 'Error: Only one of --join or --split can be provided'
+ print('Error: Only one of --join or --split can be provided')
sys.exit(2)
filename = args[0]
@@ -158,7 +158,7 @@
if join:
record2 = readRecord(file)
if len(record1) != len(record2):
- print 'Error, record lengths differ'
+ print('Error, record lengths differ')
sys.exit(2)
# If no record was read, we are done
--- a/src/bin/sga-align
+++ b/src/bin/sga-align
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#!/usr/bin/python3
# pipeline to align reads to contigs implemented with ruffus (http://ruffus.org.uk)
from ruffus import *
@@ -14,7 +14,7 @@
def getBasename(inFile):
# Run a shell command
def runCmd(cmd):
- print cmd
+ print(cmd)
return subprocess.Popen(cmd, shell=True).wait()
def _align(ref, reads, out):
@@ -29,11 +29,11 @@
def runBWAIndex(inFile):
def runBWAAln(inFiles, contigsFile, outFile):
assert len(inFiles) == 2
if inFiles[0] == inFiles[1]:
- print 'Error: the two reads files are the same'
+ print('Error: the two reads files are the same')
sys.exit(1)
contigsBasename = getBasename(contigsFile)
- tempSAI = map(lambda x : getBasename(x) + "." + contigsBasename + ".bwsai", inFiles)
+ tempSAI = [getBasename(x) + "." + contigsBasename + ".bwsai" for x in inFiles]
_align(contigsFile, inFiles[0], tempSAI[0])
_align(contigsFile, inFiles[1], tempSAI[1])
@@ -65,11 +65,11 @@
def runSplitReads(inFiles, outFiles):
#
def usage():
- print 'usage: sga-align [options] <contigs file> <input files>'
- print 'align reads to contigs'
- print 'Options:'
- print ' --name=STR Use STR as the basename for the output files.'
- print ' -t,--threads=N Use N threads when running bwa.'
+ print('usage: sga-align [options] <contigs file> <input files>')
+ print('align reads to contigs')
+ print('Options:')
+ print(' --name=STR Use STR as the basename for the output files.')
+ print(' -t,--threads=N Use N threads when running bwa.')
# Variables
@@ -79,8 +79,8 @@
try:
opts, args = getopt.gnu_getopt(sys.argv[1:], 't:', ["name=",
"threads=",
"help"])
-except getopt.GetoptError, err:
- print str(err)
+except getopt.GetoptError as err:
+ print(str(err))
usage()
sys.exit(2)
@@ -93,12 +93,12 @@
for (oflag, oarg) in opts:
usage()
sys.exit(1)
else:
- print 'Unrecognized argument', oflag
+ print('Unrecognized argument', oflag)
usage()
sys.exit(0)
if len(args) < 2:
- print 'Error, a contigs file and reads file must be provided'
+ print('Error, a contigs file and reads file must be provided')
usage()
sys.exit(0)
@@ -107,11 +107,11 @@
contigFile = args[0]
readFiles = args[1:]
if len(readFiles) == 0:
- print 'Error, at least one input file must be specified'
+ print('Error, at least one input file must be specified')
sys.exit(0)
-print contigFile
-print readFiles
+print(contigFile)
+print(readFiles)
indexInFiles = contigFile
indexOutFiles = [contigFile + ".bwt"]
debian/patches/gcc9.patch
0 → 100644
View file @
f37b7a57
Author: Andreas Tille <tille@debian.org>
Last-Update: Sun, 22 Dec 2019 18:42:14 +0100
Description: Fix some build issues with gcc9
--- a/src/Util/ClusterReader.cpp
+++ b/src/Util/ClusterReader.cpp
@@ -67,7 +67,7 @@
bool ClusterReader::generate(ClusterVect
bool ClusterReader::readCluster(ClusterRecord& record)
{
std::string line;
- bool good = getline(*m_pReader, line);
+ bool good = (bool)getline(*m_pReader, line);
if(!good || line.empty())
return false;
std::stringstream parser(line);
--- a/src/Util/StdAlnTools.cpp
+++ b/src/Util/StdAlnTools.cpp
@@ -119,7 +119,7 @@
std::string StdAlnTools::expandCigar(con
char code;
while(parser >> length)
{
- bool success = parser >> code;
+ bool success = (bool)(parser >> code);
expanded.append(length, code);
assert(success);
(void)success;
--- a/src/SGA/rmdup.cpp
+++ b/src/SGA/rmdup.cpp
@@ -232,7 +232,7 @@
std::string parseDupHits(const StringVec
while(!done)
{
// Parse a line from the current file
- bool valid = getline(*reader_vec[currReaderIdx], line);
+ bool valid = (bool)getline(*reader_vec[currReaderIdx], line);
++numRead;
// Deal with switching the active reader and the end of files
if(!valid || numRead == buffer_size)
debian/patches/series
View file @
f37b7a57
...
...
@@ -8,3 +8,4 @@ gcc-7.patch
no_privacy_breach_url.patch
2to3.patch
no_enforcing_c++98.patch
gcc9.patch
debian/rules
View file @
f37b7a57
...
...
@@ -9,7 +9,7 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include
/usr/share/dpkg/default.mk
%
:
dh
$@
--sourcedirectory
=
src
dh
$@
--with
python3
--sourcedirectory
=
src
override_dh_auto_configure
:
dh_auto_configure
--
--with-bamtools
=
/usr/
...
...