diff --git a/components/content/SystemOperonStructure.vue b/components/content/SystemOperonStructure.vue index b99c5149fbb85f24ccf2855dc4ad663fb2b61f8f..379be4257163990cda7dd8d315aae092cbc8f53b 100644 --- a/components/content/SystemOperonStructure.vue +++ b/components/content/SystemOperonStructure.vue @@ -48,10 +48,15 @@ const sanitizedHits = computed<StructureOperonGeneWithImg[]>(() => { // get structure information for this prot const monomerStructuresVal = toValue(monomerStructures) const sanitizedGene = hit.gene.split("__")[1] + const sanitizedExangeableGenes = hit.exchangeables.map(g => g.split("__")[1]) + const genesAndSynonymous = new Set([sanitizedGene, ...sanitizedExangeableGenes]) if (monomerStructuresVal) { const struct = monomerStructuresVal.find((struct) => { - return struct.proteins_in_the_prediction[0] === sanitizedGene + return genesAndSynonymous.has(struct.proteins_in_the_prediction[0]) }) + if (struct === undefined) { + console.log(hit) + } const rawImgUrl = joinURL(`/${system.toLowerCase()}`, struct?.structImg ?? '') const rawStructUrl = joinURL(`/${system.toLowerCase()}`, struct?.structPath ?? '') const { refinedUrl: structImgHref } = useRefinedUrl(rawImgUrl) diff --git a/types/structure.ts b/types/structure.ts index 7e90fde5ee523e1295ddb46499e325fefdb3471a..e7d08dcb3f06061f63a1fb16e8e5aaf92fed3eef 100644 --- a/types/structure.ts +++ b/types/structure.ts @@ -4,6 +4,8 @@ export interface StructureOperonGene { subsystem: string version: string system: string + exchangeables: string[] + } export interface StructureOperonGeneWithImg extends StructureOperonGene {