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

ModelPropertyDescriptor.cifExport is now optional

parent d293eadc
No related branches found
No related tags found
No related merge requests found
......@@ -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>[] = [
......
......@@ -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) {
......
......@@ -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>[]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment