Skip to content
Snippets Groups Projects
Commit 458c581c authored by HongKee Moon's avatar HongKee Moon
Browse files

Enabled evidence star

parent 6b5b62fa
No related branches found
No related tags found
No related merge requests found
......@@ -13,15 +13,11 @@
let table;
function getRatingValue(data) {
const scoreMap = {'hungarian': 5, 'blue': 5, 'pink': 1, 'grey': 1}
return _.max(_.map(data, i => scoreMap[i]));
return _.max(_.values(data));
}
function getRating(data) {
const scoreMap = {'hungarian': 5, 'blue': 5, 'pink': 1, 'grey': 1}
const rating = _.max(_.map(data, i => scoreMap[i]));
const rating = _.max(_.values(data));
const r = ['<div style="white-space: nowrap;">']
for (let i = 0; i < 5; i++) {
if (i < rating) {
......@@ -168,19 +164,19 @@
return row.proteins.length;
}
},
// {
// title: 'Evidence Stars',
// data: 'data_sources',
// render: function ( data, type, row, meta ) {
// return getRatingValue(data);
// },
// fnCreatedCell: (nTd, sData, oData) => {
// // console.log(sData)
// if(sData) {
// $(nTd).html(getRating(sData).join('\n'));
// }
// }
// },
{
title: 'Evidence Stars',
data: 'protein_confidence_score',
render: function ( data, type, row, meta ) {
return getRatingValue(data);
},
fnCreatedCell: (nTd, sData, oData) => {
// console.log(sData)
if(sData) {
$(nTd).html(getRating(sData).join('\n'));
}
}
},
// {
// title: 'Localization',
// render: function ( data, type, row, meta ) {
......
......@@ -13,15 +13,11 @@
let table;
function getRatingValue(data) {
const scoreMap = {'hungarian': 5, 'blue': 5, 'pink': 1, 'grey': 1}
return _.max(_.map(data, i => scoreMap[i]));
return _.max(_.values(data));
}
function getRating(data) {
const scoreMap = {'hungarian': 5, 'blue': 5, 'pink': 1, 'grey': 1}
const rating = _.max(_.map(data, i => scoreMap[i]));
const rating = _.max(_.values(data));
const r = ['<div style="white-space: nowrap;">']
for (let i = 0; i < 5; i++) {
if (i < rating) {
......@@ -93,19 +89,19 @@
// return '(placeholder)';
// }
// },
// {
// title: 'Evidence Stars',
// data: 'data_sources',
// render: function ( data, type, row, meta ) {
// return getRatingValue(data);
// },
// fnCreatedCell: (nTd, sData, oData) => {
// // console.log(sData)
// if(sData) {
// $(nTd).html(getRating(sData).join('\n'));
// }
// }
// },
{
title: 'Evidence Stars',
data: 'protein_confidence_score',
render: function ( data, type, row, meta ) {
return getRatingValue(data);
},
fnCreatedCell: (nTd, sData, oData) => {
// console.log(sData)
if(sData) {
$(nTd).html(getRating(sData).join('\n'));
}
}
},
{
title: 'Species',
data: 'species_name',
......
......@@ -54,7 +54,7 @@
}, 10);
});
} else {
url = taxId === 'all' ? `${host}/proteins?fields=ensembl_gene_id,ensembl_id,functional_type,gene_name,name,species_name,species_tax_id,uniprot_id,uniprot_readable_id&size=100000`:
url = taxId === 'all' ? `${host}/proteins?fields=ensembl_gene_id,ensembl_id,functional_type,gene_name,name,species_name,species_tax_id,uniprot_id,uniprot_readable_idz&size=100000`:
`${host}/proteins?species_tax_id=${taxId}&fields=ensembl_gene_id,ensembl_id,functional_type,gene_name,name,species_name,species_tax_id,uniprot_id,uniprot_readable_id&size=100000`;
fetch(url)
......@@ -114,8 +114,8 @@
}, 10);
});
} else {
url = taxId === 'all' ? `${host}/condensates?fields=biomarkers,canonical_id,description,is_experimental,name,protein_count,proteins,species_name,species_tax_id,synonyms&size=10000`
:`${host}/condensates?species_tax_id=${taxId}&fields=biomarkers,canonical_id,description,is_experimental,name,protein_count,proteins,species_name,species_tax_id,synonyms&size=10000`;
url = taxId === 'all' ? `${host}/condensates?fields=biomarkers,canonical_id,description,is_experimental,name,protein_count,proteins,species_name,species_tax_id,synonyms,protein_confidence_score&size=10000`
:`${host}/condensates?species_tax_id=${taxId}&fields=biomarkers,canonical_id,description,is_experimental,name,protein_count,proteins,species_name,species_tax_id,synonyms,protein_confidence_score&size=10000`;
fetch(url)
.then(response => response.json())
.then((response) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment