diff --git a/components/content/StructureDb.vue b/components/content/StructureDb.vue index bf0ba15a59dc00c1b2754470356d807727b5acd1..4ec3d385a56b5e24395748036eacc6ffa8fd609c 100644 --- a/components/content/StructureDb.vue +++ b/components/content/StructureDb.vue @@ -3,18 +3,17 @@ import type { SortItem } from "@/components/ServerDbTable.vue" import { ServerDbTable } from "#components" const sortBy: Ref<SortItem[]> = ref([{ key: 'system', order: "asc" }]) const itemValue = ref("id"); -const facets: Ref<string[]> = ref(["system", "completed", - "plddts",]) +const facets: Ref<string[]> = ref(["system", "completed"]) const headers: Ref<Object[]> = ref([ { title: "System", key: "system" }, - { title: "pdb file", key: "pdb" }, - { title: "fasta", key: "fasta_file" }, + // { title: "pdb file", key: "pdb" }, + // { title: "fasta", key: "fasta_file" }, { title: "Proteins in structure", key: 'proteins_in_the_prediction', sortable: false }, { title: "System genes", key: "system_genes", sortable: false }, { title: "Sys id", key: "nb_sys" }, { title: "Completed", key: "completed" }, - { title: "Predition type", key: "prediction_type" }, + { title: "Prediction type", key: "prediction_type" }, { title: "Num of genes", key: "system_number_of_genes" }, { title: "pLDDT", key: "plddts" }, { title: "iptm+ptm", key: "iptm+ptm" }, @@ -34,8 +33,12 @@ const dataTableServerProps = computed(() => { } }) -function namesToCollapsibleChips(names: string[]) { - return names.filter((it) => it !== "").map(it => ({ title: it.split("__").pop() })) +function namesToCollapsibleChips(names: string[], file: string | null = null) { + if (file === null) { + return names.filter((it) => it !== "").map(it => ({ title: it.split("__").pop() })) + } else { + return names.filter((it) => it !== "").map(it => ({ title: it.split("__").pop(), href: `/wiki/${toSystemName(file)}/${file}` })) + } } function pdbNameToCif(pdbPath: string) { @@ -53,7 +56,8 @@ function toSystemName(rawName: string) { <ServerDbTable title="Predicted Structures" db="structure" :sortBy="sortBy" :facets="facets" :data-table-server-props="dataTableServerProps"> <template #[`item.proteins_in_the_prediction`]="{ item }"> - <CollapsibleChips :items="namesToCollapsibleChips(item.proteins_in_the_prediction)"></CollapsibleChips> + <CollapsibleChips :items="namesToCollapsibleChips(item.proteins_in_the_prediction, item.fasta_file)"> + </CollapsibleChips> </template> <template #[`item.system_genes`]="{ item }"> <CollapsibleChips :items="namesToCollapsibleChips(item.system_genes)"></CollapsibleChips>