Skip to content
Snippets Groups Projects
Commit 7cfdbdd7 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Automatic systems list

parent 2fd7d008
No related branches found
No related tags found
1 merge request!6Automatic systems list
<script setup lang="ts"> <script setup lang="ts">
const props = defineProps<{ const props = defineProps<{
systems: any; headers: Array<Object>
systems: Array<Object>
}>(); }>();
const itemsPerParge = ref(25) const itemsPerParge = ref(25)
const search = ref('') const search = ref('')
const sortBy = ref([{ key: 'system', order: 'asc' }]) const sortBy = ref([{ key: 'system', order: 'asc' }])
const headers = ref([{
title: "Systems",
key: "system"
}, { title: "Articles", key: "dois" }
])
function filterOnlyCapsText(value, query, item) {
if (value != null && query != null) {
if (typeof value === 'string') {
return value.toString().toLowerCase().indexOf(query.toLowerCase()) !== -1
}
if (typeof value == 'object') {
if (value?.name) {
return value.name.toString().toLowerCase().indexOf(query.toLowerCase()) !== -1
}
}
}
return false
}
</script> </script>
<template> <template>
<v-card flat color="transparent" class="my-5"> <v-card flat color="transparent" class="my-5">
<v-toolbar> <v-toolbar>
<v-toolbar-title>Defense Systems</v-toolbar-title> <v-toolbar-title>Defense Systems</v-toolbar-title>
<v-text-field v-model="search" density="compact" variant="underlined" append-inner-icon="mdi-magnify" <v-text-field v-model="search" density="compact" variant="underlined" prepend-inner-icon="mdi-magnify"
label="Search" single-line hide-details class="mx-2"></v-text-field> label="Search for defense systems" single-line hide-details class="mx-2" clearable></v-text-field>
</v-toolbar> </v-toolbar>
<v-data-table :items-per-page="itemsPerParge" v-model:sort-by="sortBy" :headers="headers" :items="props.systems" <v-data-table :items-per-page="itemsPerParge" v-model:sort-by="sortBy" :headers="props.headers"
:search="search"> :custom-filter="filterOnlyCapsText" :items="props.systems" :search="search">
<template #[`item.system`]="{ item }"> <template #[`item.system`]="{ item }">
<v-chip variant="text" link :to="`/defense-systems/${item.columns.system.toLowerCase()}`">{{ <v-chip variant="text" link :to="`${item.columns.system.path}`">{{
item.columns.system }}</v-chip> item.columns.system.name }}</v-chip>
</template> </template>
<template #[`item.dois`]="{ item }"> <template #[`item.doi`]="{ item }">
<ArticleDoiList :items="item.columns.dois" :divider="false" /> <ArticleDoiList v-if="item.columns?.doi" :items="[item.columns.doi]" :divider="false" />
</template> </template>
</v-data-table> </v-data-table>
</v-card> </v-card>
......
--- ---
title: Abi2 title: Abi2
tableColumns:
doi: 10.1016/j.mib.2005.06.006
--- ---
The Abi2 system is composed of one protein: Abi_2. The Abi2 system is composed of one protein: Abi_2.
......
--- ---
title: AbiA title: AbiA
tableColumns:
doi: 10.1016/j.mib.2005.06.006
--- ---
The AbiA system have been describe in a total of 2 subsystems. The AbiA system have been describe in a total of 2 subsystems.
......
--- ---
title: AbiB title: AbiB
tableColumns:
doi: 10.1016/j.mib.2005.06.006
--- ---
The AbiB system is composed of one protein: AbiB. The AbiB system is composed of one protein: AbiB.
......
--- ---
title: AbiC title: AbiC
tableColumns:
doi: 10.1016/j.mib.2005.06.006
--- ---
The AbiC system is composed of one protein: AbiC. The AbiC system is composed of one protein: AbiC.
......
--- ---
title: AbiD title: AbiD
tableColumns:
doi: 10.1016/j.mib.2005.06.006
--- ---
The AbiD system is composed of one protein: AbiD. The AbiD system is composed of one protein: AbiD.
......
--- ---
title: AbiE title: AbiE
tableColumns:
doi: 10.1016/j.mib.2005.06.006
--- ---
AbiE is a family of an anti-phage defense systems. They act through a Toxin-Antitoxin mechanism, and are comprised of a pair of genes, with one gene being toxic while the other confers immunity to this toxicity. AbiE is a family of an anti-phage defense systems. They act through a Toxin-Antitoxin mechanism, and are comprised of a pair of genes, with one gene being toxic while the other confers immunity to this toxicity.
......
--- ---
title: AbiG title: AbiG
tableColumns:
doi: 10.1016/j.mib.2005.06.006
--- ---
The AbiG system is composed of 2 proteins: AbiGi and, AbiGii. The AbiG system is composed of 2 proteins: AbiGi and, AbiGii.
......
--- ---
title: AbiH title: AbiH
tableColumns:
doi: 10.1111/j.1574-6968.1996.tb08446.x
--- ---
## Example of genomic structure ## Example of genomic structure
......
--- ---
title: AbiV title: AbiV
tableColumns:
doi: 10.1128/AEM.00780-08
--- ---
## Example of genomic structure ## Example of genomic structure
......
--- ---
title: Rst_PARIS title: Rst_PARIS
tableColumns:
doi: https://doi.org/10.1101/2021.01.21.427644
--- ---
## Description ## Description
......
...@@ -14,8 +14,8 @@ export default defineNuxtConfig({ ...@@ -14,8 +14,8 @@ export default defineNuxtConfig({
devtools: { devtools: {
enabled: false enabled: false
}, },
app: { // app: {
baseURL: '/wiki', // baseURL: '/wiki',
} // }
}) })
<script setup lang="ts">
const { data, error, pending } = await useAsyncData(
'list-defense-systems',
() => queryContent('/defense-systems').find()
)
const defaultHeaders = ref([{ title: 'System', key: "system" }])
const tableKey = "tableColumns"
const sanitizedData = computed(() => {
if (data?.value && data.value?.length > 0) {
return data.value?.filter(entry => {
if (entry._dir === "old" || entry._dir === "") {
return false
}
return true
})
} else {
return []
}
})
const headers = computed(() => {
const uniqHeaders = Array.from(sanitizedData.value.reduce((headerSet, df) => {
if (df?.[tableKey]) {
return new Set([...headerSet, ...Object.keys(df[tableKey])])
}
else { return headerSet }
}, new Set()))
return [...defaultHeaders.value, ...uniqHeaders.map(value => { return { title: value, key: value } })]
})
const systems = computed(() => {
return sanitizedData.value.map((content) => {
return {
system: { name: content.title, path: content._path },
...content[tableKey]
}
})
})
</script>
<template>
<v-card>
<v-card-title>List systems</v-card-title>
<v-card-text>
<ListSystems :headers=headers :systems="systems"></ListSystems>
</v-card-text>
</v-card>
</template>
\ No newline at end of file
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