UNPKG

molstar

Version:

A comprehensive macromolecular library.

47 lines 2.5 kB
"use strict"; /** * Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> */ Object.defineProperty(exports, "__esModule", { value: true }); exports.CrossLinkRestraint = void 0; var tslib_1 = require("tslib"); var behavior_1 = require("../../../behavior"); var format_1 = require("../../../../../mol-model-props/integrative/cross-link-restraint/format"); var mmcif_1 = require("../../../../../mol-model-formats/structure/mmcif"); var representation_1 = require("../../../../../mol-model-props/integrative/cross-link-restraint/representation"); var color_1 = require("../../../../../mol-model-props/integrative/cross-link-restraint/color"); exports.CrossLinkRestraint = behavior_1.PluginBehavior.create({ name: 'integrative-cross-link-restraint', category: 'custom-props', display: { name: 'Cross Link Restraint' }, ctor: /** @class */ (function (_super) { (0, tslib_1.__extends)(class_1, _super); function class_1() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.provider = format_1.ModelCrossLinkRestraint.Provider; return _this; } class_1.prototype.register = function () { this.provider.formatRegistry.add('mmCIF', crossLinkRestraintFromMmcif); this.ctx.representation.structure.themes.colorThemeRegistry.add(color_1.CrossLinkColorThemeProvider); this.ctx.representation.structure.registry.add(representation_1.CrossLinkRestraintRepresentationProvider); }; class_1.prototype.unregister = function () { this.provider.formatRegistry.remove('mmCIF'); this.ctx.representation.structure.themes.colorThemeRegistry.remove(color_1.CrossLinkColorThemeProvider); this.ctx.representation.structure.registry.remove(representation_1.CrossLinkRestraintRepresentationProvider); }; return class_1; }(behavior_1.PluginBehavior.Handler)) }); function crossLinkRestraintFromMmcif(model) { if (!mmcif_1.MmcifFormat.is(model.sourceData)) return; var ihm_cross_link_restraint = model.sourceData.data.db.ihm_cross_link_restraint; if (ihm_cross_link_restraint._rowCount === 0) return; return format_1.ModelCrossLinkRestraint.fromTable(ihm_cross_link_restraint, model); } //# sourceMappingURL=cross-link-restraint.js.map