diff run_seqsero.py @ 7:3d6680af0bec draft

planemo upload commit a4fb57231f274270afbfebd47f67df05babffa4a-dirty
author charles_s_test
date Mon, 27 Nov 2017 16:30:27 -0500
parents 38ad1130d077
children acc5cd06a36a
line wrap: on
line diff
--- a/run_seqsero.py	Mon Nov 27 14:37:41 2017 -0500
+++ b/run_seqsero.py	Mon Nov 27 16:30:27 2017 -0500
@@ -9,7 +9,7 @@
 # paths to files and scripts
 
 fileDir = os.path.dirname(os.path.realpath('__file__'))
-print fileDir
+print(fileDir)
 
 fq_list1 = []
 Tool_directory  = sys.argv[2]
@@ -31,7 +31,7 @@
 
 
 
-print Tool_directory + '  path printed '
+print(Tool_directory + '  path printed ')
 
 test_out.write(str(len(sys.argv))+"\n")
 if len(sys.argv) >= 2:
@@ -55,7 +55,7 @@
         '''
         Creates dict with runs as keys and list with filenames as values.
         '''
-#       print "monkey"
+#       print("monkey")
         run2fastqs = {}
         for file in fastq_files:
                 run = ''
@@ -83,9 +83,9 @@
                         else:
                                 run2fastqs[run] = [new_path_file]
                 except IOError:
-                        print "Data not found. It is possible for a deleted file to still be listed "\
+                        print("Data not found. It is possible for a deleted file to still be listed "\
                                 "in a Galaxy library. Please confirm that the data still exists on this "\
-                                "server. You may need to upload it again."
+                                "server. You may need to upload it again.")
         return run2fastqs
 
 def run_seqsero(run2fastqs):
@@ -115,7 +115,7 @@
                 for line in sample:	# line is actually the entire seqsero output.
                         line = str(line)
                         linel = re.split("\n", line)
-#                       print linel
+#                       print(linel)
 			#lines_used = []
                         for element in linel:	# element is a line of seqsero output.
 				element = element.rstrip("\n")
@@ -144,7 +144,7 @@
                                         fastq2serotype[fastqs][4] = elementl[1] # add predicted serotype
 				if element not in lines_used and re.search("\w", fastqs) and len(element) > 7:
 					fastq2comment[fastqs].append(element)
-                #print "\n"
+                #print("\n"
         return fastq2serotype, fastq2comment
 
 def print_html(fastq2serotype, fastq2comment):
@@ -170,9 +170,9 @@
                 html_out.write('<td>'+element+'</td>\n')
         html_out.write('</tr>\n')
         tab_out.write(header+"\n")
-        print "\n\n", header
+        print("\n\n", header)
         for fastq in fastq2serotype:
-#               print fastq, fastq2serotype[fastq]
+#               print(fastq, fastq2serotype[fastq])
                 line_to_print = fastq+'\t'+"\t".join(fastq2serotype[fastq])
                 tab_out.write(line_to_print+"\n")
                 html_out.write('<tr>\n')
@@ -180,9 +180,9 @@
                 for antigen in fastq2serotype[fastq]:
                         html_out.write('<td>'+antigen+'</td>\n')
                 html_out.write('</tr>\n')
-                print line_to_print
+                print(line_to_print)
         html_out.write('</table>\n')
-	print "\n"
+	print("\n")
         for fastq in fastq2comment:
                 tab_out.write("\n"+fastq+"\n")
                 html_out.write('<tr>\n')
@@ -192,8 +192,8 @@
 			#if len(line) > 7:
                         html_out.write('<td>'+line+'</td>\n')
                         tab_out.write(line+"\n")
-			print line
-		print "\n"
+			print(line)
+		print("\n")
 		html_out.write('</p>\n')
                 html_out.write('</tr>\n')
         html_out.write('</body>\n')
@@ -203,7 +203,7 @@
 
 def readFile(filename):
     filehandle = open(filename)
-    print filehandle.read()
+    print(filehandle.read())
     filehandle.close()