From 5526e2866fead9b7e7c2b0c80055d7b43595af13 Mon Sep 17 00:00:00 2001 From: Matthias Blum Date: Thu, 13 Feb 2025 00:59:17 +0000 Subject: [PATCH] use alternative mappings to highlight domains on structures --- .../Structure/ViewerAndEntries/index.tsx | 24 ++++++++++++------- src/types/interpro-payloads.d.ts | 2 ++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/components/Structure/ViewerAndEntries/index.tsx b/src/components/Structure/ViewerAndEntries/index.tsx index 9c1d23989..a3c6eefba 100644 --- a/src/components/Structure/ViewerAndEntries/index.tsx +++ b/src/components/Structure/ViewerAndEntries/index.tsx @@ -50,8 +50,10 @@ type MinimalStructureFeature = MinimalFeature & { }; type EntryHit = { struct_asym_id: string; - start_residue_number: number; - end_residue_number: number; + start: number; + end: number; + auth_start?: number; + auth_end?: number; accession: string; source_database: string; color?: string; @@ -222,11 +224,13 @@ class StructureView extends PureComponent { _getChainMap(chain: string, locations: ProtVistaLocation[]) { const chainMap = []; for (const location of locations) { - for (const { start, end } of location.fragments) { + for (const { start, end, auth_start, auth_end } of location.fragments) { chainMap.push({ struct_asym_id: chain, - start_residue_number: start, - end_residue_number: end, + start: start, + end: end, + auth_start: auth_start, + auth_end: auth_end, accession: chain, source_database: 'pdb', }); @@ -255,8 +259,10 @@ class StructureView extends PureComponent { for (const fragment of location.fragments) { map[chain].push({ struct_asym_id: chain, - start_residue_number: Math.round(fragment.start), - end_residue_number: Math.round(fragment.end), + start: fragment.start, + end: fragment.end, + auth_start: fragment.auth_start, + auth_end: fragment.auth_end, accession: entry, source_database: db, parent: match.metadata.integrated @@ -365,8 +371,8 @@ class StructureView extends PureComponent { const hexColour = parseInt(hit.color?.substring(1) || '', 16); selections.push({ color: hexColour, - start: hit.start_residue_number, - end: hit.end_residue_number, + start: hit.auth_start || hit.start, + end: hit.auth_end || hit.end, chain: hit.struct_asym_id, }); }); diff --git a/src/types/interpro-payloads.d.ts b/src/types/interpro-payloads.d.ts index bf25608a1..a3d8835ce 100644 --- a/src/types/interpro-payloads.d.ts +++ b/src/types/interpro-payloads.d.ts @@ -272,6 +272,8 @@ type ProtVistaFragment = { fill?: string; protein_start?: number; protein_end?: number; + auth_start?: number; + auth_end?: number; }; type ProtVistaLocation = {