Пример #1
0
def mk_data_form(v_data, content):# opt_panel, bm_panel, filt_panel):
  html = '<form id = "metadata" method = "POST">'
  html += sh.mk_db_name_field(v_data.db_name)
  html += sh.mk_hidden_field('al_id', str(v_data.al_id))
  html += '<table class = "form_holder"><tr>' #viewer options
  html += '<td>' + mk_options_panel(v_data) + '</td>\n'
  html += '<td>' + mk_block_markup_panel(v_data) + '</td>'
  html += '</tr>\n</table>\n' #viewer options closed
  html += '<table class = "form_holder">' 
  html += '<tr><td>' + mk_filters_panel(v_data) + '</td></tr>\n'
  html += '</table>\n' #form_holder closed
  html += '<table class = "form_holder"><tr><td>'
  # html += fh.mk_filter_form(v_data.filter_set, 'Set filters to get split ids', 
          # 'Load filtered ids','fusedAlViewer.py', 'metadata', False, False)
  # html += '</td><td>Source of split enzymes set:<br>'
  # html += sh.mk_select('split_source', ['filters', 'checkboxes', 'su_pos_aac'])
  # html += sh.mk_submit_btn('Split with polinomial probability', 
          # 'splitAnProb.py')
  # html += sh.mk_submit_btn('Split and analyse with Shannon entropy', 
                           # 'splitAnShan.py')
  html += sh.mk_submit_btn('Split and analyse',  'splitAn.py')
  html += '</td></tr></table>\n'
  html += content
  html += '</form>\n'
  return html
Пример #2
0
def mk_actions(table_name):
    tn = table_name  # get_table_name(post_data)
    format_info = 'File format: id ## col1 := val1 ## col2 := val2 ... \n' + \
      'Id is a ceil number represents an identifier in ' + tn + ' table.\n' + \
      'Col1, col2, ... are attribute column names in ' + tn + ' table. \n' + \
      'Value is everything but :=, ## and end-of-line symbols taking \n' + \
      'that its type has to be of valid attribute data types'
    html = '<fieldset><legend>Actions with attributes</legend><table><tr><td>\n'
    html += sh.mk_submit_btn('Add', 'addCol.py')
    html += '<input type = "number" min = "0" max = "10" name = "add_col_num">'
    html += ' attribute columns to table "' + tn + '"</td><td>'
    html += 'File to update chosen attributes: '
    html += '<input type = "file" name = "attr_scr_xml" title = "' + \
            format_info + '">\n'
    html += sh.mk_submit_btn('Perform selected actions', 'attrColEdit.py')
    html += '\n</td></tr></table></fieldset>\n'
    return html
Пример #3
0
def mk_options_panel(v_data):  
  html = '<table>'
  html += '<tr><td title = "select reference enzyme for alignment postitions">'
  html += 'Reference enzyme: ' + v_data.get_ref_id_field() + '</td></tr>\n'
  html += '<tr><td title = "show alignment as blocks and spacers or as sequence">'
  html += 'Show mode: ' + v_data.get_show_mode_field()
  html += v_data.get_set_bm_checkbox_html() + v_data.get_save_bm_checkbox_html()
  html += '</td></tr>\n <tr><td>'
  html += sh.mk_submit_btn('Apply options', 'fusedAlViewer.py')
  html += '</td></tr>\n</table>\n'
  return html
Пример #4
0
def mk_main_form(db_info_list):
  html = '<form id = "metadata" enctype="multipart/form-data">'
  html += sh.mk_action_field()
  html += mk_db_table_html(db_info_list)
  html += '<table class = "form_holder"><tr><td>'
  #actions with chosen:
  # html += '<input type = "hidden" name = "db_name" value = "">\n' 
  # js doesn't work with onclick and radiobox, so db_name is kept in radiobox 
  # values
  html += '<fieldset><legend> Actions with chosen databases: </legend>\n'
  html += sh.mk_submit_btn('view database', 'orgEnzMan.py')
  html += sh.mk_submit_btn('show alignments','alMan.py')
  html += sh.mk_submit_btn('make/update database dump', 'dbMan.py', get_xml_act)
  html += sh.mk_submit_btn('update checked database descriptions', 'dbMan.py', 
                            upd_act)
  html += sh.mk_submit_btn('delete database', 'dbMan.py', del_act)
  html += '</fieldset></td></tr>'
  #add action:
  html += '<tr><td><fieldset><legend> New database: </legend>\n'
  # html += '* Describe new database:'
  html += '<textarea cols = "40" rows = "2" name = "' + add_db_descr + \
          '" placeholder = "place here your database description">'
  html += '</textarea> use xml file as data source: '
  html += '<input type = "file" name = "' + add_from_xml + '">\n'
  html += sh.mk_submit_btn('add database', 'dbMan.py', add_act)
  html += '</fieldset></td></tr></table>'
  html += '</form>'
  return html
Пример #5
0
def mk_data_form(db_name, id_set, filter_str, org_list, content):
  data_form = '<form enctype="multipart/form-data" id = "metadata" ' + \
              'method = "POST" >\n '
  data_form += sh.mk_db_name_field(db_name)
  data_form += sh.mk_id_set_field('enz_id', id_set)
  data_form += sh.mk_hidden_field('filter_str', filter_str)
  data_form += sh.mk_hidden_field('su_names', 
                                  str(sorted(org_list.su_names_isect)))
  data_form += content
  data_form += sh.mk_submit_btn('add fused alignment from files loaded above',
                                'alMan.py')
  data_form += '</form> \n'
  return data_form
Пример #6
0
def mk_control_panel(s_data):
  html = '<table class = "form_holder">'
  html += '<tr>'
  html += '<td>Set reference enzyme: <br>' + s_data.get_ref_id_field() + '</td>'
  onclick = "showElem(document.getElementById('ref_pos').value)"
  html += '<td><button type = "button" onclick = "' + onclick + \
          '"> Go to pos: </button><br><input id = "ref_pos" size = "8" ' + \
          'type = "text" onchange = "showElem(this.value)"></td>'
  html += '<td>Split source:<br>' + s_data.get_split_source_field() + '</td>'
  html += '<td title = "Leave only cols having score over given value">' + \
          s_data.get_prob_field() + '</td>'
  html += '<td title = "Leave only cols having score over given value">' + \
          s_data.get_shen_field() + '</td>'
  html += '<td>' + sh.mk_submit_btn('Apply', 'splitAn.py') + '</td>'
  html += '</tr>' 
  html += '</table>'
  return html
Пример #7
0
def mk_footer():
    html = sh.mk_action_field()
    html += sh.mk_submit_btn('Add attributes', 'attrColEdit.py', action='add')
    html += '</form>\n'
    return html