Skip to content

Commit

Permalink
add required field, starts discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
crsct authored and lukasjelonek committed Aug 30, 2023
1 parent e752c2d commit 12eafc1
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 44 deletions.
98 changes: 56 additions & 42 deletions src/views/show-results/DatasetSummary.vue
Original file line number Diff line number Diff line change
@@ -1,50 +1,64 @@
<template>
<table v-if="annotation" class="table statstable">
<tr>
<th scope="row">Genus:</th>
<td>{{ annotation.genome.genus }}</td>
</tr>
<tr>
<th scope="row">Species:</th>
<td>{{ annotation.genome.species }}</td>
</tr>
<tr>
<th scope="row">Strain:</th>
<td>{{ annotation.genome.strain }}</td>
</tr>
<tr>
<th scope="row">Complete:</th>
<td>{{ annotation.genome.complete }}</td>
</tr>
<tr>
<th scope="row">Genome size:</th>
<td>{{ annotation.stats.size }}</td>
</tr>
<tr>
<th scope="row">GC:</th>
<td>{{ ratioToPercentage(annotation.stats.gc) }}</td>
</tr>
<tr>
<th scope="row">N ratio:</th>
<td>
<NRatio :value="annotation.stats.n_ratio"></NRatio>
</td>
</tr>
<tr>
<th scope="row">Coding ratio:</th>
<td>
{{ ratioToPercentage(annotation.stats.coding_ratio) }}
</td>
</tr>
<table class="table statstable">
<template v-if="annotation">
<tr>
<th scope="row">ID:</th>
<td>{{ id }}</td>
</tr>
<tr>
<th scope="row">Species:</th>
<td>{{ species }}</td>
</tr>
<tr>
<th scope="row">Strain:</th>
<td>{{ annotation.genome.strain }}</td>
</tr>
<tr>
<th scope="row">Genome size:</th>
<td>{{ annotation.stats.size + " bp" }}</td>
</tr>
<tr>
<th scope="row">GC:</th>
<td>{{ ratioToPercentage(annotation.stats.gc) }}</td>
</tr>
</template>
<template v-else>
<tr>
<th scope="row">There is no bakta file availabe.</th>
</tr>
</template>
<template v-if="checkm">
<tr>
<th scope="row">Completeness:</th>
<td>{{ checkm.quality.completeness + "%" }}</td>
</tr>
<tr>
<th scope="row">Contamination:</th>
<td>{{ checkm.quality.contamination + "%" }}</td>
</tr>
</template>
<template v-else>
<tr>
<th scope="row">There is no checkm file available.</th>
</tr>
</template>
</table>
<div v-else>No bakta result provided</div>
</template>
<script setup lang="ts">
import NRatio from "@/components/NRatio.vue";
import type { BaktaResult } from "@/model/BaktaResults";
import type { CheckmResult } from "@/model/CheckmResults";
import { ratioToPercentage } from "@/util";
import type { PropType } from "vue";
defineProps({
annotation: { type: Object as PropType<BaktaResult>, default: undefined },
import { computed, type PropType } from "vue";
const props = defineProps({
annotation: { type: Object as PropType<BaktaResult> },
checkm: { type: Object as PropType<CheckmResult> },
id: { type: String },
});
const species = computed(() => {
return props.annotation?.genome.genus + " "
+ props.annotation?.genome.species.charAt(0).toLocaleUpperCase() + props.annotation?.genome.species.slice(1);
})
</script>
8 changes: 6 additions & 2 deletions src/views/show-results/ResultView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,18 @@ const showActionModal = ref(false);
</template>
<template v-if="active_tab == 'summary'">
<div class="col-4">
<DatasetSummary :annotation="baktaResult" />
<DatasetSummary
:annotation="baktaResult"
:id="id"
:checkm="checkmResult"
/>
</div>
</template>
<template v-if="active_tab == 'annotation'">
<!-- <div class="h5" @click="toggle.annotation = !toggle.annotation"><i class="bi"
:class="toggle.annotation ? 'bi-caret-down' : 'bi-caret-right'"></i>Annotation</div> -->
<div v-if="toggle.annotation">
<DatasetSummary :annotation="baktaResult" />
<DatasetSummary :annotation="baktaResult" :id="id" :checkm="checkmResult" />
<button class="my-4 btn btn-primary" @click="featureTable = !featureTable">
<template v-if="featureTable"> Hide Table </template>
<template v-else> Show Table </template>
Expand Down

0 comments on commit 12eafc1

Please sign in to comment.