diff --git a/src/mol-model-props/pdbe/structure-quality-report.ts b/src/mol-model-props/pdbe/structure-quality-report.ts index 4d88557fd23cb292e79f195970a520296cb950e8..4a02a66b2be5a64fdfa5eb68afd7da115a2687aa 100644 --- a/src/mol-model-props/pdbe/structure-quality-report.ts +++ b/src/mol-model-props/pdbe/structure-quality-report.ts @@ -20,7 +20,7 @@ import Type from 'mol-script/language/type'; type IssueMap = ResidueCustomProperty<string[]> -const _Descriptor: ModelPropertyDescriptor = { +const _Descriptor = ModelPropertyDescriptor({ isStatic: true, name: 'structure_quality_report', cifExport: { @@ -41,9 +41,10 @@ const _Descriptor: ModelPropertyDescriptor = { }, symbols: { issueCount: QuerySymbolRuntime.Dynamic(CustomPropSymbol('pdbe', 'structure-quality.issue-count', Type.Num), - ctx => StructureQualityReport.getIssues(ctx.element).length) + ctx => StructureQualityReport.getIssues(ctx.element).length), + // TODO: add (hasIssue :: IssueType(extends string) -> boolean) symbol } -} +}) type ExportCtx = ResidueCustomProperty.ExportCtx<string[]> const _structure_quality_report_issues_fields: CifField<number, ExportCtx>[] = [ diff --git a/src/mol-model/structure/export/mmcif.ts b/src/mol-model/structure/export/mmcif.ts index a527b835bbe46fba9a167eeabda3531fa145ea42..428bcbee3c8103ccb0c57b8736675ec2e8bcc3cc 100644 --- a/src/mol-model/structure/export/mmcif.ts +++ b/src/mol-model/structure/export/mmcif.ts @@ -98,6 +98,8 @@ export function encode_mmCIF_categories(encoder: CifWriter.Encoder, structure: S encoder.writeCategory(cat, ctx); } for (const customProp of model.customProperties.all) { + if (!customProp.cifExport || customProp.cifExport.categories.length === 0) continue; + const prefix = customProp.cifExport.prefix; const cats = customProp.cifExport.categories; for (const cat of cats) { diff --git a/src/mol-model/structure/model/properties/custom/descriptor.ts b/src/mol-model/structure/model/properties/custom/descriptor.ts index d83a32cca4e9278304637a41f7ab9f3247ffc004..061f376bcf25f2a6add6603f2a80186180a5a902 100644 --- a/src/mol-model/structure/model/properties/custom/descriptor.ts +++ b/src/mol-model/structure/model/properties/custom/descriptor.ts @@ -12,7 +12,7 @@ interface ModelPropertyDescriptor<Symbols extends { [name: string]: QuerySymbolR readonly isStatic: boolean, readonly name: string, - cifExport: { + cifExport?: { // Prefix enforced during export. prefix: string, categories: CifWriter.Category<CifExportContext>[]