+def tablegeneration(reportdata,sectionlabel):
+ labelhtml = '<h2>'+sectionlabel+'</h2>'
+ # creating html table from dataframe
+ reportdatasub = reportdata[["Variant ID", "Allele ID", "Clinical Significance","Disease Name", "Frequency EXAC", "Frequency 1000 Genomes Project","Zygosity","URL"]]
+
+ reportdatasub['Disease Name'] = reportdatasub['Disease Name'].str.replace('|','<br/>')
+ str_io = io.StringIO()
+ reportdatasub.to_html(buf=str_io, classes='table table-bordered',index_names=False,index=False)
+ html_str = str_io.getvalue()
+ html_str_encoded = unicode(html_str).encode('utf8')
+ html_str_encoded = html_str_encoded.replace('<','<')
+ html_str_encoded = html_str_encoded.replace('>','>')
+ html_str_encoded = html_str_encoded.replace('_',' ')
+ section_html = labelhtml+html_str_encoded
+ return section_html
+