Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 02 Mar 2017 11:51:33 +0100
Description: Fix Python3 errors by using 2to3

--- a/src/analysis/report.py
+++ b/src/analysis/report.py
@@ -43,7 +43,7 @@ def plot(plotdata, directory, bottom=Tru
     ax.minorticks_on()
     ax.tick_params(axis='x', which='minor', length=3)
 
-    for loc, spine in ax.spines.iteritems():
+    for loc, spine in ax.spines.items():
         if loc in ['right', 'top']:
             spine.set_color('none')
             continue
@@ -74,7 +74,7 @@ def plot(plotdata, directory, bottom=Tru
     ys = (np.arange(len(starts)) + 1) * lowerbound / 3
 
     ax.hlines(ys, starts, ends, colors='k', lw=4, linestyle='solid')
-    for i, c in zip(xrange(len(counts)), counts):
+    for i, c in zip(range(len(counts)), counts):
         ax.text(laa + 10, lowerbound / 3 * (i + 1.25), c)
     if legend:
         fig.legend((nt_lines, aa_lines), ('Nucleotide', 'Amino acid'),
@@ -83,7 +83,7 @@ def plot(plotdata, directory, bottom=Tru
     if save:
         fig.savefig(directory + filename)
 
-    print '=============', filename, '============='
-    print 'Average variance: '
-    print '\t', sum(snpdata['nt']['var']) / lnt, 'per base pair'
-    print '\t', sum(snpdata['aa']['var']) / laa, 'per amino acid'
+    print('=============', filename, '=============')
+    print('Average variance: ')
+    print('\t', sum(snpdata['nt']['var']) / lnt, 'per base pair')
+    print('\t', sum(snpdata['aa']['var']) / laa, 'per amino acid')
--- a/prok-geneseek
+++ b/prok-geneseek
@@ -40,16 +40,16 @@ if __name__ == "__main__":
     report = report and calculate
 
     if not (predict or cluster or rename or calculate or plot or report):
-        print "I don't know what you want, I give up."
+        print("I don't know what you want, I give up.")
         exit(0)
 
     if predict:
         names = pr.run(database, names)
-        print "Homologous sequences written to " + direc + 'sequences' + sep
+        print("Homologous sequences written to " + direc + 'sequences' + sep)
 
     if cluster:
         names = cw.run(direc + 'clusters' + sep, names)
-        print "Clustalw files written to " + direc + "clusters" + sep
+        print("Clustalw files written to " + direc + "clusters" + sep)
 
     if rename:
         names = mv.rename(direc + 'clusters' + sep, database, names)
@@ -89,7 +89,7 @@ if __name__ == "__main__":
                 cv.plot(plotdata, direc + 'plots' + sep,
                         filename=metadata['filename'])
             except Exception as e:
-                print metadata['filename'], e
+                print(metadata['filename'], e)
         if report:
             try:
                 os.mkdir(direc + 'data' + sep)
@@ -99,4 +99,4 @@ if __name__ == "__main__":
             fh = open(direc + 'data' + sep + metadata['strain'] + '.py', 'w')
             fh.write('plotdata = ' + repr(plotdata) + '\n')
             fh.write('metadata = ' + repr(metadata) + '\n')
-    print "Done"
+    print("Done")
