From 6d76486b566a6d144f1ea31a3967baf93e650ed8 Mon Sep 17 00:00:00 2001 From: Daniel Rice Date: Mon, 13 Oct 2025 18:31:33 +0100 Subject: [PATCH 1/2] Change AlphaFoldPayload variable name and update type. --- .../src/nightingale-structure.ts | 48 ++++++++++++++----- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/packages/nightingale-structure/src/nightingale-structure.ts b/packages/nightingale-structure/src/nightingale-structure.ts index 29eaf47f..27aa9fd2 100644 --- a/packages/nightingale-structure/src/nightingale-structure.ts +++ b/packages/nightingale-structure/src/nightingale-structure.ts @@ -48,26 +48,50 @@ export type PDBData = Record< } >; -export type PredictionData = { +export type AlphaFoldPayload = Array<{ entryId: string; + modelEntityId?: string; + toolUsed?: string; + providerId?: string; + entityType?: string; + isUniProt?: boolean; + modelCreatedDate?: Date; + sequenceVersionDate?: Date; + globalMetricValue?: number; + fractionPlddtVeryLow?: number; + fractionPlddtLow?: number; + fractionPlddtConfident?: number; + fractionPlddtVeryHigh?: number; + latestVersion?: number; + allVersions?: number[]; + sequence?: string; + sequenceStart?: number; + sequenceEnd?: number; + sequenceChecksum?: string; + isUniProtReviewed?: boolean; gene?: string; uniprotAccession?: string; uniprotId?: string; uniprotDescription?: string; taxId?: number; organismScientificName?: string; - uniprotStart?: number; - uniprotEnd?: number; - uniprotSequence?: string; - modelCreatedDate?: string; - latestVersion?: number; - allVersions?: number[]; + isUniProtReferenceProteome?: boolean; bcifUrl?: string; cifUrl?: string; pdbUrl?: string; - distogramUrl?: string; + paeImageUrl?: string; + msaUrl?: string; + plddtDocUrl?: string; + paeDocUrl?: string; + uniprotSequence?: string; + uniprotStart?: number; + uniprotEnd?: number; + isReferenceProteome?: boolean; + isReviewed?: boolean; amAnnotationsUrl?: string; -}; + amAnnotationsHg19Url?: string; + amAnnotationsHg38Url?: string; +}>; const uniProtMappingUrl = "https://www.ebi.ac.uk/pdbe/api/mappings/uniprot/"; @@ -248,7 +272,7 @@ class NightingaleStructure extends withManager( } } - async loadAFEntry(id: string): Promise { + async loadAFEntry(id: string): Promise { this.#structureViewer?.plugin.clear(); this.showMessage("Loading", id); try { @@ -346,8 +370,8 @@ class NightingaleStructure extends withManager( ): void { // sequencePositions assumed to be in PDB coordinate space if ( - (!sequencePositions?.length || - sequencePositions.some((pos) => !Number.isInteger(pos.position))) + !sequencePositions?.length || + sequencePositions.some((pos) => !Number.isInteger(pos.position)) ) { return; } From 4ba7347b5eb679596318c9f0ba648c0f9226cb48 Mon Sep 17 00:00:00 2001 From: Daniel Rice Date: Tue, 14 Oct 2025 11:43:00 +0100 Subject: [PATCH 2/2] Remove obsolete properties from AlphaFold. --- .../nightingale-structure/src/nightingale-structure.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/nightingale-structure/src/nightingale-structure.ts b/packages/nightingale-structure/src/nightingale-structure.ts index 27aa9fd2..2e46c9da 100644 --- a/packages/nightingale-structure/src/nightingale-structure.ts +++ b/packages/nightingale-structure/src/nightingale-structure.ts @@ -49,8 +49,7 @@ export type PDBData = Record< >; export type AlphaFoldPayload = Array<{ - entryId: string; - modelEntityId?: string; + modelEntityId: string; toolUsed?: string; providerId?: string; entityType?: string; @@ -83,11 +82,6 @@ export type AlphaFoldPayload = Array<{ msaUrl?: string; plddtDocUrl?: string; paeDocUrl?: string; - uniprotSequence?: string; - uniprotStart?: number; - uniprotEnd?: number; - isReferenceProteome?: boolean; - isReviewed?: boolean; amAnnotationsUrl?: string; amAnnotationsHg19Url?: string; amAnnotationsHg38Url?: string; @@ -306,7 +300,7 @@ class NightingaleStructure extends withManager( if (this.isAF()) { const afPredictions = await this.loadAFEntry(this["protein-accession"]); const afInfo = afPredictions.find( - (prediction) => prediction.entryId === this["structure-id"] + (prediction) => prediction.modelEntityId === this["structure-id"] ); // Note: maybe use bcif instead of cif, but I have issues loading it atm if (afInfo?.cifUrl) {