diff --git a/src/mol-model-props/rcsb/themes/density-fit.ts b/src/mol-model-props/rcsb/themes/density-fit.ts index 5fd64ca179c78d66479ae29f6e19fba10a5672c5..ba4fd46e8f08b91c8a8dfcc7af84f7893541907b 100644 --- a/src/mol-model-props/rcsb/themes/density-fit.ts +++ b/src/mol-model-props/rcsb/themes/density-fit.ts @@ -8,7 +8,7 @@ import { ThemeDataContext } from '../../../mol-theme/theme'; import { ColorTheme, LocationColor } from '../../../mol-theme/color'; import { ParamDefinition as PD } from '../../../mol-util/param-definition' import { Color, ColorScale } from '../../../mol-util/color'; -import { StructureElement } from '../../../mol-model/structure'; +import { StructureElement, Model } from '../../../mol-model/structure'; import { Location } from '../../../mol-model/location'; import { CustomProperty } from '../../common/custom-property'; import { ValidationReportProvider, ValidationReport } from '../validation-report'; @@ -67,7 +67,7 @@ export const DensityFitColorThemeProvider: ColorTheme.Provider<{}, ValidationRep factory: DensityFitColorTheme, getParams: () => ({}), defaultValues: PD.getDefaultValues({}), - isApplicable: (ctx: ThemeDataContext) => ValidationReport.isApplicable(ctx.structure?.models[0]), + isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && ValidationReport.isApplicable(ctx.structure.models[0]) && Model.hasXrayMap(ctx.structure.models[0]), ensureCustomProperties: { attach: (ctx: CustomProperty.Context, data: ThemeDataContext) => data.structure ? ValidationReportProvider.attach(ctx, data.structure.models[0], void 0, true) : Promise.resolve(), detach: (data) => data.structure && data.structure.models[0].customProperties.reference(ValidationReportProvider.descriptor, false) diff --git a/src/mol-model-props/rcsb/themes/random-coil-index.ts b/src/mol-model-props/rcsb/themes/random-coil-index.ts index 9791f7a6861d316f618323ddcce558cc7c6525d5..95b8fa31aa454f5c50f5fa72692c8fd73098ff6a 100644 --- a/src/mol-model-props/rcsb/themes/random-coil-index.ts +++ b/src/mol-model-props/rcsb/themes/random-coil-index.ts @@ -8,7 +8,7 @@ import { ThemeDataContext } from '../../../mol-theme/theme'; import { ColorTheme, LocationColor } from '../../../mol-theme/color'; import { ParamDefinition as PD } from '../../../mol-util/param-definition' import { Color, ColorScale } from '../../../mol-util/color'; -import { StructureElement } from '../../../mol-model/structure'; +import { StructureElement, Model } from '../../../mol-model/structure'; import { Location } from '../../../mol-model/location'; import { CustomProperty } from '../../common/custom-property'; import { ValidationReportProvider, ValidationReport } from '../validation-report'; @@ -58,7 +58,7 @@ export const RandomCoilIndexColorThemeProvider: ColorTheme.Provider<{}, Validati factory: RandomCoilIndexColorTheme, getParams: () => ({}), defaultValues: PD.getDefaultValues({}), - isApplicable: (ctx: ThemeDataContext) => ValidationReport.isApplicable(ctx.structure?.models[0]), + isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && ValidationReport.isApplicable(ctx.structure.models[0]) && Model.isFromNmr(ctx.structure.models[0]), ensureCustomProperties: { attach: (ctx: CustomProperty.Context, data: ThemeDataContext) => data.structure ? ValidationReportProvider.attach(ctx, data.structure.models[0], void 0, true) : Promise.resolve(), detach: (data) => data.structure && data.structure.models[0].customProperties.reference(ValidationReportProvider.descriptor, false)