Description: Use 2to3 to port from Python2 to Python3
Bug-Debian: https://bugs.debian.org/938467
Author: Andreas Tille <tille@debian.org>
Last-Update: Tue, 17 Dec 2019 11:53:25 +0100

--- a/Test/RUNTEST.sh
+++ b/Test/RUNTEST.sh
@@ -21,8 +21,8 @@
 -E ./info/alignments_trimmed.txt.gz
 
 prog=gzcat
-$prog ./out/pe_bad_contam_trimmed_1.fastq.gz | python seqlens.py > ./info/pe_bad_contam_trimmed_1.lenhist.txt
-$prog ./out/pe_bad_contam_trimmed_2.fastq.gz | python seqlens.py > ./info/pe_bad_contam_trimmed_2.lenhist.txt
-$prog ./out/pe_bad_contam_merged_1.fastq.gz | python seqlens.py > ./info/pe_bad_contam_merged_1.lenhist.txt
-$prog ./out/pe_bad_contam_merged_2.fastq.gz | python seqlens.py > ./info/pe_bad_contam_merged_2.lenhist.txt
-$prog ./out/pe_bad_contam_merged_s.fastq.gz | python seqlens.py > ./info/pe_bad_contam_merged_s.lenhist.txt
+$prog ./out/pe_bad_contam_trimmed_1.fastq.gz | python3 seqlens.py > ./info/pe_bad_contam_trimmed_1.lenhist.txt
+$prog ./out/pe_bad_contam_trimmed_2.fastq.gz | python3 seqlens.py > ./info/pe_bad_contam_trimmed_2.lenhist.txt
+$prog ./out/pe_bad_contam_merged_1.fastq.gz | python3 seqlens.py > ./info/pe_bad_contam_merged_1.lenhist.txt
+$prog ./out/pe_bad_contam_merged_2.fastq.gz | python3 seqlens.py > ./info/pe_bad_contam_merged_2.lenhist.txt
+$prog ./out/pe_bad_contam_merged_s.fastq.gz | python3 seqlens.py > ./info/pe_bad_contam_merged_s.lenhist.txt
--- a/Test/SimTest/RUNTEST.sh
+++ b/Test/SimTest/RUNTEST.sh
@@ -44,8 +44,8 @@ do
 		    rm simSeq_trimmed_2.fq
 		    gunzip simSeq_trimmed_1.fq.gz
 		    gunzip simSeq_trimmed_2.fq.gz
-		    python ./simseq_trimmed_error_check.py simSeq10k_1.fq simSeq10k_2.fq simSeq_trimmed_1.fq simSeq_trimmed_2.fq > trimmed_M${m}_N${n}_X${x}_Z${z}_Q${q}_m${m2}_n${n2}.txt
-		    python ../seqlens.py < simSeq_trimmed_1.fq > lendist_M${m}_N${n}_X${x}_Z${z}_Q${q}_m${m2}_n${n2}.txt	
+		    python3 ./simseq_trimmed_error_check.py simSeq10k_1.fq simSeq10k_2.fq simSeq_trimmed_1.fq simSeq_trimmed_2.fq > trimmed_M${m}_N${n}_X${x}_Z${z}_Q${q}_m${m2}_n${n2}.txt
+		    python3 ../seqlens.py < simSeq_trimmed_1.fq > lendist_M${m}_N${n}_X${x}_Z${z}_Q${q}_m${m2}_n${n2}.txt	
 			done
 		    done
 		done
@@ -60,8 +60,8 @@ done
 #ea-utils-read-only/clipper/fastq-clipper simSeq10k_mcf_1.fq
 #ea-utils-read-only/clipper/fastq-clipper -o simSeq10k_mcf_1.fq simSeq10k_1.fq AGATCGGAAGAGCGGTTCAG
 #ea-utils-read-only/clipper/fastq-clipper -o simSeq10k_mcf_2.fq simSeq10k_2.fq AGATCGGAAGAGCGTCGTGT
-#python ./simseq_trimmed_error_check.py simSeq10k_1.fq simSeq10k_2.fq simSeq10k_mcf_1.fq simSeq10k_mcf_2.fq >trimmed_M99_N99_X99_Z99_Q99_m99_n99.txt
+#python3 ./simseq_trimmed_error_check.py simSeq10k_1.fq simSeq10k_2.fq simSeq10k_mcf_1.fq simSeq10k_mcf_2.fq >trimmed_M99_N99_X99_Z99_Q99_m99_n99.txt
 
 
-python sens_vs_spec.py
+python3 sens_vs_spec.py
 #open result.html
--- a/Test/SimTest/sens_vs_spec.py
+++ b/Test/SimTest/sens_vs_spec.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 from glob import iglob as glob
 from operator import itemgetter
 flist = glob("trimmed_*.txt")
@@ -30,9 +30,9 @@ outf =  open('spec_sorted_results.txt','
 colnames = []
 rowdata = []
 outf.write("#Fname\tSpecificity\tSensitivity\n")
-total = len(specdict.items())
+total = len(list(specdict.items()))
 num = 1
-for (fname,spec) in sorted(specdict.items(),key=itemgetter(1),reverse=True):
+for (fname,spec) in sorted(list(specdict.items()),key=itemgetter(1),reverse=True):
     colnames.append("data.addColumn('number','%s');"%(fname))
     sens = sensdict[fname]
     rowarr = [str(sens)]
--- a/Test/SimTest/simseq_trimmed_error_check.py
+++ b/Test/SimTest/simseq_trimmed_error_check.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 from collections import defaultdict
 from operator import itemgetter
@@ -52,7 +52,7 @@ max_len = 100
 #sens = tp/(tp+fn)
 #spec = tn/(tn+fp)
 
-for (pid,truelen) in sizes.iteritems():
+for (pid,truelen) in sizes.items():
 	outlen = outsizes[pid]
 	## if truelen >= min_len:
 	if truelen < outlen:
@@ -84,10 +84,10 @@ for (pid,truelen) in sizes.iteritems():
 		
 			
 			
-print("Adapter Trimmed:%d" % (TP) )
-print("Adapter Missed:%d" % (FN) )
-print("Adapter Total:%d" % (FN+TP)  )
-print("Genomic Bases Trimmed:%d" % (FP) )
-print("Genomic Bases Total:%d" % (FP + TN) )
-print("Adapter Trimming Sensitivity: %f" % (float(TP)/(float(TP)+float(FN))) )
-print("Adapter Trimming Specificity: %f" % (float(TN)/(float(TN)+float(FP))) )
+print(("Adapter Trimmed:%d" % (TP) ))
+print(("Adapter Missed:%d" % (FN) ))
+print(("Adapter Total:%d" % (FN+TP)  ))
+print(("Genomic Bases Trimmed:%d" % (FP) ))
+print(("Genomic Bases Total:%d" % (FP + TN) ))
+print(("Adapter Trimming Sensitivity: %f" % (float(TP)/(float(TP)+float(FN))) ))
+print(("Adapter Trimming Specificity: %f" % (float(TN)/(float(TN)+float(FP))) ))
--- a/Test/seqlens.py
+++ b/Test/seqlens.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 from collections import defaultdict
 from operator import itemgetter
@@ -19,5 +19,5 @@ for line in stdin:
 		
 	
 
-for (length,count) in sorted(seqlens.iteritems(), key=itemgetter(0),reverse=True):
-	print("%d\t%d"%(length,count))
+for (length,count) in sorted(iter(seqlens.items()), key=itemgetter(0),reverse=True):
+	print(("%d\t%d"%(length,count)))
