Skip to content
Snippets Groups Projects
Commit 72b95a7d authored by David Sehnal's avatar David Sehnal
Browse files

Fix structure validation custom prop

parent 5a82e46b
No related branches found
No related tags found
No related merge requests found
......@@ -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[] = [];
......
......@@ -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)
};
}
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment