diff --git a/src/mol-model-props/pdbe/structure-quality-report.ts b/src/mol-model-props/pdbe/structure-quality-report.ts index 8eed13c6f251255351d7570612a7233f88ccad6f..a517f8ee347ec07d7cc5623306401c40b3170c7e 100644 --- a/src/mol-model-props/pdbe/structure-quality-report.ts +++ b/src/mol-model-props/pdbe/structure-quality-report.ts @@ -21,7 +21,7 @@ import Type from 'mol-script/language/type'; type IssueMap = ResidueCustomProperty<string[]> const _Descriptor = ModelPropertyDescriptor({ - isStatic: true, + isStatic: false, name: 'structure_quality_report', cifExport: { prefix: 'pdbe', @@ -114,7 +114,7 @@ export namespace StructureQualityReport { // provide JSON from api PDBe_apiSourceJson?: (model: Model) => Promise<any> }) { - if (model.customProperties.has(Descriptor)) return true; + if (get(model)) return true; let issueMap; @@ -132,12 +132,12 @@ export namespace StructureQualityReport { } model.customProperties.add(Descriptor); - model._staticPropertyData.__StructureQualityReport__ = issueMap; + model._dynamicPropertyData.__StructureQualityReport__ = issueMap; return true; } export function get(model: Model): IssueMap | undefined { - return model._staticPropertyData.__StructureQualityReport__; + return model._dynamicPropertyData.__StructureQualityReport__; } const _emptyArray: string[] = []; diff --git a/src/mol-model/structure/model/formats/mmcif.ts b/src/mol-model/structure/model/formats/mmcif.ts index b03ed96635abfcc1376fe4f17cd37b4dc453471e..309e194706886b36b013ef5e6cb434277e3f925a 100644 --- a/src/mol-model/structure/model/formats/mmcif.ts +++ b/src/mol-model/structure/model/formats/mmcif.ts @@ -146,7 +146,8 @@ function createStandardModel(format: mmCIF_Format, atom_site: AtomSite, entities ...previous, id: UUID.create(), modelNum: atom_site.pdbx_PDB_model_num.value(0), - atomicConformation: atomic.conformation + atomicConformation: atomic.conformation, + _dynamicPropertyData: Object.create(null) }; } diff --git a/src/servers/model/properties/providers/pdbe.ts b/src/servers/model/properties/providers/pdbe.ts index 14a2119aa7321ceaa21b4a26b096ccdfb63c821e..2f2403a2013a926d4327bcc374121058a1bbcd5b 100644 --- a/src/servers/model/properties/providers/pdbe.ts +++ b/src/servers/model/properties/providers/pdbe.ts @@ -13,10 +13,7 @@ const cacheKey = UUID.create(); export function PDBe_structureQualityReport(model: Model, cache: any) { return StructureQualityReport.attachFromCifOrApi(model, { PDBe_apiSourceJson: async model => { - if (cache[cacheKey]) { - console.log('cache hit'); - return cache[cacheKey]; - } + if (cache[cacheKey]) return cache[cacheKey]; const rawData = await fetchRetry(`https://www.ebi.ac.uk/pdbe/api/validation/residuewise_outlier_summary/entry/${model.label.toLowerCase()}`, 1500, 5); const json = await rawData.json(); cache[cacheKey] = json;