Mercurial > repos > charles_s_test > seqsero2
diff libs/run_auto_All_for_assemblies.py @ 10:53efef402c51 draft
planemo upload commit a4fb57231f274270afbfebd47f67df05babffa4a-dirty
author | charles_s_test |
---|---|
date | Wed, 29 Nov 2017 08:34:19 -0500 |
parents | 3d6680af0bec |
children |
line wrap: on
line diff
--- a/libs/run_auto_All_for_assemblies.py Tue Nov 28 21:16:36 2017 -0500 +++ b/libs/run_auto_All_for_assemblies.py Wed Nov 29 08:34:19 2017 -0500 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2.7 @@ -51,11 +51,11 @@ 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 - os.system('python '+dirpath+'/Otype_determine_analysis.py '+database_path+'/Typhimurium_LT2_gnd_galF.fasta '+real_file+' '+database_path+'/new_Oserotype.fasta >temp_result_'+str(q)+'O.txt') + os.system('python2.7 '+dirpath+'/Otype_determine_analysis.py '+database_path+'/Typhimurium_LT2_gnd_galF.fasta '+real_file+' '+database_path+'/new_Oserotype.fasta >temp_result_'+str(q)+'O.txt') os.system('cat temp_result_'+str(q)+'O.txt>>data_log.txt') handle=open('temp_result_'+str(q)+'O.txt',"r") handle=handle.readlines() @@ -81,8 +81,8 @@ elif O1_3_19=="+": Otype="1,3,19" else: - 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') + print "No_O3,10_O1,3,19_spe_sequences" + os.system('python2.7 '+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") handle2=handle2.readlines() @@ -103,7 +103,7 @@ fljB="-" #print line, if Otype=="9" and fliC=="g,m" and fljB=="-": - os.system('python '+dirpath+'/special_gene_test_assemblies.py '+database_path+'/specific_genes.fasta '+real_file+' sdf >temp_result_'+str(q)+'sdf.txt') + os.system('python2.7 '+dirpath+'/special_gene_test_assemblies.py '+database_path+'/specific_genes.fasta '+real_file+' sdf >temp_result_'+str(q)+'sdf.txt') os.system('cat temp_result_'+str(q)+'sdf.txt>>data_log.txt') handle3=open('temp_result_'+str(q)+'sdf.txt',"r") sdf="" @@ -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") '''