Mercurial > repos > charles_s_test > seqsero2
diff libs/run_auto_All_for_assemblies.py @ 7:3d6680af0bec draft
planemo upload commit a4fb57231f274270afbfebd47f67df05babffa4a-dirty
author | charles_s_test |
---|---|
date | Mon, 27 Nov 2017 16:30:27 -0500 |
parents | 6895de35a263 |
children | 53efef402c51 |
line wrap: on
line diff
--- a/libs/run_auto_All_for_assemblies.py Mon Nov 27 14:37:41 2017 -0500 +++ b/libs/run_auto_All_for_assemblies.py Mon Nov 27 16:30:27 2017 -0500 @@ -51,7 +51,7 @@ real_file=file2 except: real_file=file1 - #print "###The genome name:",file1 + #print("###The genome name:",file1 dirpath = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))###01/27/2015 os.system('touch result.txt') database_path="database"###01/27/2015 @@ -81,7 +81,7 @@ elif O1_3_19=="+": Otype="1,3,19" else: - print "No_O3,10_O1,3,19_spe_sequences" + print("No_O3,10_O1,3,19_spe_sequences") os.system('python '+dirpath+'/H_combination_output_analysis.py '+real_file+' '+database_path+'/H_new_fliC_protein_database.fasta '+database_path+'/H_new_fljB_protein_database.fasta >temp_result_'+str(q)+'H.txt') os.system('cat temp_result_'+str(q)+'H.txt>>data_log.txt') handle2=open('temp_result_'+str(q)+'H.txt',"r") @@ -166,18 +166,18 @@ if len(seronames)>1: star="*" star_line="The predicted serotypes share the same general formula:\t"+Otype+":"+fliC+":"+fljB+"\n"## - #print "$$$The most possible formula is: (by the order O:H1:H2) ",Otype,":",fliC,":",fljB - #print "$$$The possible serotyes are:",seronames + #print("$$$The most possible formula is: (by the order O:H1:H2) ",Otype,":",fliC,":",fljB + #print("$$$The possible serotyes are:",seronames m=0 for y in seronames: if y in file1: - #print "$$$ Is the judgement true? Answer:Yes!" #here we use file1, because we want ":", while file2 turned it to "__" + #print("$$$ Is the judgement true? Answer:Yes!" #here we use file1, because we want ":", while file2 turned it to "__" answer="Yes" m=1 if m==0: - #print "$$$ Is the judgement true? Answer: Need to check the records and file names" + #print("$$$ Is the judgement true? Answer: Need to check the records and file names" answer="Not sure" - print "\n","\n" + print("\n","\n") predict_form=Otype+":"+fliC+":"+fljB predict_sero=(" or ").join(seronames) if predict_form=="9:g,m:-":# @@ -250,12 +250,12 @@ txt_names.append(file_names[j+i].replace(' ','_').replace(":","__").replace("[","").replace("]","")+".txt") print txt_names for j in xrange(len(txt_names)): - print i,"and",j - print i+j+1 + print(i,"and",j) + print(i+j+1) file=open(txt_names[j],"r") handle=list(file) b=handle[0].split("\t") - print b + print(b) sheet.write(i+j+1,0,b[0]) sheet.write(i+j+1,1,b[1]) sheet.write(i+j+1,2,b[2]) @@ -265,7 +265,7 @@ sheet.write(i+j+1,6,b[6]) sheet.write(i+j+1,7,b[7]) - print "End time,",time.time() + print("End time,",time.time()) file3.save("Seqsero_result2.xls") '''