#dic_sd_motifs = {'global_x' : 'len_str', 'global_y' : 'std deviation :: nb. occurences'}
#dic_sd_occurs = {'global_x' : 'len_str', 'global_y' : 'std_deviation :: nb. motifs'}

lc = ['r-','y-','b-','g-','r.','y.','b.','g.','r--','y--','b--','g--']

cpt = 0

for alpha_size in xrange(step_alphabet, o.alphabet_size+1, step_alphabet) :
  list_x = []
  list_y_motifs = []
  list_y_occurs = []
  list_y_avg = []
#  list_y_sd_motifs = []
#  list_y_sd_occurs = []
  for i in xrange(step_run, o.len_max+1, step_run) :
    motif, occ, avg, sd_motifs, sd_occurs = ts.run(i, alpha_size, o.nb_part, o.nb_run, o.limit_run)
    print '%s, %s, %s(%s), %s(%s), %s'%(alpha_size, i, motif, sd_motifs, occ, sd_occurs, avg)
    list_x.append(i)
    list_y_motifs.append(motif)
    list_y_occurs.append(occ)
    list_y_avg.append(avg)
#    list_y_sd_motifs.append(sd_motifs)
#    list_y_sd_occurs.append(sd_occurs)

  dic_occurs[alpha_size] = {'style_plot':'%s'%lc[cpt],
                            'name_legend':'(alpha:%s)'%(alpha_size),
                            'list_x':list_x,
                            'list_y':list_y_occurs}
  dic_motifs[alpha_size] = {'style_plot':'%s'%lc[cpt],
                            'name_legend':'(alpha:%s)'%(alpha_size),
                            'list_x':list_x,
Example #2
0
    file_out = open('%s' % (path_graph_len), 'w')
    file_out.write(str(dic_out))
    file_out.close()


for i in xrange(len_min, len_max + 1, step_run):
    list_x = []
    list_y_motifs = []
    list_y_occurs = []
    list_y_avg = []
    #  list_y_sd = []
    #  list_y_sd_motifs = []
    #  list_y_sd_occurs = []
    for alpha_size in xrange(alphabet_min, alphabet_max + 1, step_alphabet):
        #   motif, occ, avg, sd_motifs, sd_occurs, dic_occ_len, dic_mot_len = ts.run(i, alpha_size, o.nb_part, o.nb_run, o.limit_run)
        motif, occ, avg, dic_occ_len, dic_mot_len = ts.run(
            i, alpha_size, o.nb_part, o.nb_run, o.limit_run)
        treat_info_len(dic_occ_len, "occ", dir_xp_len, i, alpha_size)
        treat_info_len(dic_mot_len, "mot", dir_xp_len, i, alpha_size)

        #    print '%s, %s, %s(%s), %s(%s), %s'%(alpha_size,i,motif,sd_motifs,occ,sd_occurs, avg)
        print '%s, %s, %s, %s, %s' % (alpha_size, i, motif, occ, avg)
        list_x.append(alpha_size)
        list_y_motifs.append(motif)
        list_y_occurs.append(occ)
        list_y_avg.append(avg)
#    list_y_sd_motifs.append(sd_motifs)
#    list_y_sd_occurs.append(sd_occurs)

    dic_occurs[i] = {
        'style_plot': '%s' % lc[cpt],
        'name_legend': '(len:%s)' % (i),
                'list_y':list_len_y}
  file_out = open('%s'%(path_graph_len),'w')
  file_out.write(str(dic_out))
  file_out.close()

for i in xrange(len_min, len_max+1, step_run) :
  list_x = []
  list_y_motifs = []
  list_y_occurs = []
  list_y_avg = []
#  list_y_sd = []
#  list_y_sd_motifs = []
#  list_y_sd_occurs = []
  for alpha_size in xrange(alphabet_min, alphabet_max+1, step_alphabet) :
#   motif, occ, avg, sd_motifs, sd_occurs, dic_occ_len, dic_mot_len = ts.run(i, alpha_size, o.nb_part, o.nb_run, o.limit_run)
    motif, occ, avg, dic_occ_len, dic_mot_len = ts.run(i, alpha_size, o.nb_part, o.nb_run, o.limit_run)
    treat_info_len(dic_occ_len, "occ", dir_xp_len, i, alpha_size)
    treat_info_len(dic_mot_len, "mot", dir_xp_len, i, alpha_size)

#    print '%s, %s, %s(%s), %s(%s), %s'%(alpha_size,i,motif,sd_motifs,occ,sd_occurs, avg)
    print '%s, %s, %s, %s, %s'%(alpha_size, i, motif, occ, avg)
    list_x.append(alpha_size)
    list_y_motifs.append(motif)
    list_y_occurs.append(occ)
    list_y_avg.append(avg)
#    list_y_sd_motifs.append(sd_motifs)
#    list_y_sd_occurs.append(sd_occurs)

  dic_occurs[i] = {'style_plot':'%s'%lc[cpt],
                   'name_legend':'(len:%s)'%(i),
                   'list_x':list_x,
lc = [
    'r-', 'y-', 'b-', 'g-', 'r.', 'y.', 'b.', 'g.', 'r--', 'y--', 'b--', 'g--'
]

cpt = 0

for alpha_size in xrange(step_alphabet, o.alphabet_size + 1, step_alphabet):
    list_x = []
    list_y_motifs = []
    list_y_occurs = []
    list_y_avg = []
    #  list_y_sd_motifs = []
    #  list_y_sd_occurs = []
    for i in xrange(step_run, o.len_max + 1, step_run):
        motif, occ, avg, sd_motifs, sd_occurs = ts.run(i, alpha_size,
                                                       o.nb_part, o.nb_run,
                                                       o.limit_run)
        print '%s, %s, %s(%s), %s(%s), %s' % (alpha_size, i, motif, sd_motifs,
                                              occ, sd_occurs, avg)
        list_x.append(i)
        list_y_motifs.append(motif)
        list_y_occurs.append(occ)
        list_y_avg.append(avg)
#    list_y_sd_motifs.append(sd_motifs)
#    list_y_sd_occurs.append(sd_occurs)

    dic_occurs[alpha_size] = {
        'style_plot': '%s' % lc[cpt],
        'name_legend': '(alpha:%s)' % (alpha_size),
        'list_x': list_x,
        'list_y': list_y_occurs