'jaspar_info_percentage','e_val','motif_score','motif_score_percentage',\ 'failure_rate','success_rate','false_positive_rate','false_negative',\ 'promoter_size','number_of_sequences','model','markov_order','iterations'\ ,'stdev(avg_eval)','stdev(avg_score)','stdev(avg_pscore)',\ 'stdev(avg_frate)','stdev(avg_srate)','stdev(avg_fprate)','stdev(avg_fn)'\ ,sep=', ') else: #seq, motif,nsites,m_pos, m_strand,meme_wid,j_pos,j_strand,len(jpwm),p_val\ #,score,p_score,meme_eval,fpos,0,posdis,fl,overlap,overlap_p,p,n,m,o print('file','sequence','motif','number_of_sites','meme_position', 'meme_strand'\ ,'meme_width','j_position','j_strand','j_width','p_value','score',\ 'score_percentage','e_value','false_pos','false_neg','positional_distance'\ ,'fail','overlap','overlap percentage', 'promoter length',\ 'number_of_sequences','model', 'markov_order','iterations',sep=', ') jpwm = motiflib.read_JASPAR(arg.jasparfile) bits, p_bits = motiflib.score_motifbit(jpwm) for p in promoter: for n in numseq: for m in model: #for o in markov_order: if arg.condenseddata: final = [] for r in range(iterations): #(p,n,m,o,r) #print(' ALL INFO !!!!!!!!!!!!!!!!') #print('r',r) promoter_file = memepipelib.generate_promoter_bg\ (arg.jasparfile,p,n,freq,background,r+1,arg.condenseddata) #print('file',promoter_file) #print('') j_info, numjsites = motiflib.read_testmotif(promoter_file)
model = ['zoops', 'oops', 'anr'] jasparfiles = os.listdir(directory) jasparfiles.sort() print('file', 'length motif', 'information in bits', 'percentage bit score', 'performance', 'performance percentage', 'model', sep=', ') for fl in jasparfiles: filepath = f'Jaspar/{fl}' motif = motiflib.read_JASPAR(filepath) bits, p_bits = motiflib.score_motifbit(motif) for m in model: modscore = [] modscorep = [] for i in range(arg.numiterations): tmpfile = f'/tmp/testmotif{fl}_{i}.fa' cmd = f'python3 markov_motifapalooza.py --jasparfile {filepath} \ --dnafile {arg.dnafile} --markov_order {o} --numseq {n} --seqlen {p} --freq {freq} > {tmpfile} ' os.system(cmd) cmd = f'{arg.memepath} {tmpfile} -dna -markov_order {o} -mod {m}' os.system(cmd) memetxt = 'meme_out/meme.txt' motifs, motif_stats = motiflib.memepwm(memetxt) for mot in motifs: performance = motiflib.local_motcompare(mot, motif)