-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_table_row.js
44 lines (40 loc) · 2.03 KB
/
get_table_row.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
function get_table_row(genome_record) {
let assembly_url = '';
if (genome_record.assembly) {
assembly_url = 'https://ncbi.nlm.nih.gov/assembly/' + genome_record.assembly;
}
let checkedAttr = selectedTaxa[genome_record.up_id] !== undefined ? "checked" : "";
let scientific_name = genome_record.organism_name;
let common_name = '';
if (scientific_name.match(/(.*)?(\(.*)/)) {
scientific_name = RegExp.$1;
common_name = RegExp.$2;
}
let name = `<i>${scientific_name}</i> ${common_name}`;
let list_html = '<tr>';
list_html += `<td align="center"><input type="checkbox" class="add_genome" ${checkedAttr} title="Select"></td>`;
if (genome_record.types.match(/Reference_Proteome/)) {
list_html += '<td align="center"> ○ </td>';
} else {
list_html += '<td> </td>';
}
// if (types.match(/Representative_Proteome/)) {
// list_html += '<td align="center"> ○ </td>';
// } else {
// list_html += '<td> </td>';
// }
list_html += `<td class="proteome-id-td"><a href="${genome_record.up_id_url}" target="_blank">${genome_record.up_id}</a></td>`;
list_html += `<td><a href="${assembly_url}" target="_blank">${genome_record.assembly}</a></td>`;
list_html += '<td>' + genome_record.genome_taxid + '</td>';
list_html += '<td class="genome_name">' + name + '</td>';
list_html += '<td align="right">' + genome_record.n_genes.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') + '</td>';
list_html += '<td align="right">' + genome_record.n_isoforms.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') + '</td>';
list_html += '<td align="right">' + genome_record.cpd_label + '</td>';
list_html += '<td align="right">' + genome_record.busco_complete + '</td>';
list_html += '<td align="right">' + genome_record.busco_single + '</td>';
list_html += '<td align="right">' + genome_record.busco_multi + '</td>';
list_html += '<td align="right">' + genome_record.busco_fragmented + '</td>';
list_html += '<td align="right">' + genome_record.busco_missing + '</td>';
list_html += '</tr>';
return list_html;
}