Skip to content
Snippets Groups Projects
Commit 27e22312 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion :recycle:
Browse files

Dynamically generate link for taxonomy gene detail

parent aaa45ed1
No related branches found
No related tags found
2 merge requests!59Prod,!35Keep all hierarchy of a given taxonomy in the hierarchy field
Pipeline #21436 passed with stages
in 2 minutes and 44 seconds
......@@ -70,50 +70,42 @@ export default {
},
})
.then((response) => {
console.log(response.data.hierarchy);
const ncbi_tax_url = 'https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?name=';
this.taxonomy_detail = [
{
title: 'Superkingdom',
content: response.data.hierarchy.superkingdom,
color: 'superkingdom',
url: ncbi_tax_url + response.data.hierarchy.superkingdom.name,
},
{
title: 'Kingdom',
content: response.data.hierarchy.kingdom,
color: 'kingdom',
url: ncbi_tax_url + response.data.hierarchy.kingdom.name,
},
{
title: 'Phylum',
content: response.data.hierarchy.phylum,
color: 'phylum',
url: ncbi_tax_url + response.data.hierarchy.phylum.name,
},
{
title: 'Class',
content: response.data.hierarchy.class,
color: 'class',
url: ncbi_tax_url + response.data.hierarchy.class.name,
},
{
title: 'Order',
content: response.data.hierarchy.order,
color: 'order',
url: ncbi_tax_url + response.data.hierarchy.order.name,
},
{
title: 'Family',
content: response.data.hierarchy.family,
color: 'family',
url: ncbi_tax_url + response.data.hierarchy.family.name,
},
{
title: 'Genus',
content: response.data.hierarchy.genus,
color: 'genus',
url: ncbi_tax_url + response.data.hierarchy.genus.name,
},
{
title: 'Species',
......@@ -121,7 +113,11 @@ export default {
color: 'species',
},
];
console.log(this.taxonomy_detail);
this.taxonomy_detail.forEach(function (item, index) {
if (item.content) {
item.url = ncbi_tax_url + item.content.name;
}
});
})
.catch((error) => {
console.log(error);
......
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