diff --git a/src/mol-model-props/pdbe/themes/structure-quality-report.ts b/src/mol-model-props/pdbe/themes/structure-quality-report.ts index a527e58f7797addf3ad4b2a3de9109c5179f330b..928298bd293b60de2d5673ae174134a9dca1d75a 100644 --- a/src/mol-model-props/pdbe/themes/structure-quality-report.ts +++ b/src/mol-model-props/pdbe/themes/structure-quality-report.ts @@ -31,7 +31,7 @@ const ValidationColorTable: [string, Color][] = [ export function StructureQualityReportColorTheme(ctx: ThemeDataContext, props: {}): ColorTheme<{}> { let color: LocationColor - if (ctx.structure && ctx.structure.models[0].customProperties.has(StructureQualityReport.Descriptor)) { + if (ctx.structure && !ctx.structure.isEmpty && ctx.structure.models[0].customProperties.has(StructureQualityReport.Descriptor)) { const getIssues = StructureQualityReport.getIssues; color = (location: Location) => { if (StructureElement.isLocation(location)) { diff --git a/src/mol-model-props/rcsb/themes/assembly-symmetry-cluster.ts b/src/mol-model-props/rcsb/themes/assembly-symmetry-cluster.ts index efe1bb6fba7c3b5ab1453c7080ec3cb4c2f036b7..434187445d789c4f3419c363e4e936b849a2b2b1 100644 --- a/src/mol-model-props/rcsb/themes/assembly-symmetry-cluster.ts +++ b/src/mol-model-props/rcsb/themes/assembly-symmetry-cluster.ts @@ -47,7 +47,7 @@ export function AssemblySymmetryClusterColorTheme(ctx: ThemeDataContext, props: const { symmetryId } = props - if (ctx.structure && ctx.structure.models[0].customProperties.has(AssemblySymmetry.Descriptor)) { + if (ctx.structure && !ctx.structure.isEmpty && ctx.structure.models[0].customProperties.has(AssemblySymmetry.Descriptor)) { const assemblySymmetry = AssemblySymmetry.get(ctx.structure.models[0])! const s = assemblySymmetry.db.rcsb_assembly_symmetry @@ -99,5 +99,5 @@ export const AssemblySymmetryClusterColorThemeProvider: ColorTheme.Provider<Asse factory: AssemblySymmetryClusterColorTheme, getParams: getAssemblySymmetryClusterColorThemeParams, defaultValues: PD.getDefaultValues(AssemblySymmetryClusterColorThemeParams), - isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && ctx.structure.models[0].customProperties.has(AssemblySymmetry.Descriptor) + isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && !ctx.structure.isEmpty && ctx.structure.models[0].customProperties.has(AssemblySymmetry.Descriptor) } \ No newline at end of file diff --git a/src/mol-model/structure/structure/structure.ts b/src/mol-model/structure/structure/structure.ts index d7b99e9ff018db30162d37aae9a615c2892c2e20..b1c520601104772ffeba27c674deae65e2325d88 100644 --- a/src/mol-model/structure/structure/structure.ts +++ b/src/mol-model/structure/structure/structure.ts @@ -72,6 +72,10 @@ class Structure { return prc && ec ? ec / prc < 2 : false } + get isEmpty() { + return this.units.length === 0; + } + get hashCode() { if (this._props.hashCode !== -1) return this._props.hashCode; return this.computeHash(); diff --git a/src/mol-plugin/behavior/dynamic/custom-props/pdbe/structure-quality-report.ts b/src/mol-plugin/behavior/dynamic/custom-props/pdbe/structure-quality-report.ts index 61a09e969723d1c0d28ece8064cee69b88f11b95..6c09982015da5a9d71bba13f2351d6dd8d40df83 100644 --- a/src/mol-plugin/behavior/dynamic/custom-props/pdbe/structure-quality-report.ts +++ b/src/mol-plugin/behavior/dynamic/custom-props/pdbe/structure-quality-report.ts @@ -40,7 +40,7 @@ export const PDBeStructureQualityReport = PluginBehavior.create<{ autoAttach: bo factory: StructureQualityReportColorTheme, getParams: () => ({}), defaultValues: {}, - isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && ctx.structure.models[0].customProperties.has(StructureQualityReport.Descriptor) + isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && !ctx.structure.isEmpty && ctx.structure.models[0].customProperties.has(StructureQualityReport.Descriptor) }) }