Skip to content

Commit

Permalink
use alternative mappings to highlight domains on structures
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasblum committed Feb 13, 2025
1 parent bc72d65 commit 5526e28
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/components/Structure/ViewerAndEntries/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -222,11 +224,13 @@ class StructureView extends PureComponent<Props, State> {
_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',
});
Expand Down Expand Up @@ -255,8 +259,10 @@ class StructureView extends PureComponent<Props, State> {
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
Expand Down Expand Up @@ -365,8 +371,8 @@ class StructureView extends PureComponent<Props, State> {
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,
});
});
Expand Down
2 changes: 2 additions & 0 deletions src/types/interpro-payloads.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ type ProtVistaFragment = {
fill?: string;
protein_start?: number;
protein_end?: number;
auth_start?: number;
auth_end?: number;
};

type ProtVistaLocation = {
Expand Down

0 comments on commit 5526e28

Please sign in to comment.