From a05c7aecc53e1bddf6c560d17ff4733377725289 Mon Sep 17 00:00:00 2001
From: jeanrjc <jean.cury@normalesup.org>
Date: Wed, 20 Dec 2023 16:32:39 +0100
Subject: [PATCH] fix way to guess system's name

---
 components/content/StructureDb.vue | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/components/content/StructureDb.vue b/components/content/StructureDb.vue
index 34e66936..dc515c0f 100644
--- a/components/content/StructureDb.vue
+++ b/components/content/StructureDb.vue
@@ -56,14 +56,8 @@ function pdbNameToCif(pdbPath: string) {
 
 
 function toSystemName(rawName: string) {
-    // split on -0 if exists else on _
-    if (rawName.includes("-0")) {
-
-        return rawName.split("-0")[0].toLocaleLowerCase()
-    } else {
-        return rawName.split("_")[0].toLocaleLowerCase()
-    }
-    
+    // split on __ in system_genes
+    return rawName.split("__")[0].toLocaleLowerCase()   
 
 }
 
@@ -100,7 +94,7 @@ function remove(key) {
         </template>
         <template #[`item.structure`]="{ item }">
             <MolstarPdbePlugin v-if="item?.pdb && item.pdb !== 'na'"
-                :data-urls="[`/${toSystemName(item.system)}/${pdbNameToCif(item.pdb)}`]" uniq>
+                :data-urls="[`/${toSystemName(item.system_genes)}/${pdbNameToCif(item.pdb)}`]" uniq>
             </MolstarPdbePlugin>
             <span v-else class="d-flex flex-wrap align-center justify-center">
                 <v-icon color="warning" icon="md:dangerous"></v-icon>
-- 
GitLab