Skip to content

Commit

Permalink
feat(R214): GTDB R214 preview.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmussig committed Apr 21, 2023
1 parent 52bc646 commit ee74a9f
Show file tree
Hide file tree
Showing 9 changed files with 612 additions and 15 deletions.
2 changes: 2 additions & 0 deletions assets/models/taxon-history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export enum TaxonHistoryRelease {
R95 = "95",
R202 = "202",
R207 = "207",
R214 = "214",
NCBI = "NCBI"
}

Expand All @@ -20,6 +21,7 @@ export const TaxonHistoryReleases = [
TaxonHistoryRelease.R95,
TaxonHistoryRelease.R202,
TaxonHistoryRelease.R207,
TaxonHistoryRelease.R214,
TaxonHistoryRelease.NCBI
]

Expand Down
56 changes: 56 additions & 0 deletions components/stats/REDr214.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<template>
<div class="mt-2">
<h3>Bacteria</h3>
<div id="mpld3_bacteria_r207"></div>

<h3>Archaea</h3>
<div id="mpld3_archaea_r207"></div>

</div>
</template>

<script lang="ts">
import Vue from 'vue';
import * as d3 from 'd3v5';
//@ts-ignore
import mpld3 from 'mpld3';
const archaea = require('~/assets/data/stats/r207/red-archaea.json')
const bacteria = require('~/assets/data/stats/r207/red-bacteria.json')
export default Vue.extend({
mounted() {
mpld3.register_plugin("axisreplacer", AxisReplacer);
AxisReplacer.prototype = Object.create(mpld3.Plugin.prototype);
AxisReplacer.prototype.constructor = AxisReplacer;
AxisReplacer.prototype.requiredProps = ["data"];
AxisReplacer.prototype.defaultProps = {}
// @ts-ignore
function AxisReplacer(fig, props){
// @ts-ignore
mpld3.Plugin.call(this, fig, props);
}
AxisReplacer.prototype.draw = function(){
let data = this.props.data;
let parent = document.getElementsByClassName("mpld3-yaxis")[0];
let gTicks = parent.getElementsByTagName("g");
for (let i=0; i < gTicks.length; i++) {
let curTick = gTicks[i];
let curText = curTick.getElementsByTagName("text")[0];
curText.innerHTML = data[i];
}
};
// @ts-ignore
mpld3.draw_figure("mpld3_archaea_r207", archaea);
mpld3.draw_figure("mpld3_bacteria_r207", bacteria);
}
})
</script>

<style scoped>
</style>
14 changes: 7 additions & 7 deletions components/taxon-history/TaxonHistoryFullTaxonomy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<td v-if="currentTaxonIndex >= 0"
>
<!-- If this is the current release, link to the tree -->
<template v-if="item.release === 'R207' && item.taxonomy.d.length > 3">
<template v-if="item.release === 'R214' && item.taxonomy.d.length > 3">
<nuxt-link :to="`/tree?r=${item.taxonomy.d}`">
{{ item.taxonomy.d }}
</nuxt-link>
Expand All @@ -53,7 +53,7 @@
</td>
<td v-if="currentTaxonIndex >= 1">
<!-- If this is the current release, link to the tree -->
<template v-if="item.release === 'R207' && item.taxonomy.p.length > 3">
<template v-if="item.release === 'R214' && item.taxonomy.p.length > 3">
<nuxt-link :to="`/tree?r=${item.taxonomy.p}`">
{{ item.taxonomy.p }}
</nuxt-link>
Expand All @@ -65,7 +65,7 @@
</td>
<td v-if="currentTaxonIndex >= 2">
<!-- If this is the current release, link to the tree -->
<template v-if="item.release === 'R207' && item.taxonomy.c.length > 3">
<template v-if="item.release === 'R214' && item.taxonomy.c.length > 3">
<nuxt-link :to="`/tree?r=${item.taxonomy.c}`">
{{ item.taxonomy.c }}
</nuxt-link>
Expand All @@ -77,7 +77,7 @@
</td>
<td v-if="currentTaxonIndex >= 3">
<!-- If this is the current release, link to the tree -->
<template v-if="item.release === 'R207' && item.taxonomy.o.length > 3">
<template v-if="item.release === 'R214' && item.taxonomy.o.length > 3">
<nuxt-link :to="`/tree?r=${item.taxonomy.o}`">
{{ item.taxonomy.o }}
</nuxt-link>
Expand All @@ -89,7 +89,7 @@
</td>
<td v-if="currentTaxonIndex >= 4">
<!-- If this is the current release, link to the tree -->
<template v-if="item.release === 'R207' && item.taxonomy.f.length > 3">
<template v-if="item.release === 'R214' && item.taxonomy.f.length > 3">
<nuxt-link :to="`/tree?r=${item.taxonomy.f}`">
{{ item.taxonomy.f }}
</nuxt-link>
Expand All @@ -101,7 +101,7 @@
</td>
<td v-if="currentTaxonIndex >= 5">
<!-- If this is the current release, link to the tree -->
<template v-if="item.release === 'R207' && item.taxonomy.g.length > 3">
<template v-if="item.release === 'R214' && item.taxonomy.g.length > 3">
<nuxt-link :to="`/tree?r=${item.taxonomy.g}`">
{{ item.taxonomy.g }}
</nuxt-link>
Expand All @@ -113,7 +113,7 @@
</td>
<td v-if="currentTaxonIndex >= 6">
<!-- If this is the current release, link to the tree -->
<template v-if="item.release === 'R207' && item.taxonomy.s.length > 3">
<template v-if="item.release === 'R214' && item.taxonomy.s.length > 3">
<nuxt-link :to="`/tree?r=${item.taxonomy.s}`">
{{ item.taxonomy.s }}
</nuxt-link>
Expand Down
7 changes: 7 additions & 0 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ export default {
},
],
navStatistics: [
{
icon: 'mdi-apps',
title: 'Release 214',
to: '/stats/r214',
nuxt: true,
external: false,
},
{
icon: 'mdi-apps',
title: 'Release 207',
Expand Down
2 changes: 1 addition & 1 deletion nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export default {
advancedMaxHistory: 50, // Maximum number of history states to retain in advanced search
captchaSiteKey: process.env.CAPTCHA_KEY,
googleAnalyticsId: process.env.GA_TRACKING_ID,
latestStatsPageUrl: '/stats/r207', // this is used to point to the latest stats page,
latestStatsPageUrl: '/stats/r214', // this is used to point to the latest stats page,
nuxtVersion: version,
apiCacheKey: loadApiVersion(),
fastAniJobCookieName: 'fastani-jobs'
Expand Down
8 changes: 4 additions & 4 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<!-- First row -->
<div class="d-flex flex-column">
<NotifyBar uid="r207">
*** GTDB Release 207 is now available 🎉
<NotifyBar uid="r214">
*** GTDB Release 214 is now available 🎉
<NuxtLink class="mx-1" to="/downloads">download files</NuxtLink>
***
</NotifyBar>
Expand Down Expand Up @@ -141,8 +141,8 @@ export default Vue.extend({
/* Summary stats */
nGenomes: 6062 + 311480,
releaseVer: '07-RS207',
releaseDate: '8th April 2022',
releaseVer: '08-RS214',
releaseDate: 'XXXTBA April 2022',
}),
})
</script>
Expand Down
Loading

0 comments on commit ee74a9f

Please sign in to comment.