def main_page(): configure.input_seq=File_jf.check_file(target_file, hairpin_file, extra_base_file,templates_file) feet_list=design.ptpx_foot(configure.input_seq,min_pt,max_pt,min_px,max_px,max_e,direction,pt_min_tm,pt_max_tm, px_min_tm, px_max_tm,configure.pt_foot_conc,configure.px_foot_conc) design.write_fasta_feet(feet_list,'~feet.fasta') (in_blast_result,ex_blast_result)=design.combine_check_exinclude('~feet.fasta',str(include_line),str(exclude_line),int(num),float(perct)/100,seq_name_list) blast_ok_feet_list=design.blast_feet_chek(in_blast_result,ex_blast_result, feet_list,pt_min_length, px_min_length) primer_set=design.bind_hairpin_template(blast_ok_feet_list,hairpin_file,extra_base_file)
def main_page(target_file,include_line, exclude_line, hairpin_file,extra_base_file, templates_file,\ exclude_GAGTC,two_direction,PT_foot_min,PT_foot_max,PT_Tm_above,PX_foot_min,PX_foot_max,PX_Tm_above,\ max_gap,pt_longer_num,px_longer_num,pt_foot_conc,px_foot_conc,pt_px_foot_match_max,hair_tar_max,overhang_pt_tar_max,overhang_px_tar_max, target_mismatch): print "enter",target_file, hairpin_file, extra_base_file, templates_file if (os.path.isfile(target_file) and os.path.isfile(hairpin_file) and os.path.isfile(extra_base_file) and os.path.isfile(templates_file)): print os.path.isfile(target_file),os.path.isfile(hairpin_file),os.path.isfile(extra_base_file),os.path.isfile(templates_file) print "all necessary file exist!" File_jf.three_file_check_symbol(target_file,hairpin_file,extra_base_file) input_content=open(target_file).read() seq_num=[i - 1 for i in range(len(input_content)) if input_content.startswith('>', i - 1)] if len(seq_num)!=1: print "input should be one and only one sequence in fasta format!" return 0 else: for cur_record in SeqIO.parse(open(target_file), "fasta"): input_seq=str(cur_record.seq).upper() else: #Form = QtGui.QWidget() #QtGui.QMessageBox.critical(Form,"Error", "you haven't properly installed perl yet!") print "error, necessary file is not there" exit() return 0 print "what's wrong with this?working on obtain pt and px foot" configure.progress_simbol=1 check_file_size(1) ptpx_foot_list=ptpx_foot(input_seq,PT_foot_min,PT_foot_max,PX_foot_min,PX_foot_max,e,'p') if two_direction : ptpx_foot_list=ptpx_foot_list|ptpx_foot(revcomp(input_seq),PT_foot_min,PT_foot_max,PX_foot_min,PX_foot_max,e,'n') ###################get the pt and px foot sequence f_p=open(configure.temper_print,'w') f_p2=open('del.txt','w') print >>f_p2, ptpx_foot_list print "done with working on obtain pt and px foot" write_ptpx_foot_file_check_foot(ptpx_foot_list,input_seq,pt_px_foot_match_max,configure.pt_foot_file1, configure.px_foot_file1,configure.tar_file1)###################get the pt and px foot sequence stored in files print "done with writing pt/px/target files" configure.progress_simbol=2 #check_file_size(2) print PT_Tm_above,PX_Tm_above Tm_pfoot(configure.pt_foot_file1,configure.px_foot_file1,configure.tar_file1, PT_Tm_above,PX_Tm_above,configure.pt_foot_file2,configure.px_foot_file2,configure.tar_file2, configure.pt_bind_filename, configure.px_bind_filename, pt_foot_conc,px_foot_conc) print configure.pt_foot_file2,configure.px_foot_file2,configure.tar_file2,"are generated!" configure.progress_simbol=3 check_file_size(3) if include_line!='': # if no include organism combine_check_include(include_line,target_mismatch,configure.tar_file2,configure.pt_foot_file3,configure.px_foot_file3,configure.tar_file3, configure.blast_in_file) else: shutil.copy2(configure.pt_foot_file2,configure.pt_foot_file3) shutil.copy2(configure.px_foot_file2,configure.px_foot_file3) shutil.copy2(configure.tar_file2,configure.tar_file3) print "include check over" configure.progress_simbol=4 check_file_size(4) bind_hairpin(hairpin_file,extra_base_file, configure.pt_foot_hair_file1, configure.px_foot_hair_file1, configure.tar_hair_file1,hair_tar_max) print "bind_hairpin over" configure.progress_simbol=5 check_file_size(5) self_Tm_check_eachother(configure.pt_foot_hair_file1,configure.px_foot_hair_file1,configure.tar_hair_file1,configure.whole_PTX_tm,configure.pt_foot_hair_file2, configure.px_foot_hair_file2,configure.tar_hair_file2, configure.ptx_melt_file) print "self Tm check over" configure.progress_simbol=6 check_file_size(6) combine_PT(templates_file,configure.pt_foot_hair_file2,configure.tar_hair_file1,configure.whole_PT1,configure.overhang_pt_tar_max) # bind well-performing template from templates_file and pt foot with haipin from pt_foot_hair_file3 print "combine_PT is over" print "*******",configure.whole_PT1 configure.progress_simbol=6.5 check_file_size(6.5) self_bind(configure.whole_PT1,configure.whole_PT_self_max,'-pt', configure.whole_PT2) print "self_bind PT1 is over" configure.progress_simbol=7 check_file_size(7) self_bind(configure.px_foot_hair_file2,configure.whole_PX_self_max,'-px',configure.whole_PX1) configure.progress_simbol=8 check_file_size(8) if exclude_line!='': combine_check_exclude(configure.whole_PT2, configure.whole_PX1,exclude_line,pt_longer_num,px_longer_num,configure.pt_blast,configure.px_blast,configure.finalptx) else: combine_pt_px_result(configure.whole_PT2, configure.whole_PX1,configure.finalptx) #configure.progress_simbol=9 #check_file_size(9) #print "combine_PT is over" #print >>f_p, 'Tm_pt_foot_tar' #print >>f_p, Tm_pt_foot_tar #print >>f_p, 'tar_include' #print >>f_p, tar_include #print >>f_p, "Tm_p_foot_hair_tar" #print >>f_p, Tm_p_foot_hair_tar #print >>f_p, "overhang_bind_pt" #print >>f_p, overhang_bind_pt #print >>f_p, "whole_self_bind" #print >>f_p, whole_self_bind f_p.close() configure.progress_simbol=10 check_file_size(10)