Commit 526c2950 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

use ec numbers and doi from kegg

parent 6d9e0518
Pipeline #35724 failed with stages
in 2 minutes and 50 seconds
......@@ -55,7 +55,7 @@ export default {
},
{
title: 'Name(s)',
content: response.data.name,
content: response.data.names.join(),
},
{
title: 'Definition',
......@@ -65,12 +65,33 @@ export default {
},
buildKeggExpandDetails(response) {
this.keggExpandDetails = [
this.buildEcNumbers(response),
this.buildPathways(response),
this.buildDiseases(response),
this.buildModules(response),
this.buildReferences(response),
];
},
buildEcNumbers(response) {
var ec_numbers = {
title: 'EC numbers',
icon: 'fas fa-exchange-alt',
content: [],
};
if(response.data.ec_numbers) {
Object.entries(response.data.ec_numbers).forEach(([key, value]) => {
var link_id = value.split('.-')[0]
ec_numbers.content.push(
{
id: value,
url: `https://www.ebi.ac.uk/intenz/query?cmd=SearchEC&ec=${link_id}`,
url_label: "Open in IntEnz",
},
);
});
}
return ec_numbers;
},
buildPathways(response) {
var pathways = {
title: 'Pathways',
......@@ -139,14 +160,33 @@ export default {
};
if (response.data.references) {
for (let i = 0; i < response.data.references.length; i++) {
references.content.push(
{
id: response.data.references[i].title,
name: `${response.data.references[i].authors[0]} et al. ${response.data.references[i].journal}`,
url: `https://www.ncbi.nlm.nih.gov/pubmed/${response.data.references[i].pubmed_id}`,
url_label: "Open in Pubmed"
},
);
var url = null
if (response.data.references[i].doi){
var url = `https://doi.org/${response.data.references[i].doi}`;
var url_label = "Open in doi.org";
}
else if (response.data.references[i].pubmed_id) {
var url = `https://www.ncbi.nlm.nih.gov/pubmed/${response.data.references[i].pubmed_id}`;
var url_label = "Open in Pubmed";
}
if (url) {
references.content.push(
{
id: response.data.references[i].title,
name: `${response.data.references[i].authors[0]} et al. ${response.data.references[i].journal}`,
url: url,
url_label: url_label,
},
);
}
else {
references.content.push(
{
id: response.data.references[i].title,
name: `${response.data.references[i].authors[0]} et al. ${response.data.references[i].journal}`,
},
);
}
};
}
return references;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment