Пример #1
0
def mk_su_set_filter(su_set_f):
    html = mk_su_names_filter(su_set_f.su_names_f, 'subunit composition')
    html += sh.mk_select('su_set_option',
                         su_set_f.options,
                         su_set_f.opt_to_label,
                         selected_set=sf.to_set(su_set_f.option))
    html += '</td>\n</tr></table></font>\n'
    return html
Пример #2
0
 def __init__(self, aac_col, ref_aac):
   #set up scores and their dependent variables:
   self.prob, self.all_shen, self.spl_shen, self.sm, self.sd, = 0, 0, 0, 0, 0
   self.norm_p_val, self.shen_score, self.prob_score = 0, 0, 0
   self.aac_col, self.ref_aac = aac_col, ref_aac
   self.aac_names = sorted(sf.to_set(aac_col))
   self.all_aac_to_fract = self.mk_fractions(aac_col)[1]
   self.set_aac_order() 
   self.spl_aac_to_num, self.spl_aac_to_fract = dict(), dict()
   self.aac_to_diff = dict()
Пример #3
0
def mk_su_names_filter(su_names_f, label):
    uf, f_name = su_names_f.use_filter, su_names_f.f_name
    html = mk_filter_cell(uf, f_name, label) + '<tr><td>'
    html += sh.mk_select(f_name,
                         su_names_f.su_names,
                         is_mult=True,
                         size=4,
                         selected_set=sf.to_set(su_names_f.chosen_names))
    html += '</td>\n</tr></table></font>\n'
    return html
Пример #4
0
def mk_action_select(col_name):
    # changing actions change them in js actChanged too!
    val_list = ['none', 'edit', 'from_field', 'delete']
    val_to_label = {
        'none': 'no action',
        'edit': 'edit',
        'from_field': 'fill from field above',
        'delete': 'delete'
    }
    jscr = ' onchange = "actChanged(this, \'' + col_name + '\')"'
    act_sel = sh.mk_select(get_act_field_name(col_name),
                           val_list,
                           val_to_label,
                           js=jscr,
                           selected_set=sf.to_set('none'))
    return act_sel
Пример #5
0
def get_chosen_su_names(post_data, filter_name):
    return sf.to_set(post_data.getvalue(filter_name, []))
Пример #6
0
 def _set_ranks(self, chosen_ranks):
     self.chosen_ranks = sf.to_set(chosen_ranks) & self.ranks
Пример #7
0
 def __init__(self, su_names_f, post_data):
     self.su_names_f = su_names_f
     self.use_filter = su_names_f.use_filter
     self.su_names_set = sf.to_set(su_names_f.su_names)
     self.chosen_su_set = set(su_names_f.chosen_names)
     self.option = fh.get_su_set_option(post_data)
Пример #8
0
 def get_split_source_field(self):
   sel_set = {'current_split':'current split ids', 
              'su_pos_aac':'specified aminoacid',
              'filters':'filters'}
   return sh.mk_select('split_source', list(sel_set.keys()), sel_set, 
                      selected_set = sf.to_set('current_split'))
Пример #9
0
 def get_show_mode_field(self):
   show_modes = {'True':'blocks and spacers', 'False':'sequence'}
   return sh.mk_select('show_mode', ['True', 'False'], show_modes,
                        selected_set = sf.to_set(str(self.show_blocks)))