UNPKG

@rcsb/rcsb-saguaro-3d

Version:
38 lines (37 loc) 1.62 kB
"use strict"; /* * Copyright (c) 2021 RCSB PDB and contributors, licensed under MIT, See LICENSE file for more info. * @author Joan Segura Mora <joan.segura@rcsb.org> */ Object.defineProperty(exports, "__esModule", { value: true }); exports.MolstarAssemblyLoader = void 0; const tslib_1 = require("tslib"); const MolstarActionManager_1 = require("../MolstarActionManager"); const AssemblyTrajectoryPresetProvider_1 = require("../TrajectoryPresetProvider/AssemblyTrajectoryPresetProvider"); const app_1 = require("@rcsb/rcsb-saguaro-app/lib/app"); class MolstarAssemblyLoader { constructor(config) { this.entryId = config.entryId; this.assemblyId = config.assemblyId; this.asymId = config.asymId; } load(structureViewer) { return tslib_1.__awaiter(this, void 0, void 0, function* () { var _a; return yield structureViewer.load({ loadMethod: MolstarActionManager_1.LoadMethod.loadPdbId, loadParams: { reprProvider: AssemblyTrajectoryPresetProvider_1.AssemblyTrajectoryPresetProvider, entryId: this.entryId, id: this.entryId, params: { assemblyId: this.assemblyId, modelIndex: ((yield app_1.RcsbRequestContextManager.getEntryProperties(this.entryId))[0].representativeModel - 1), asymId: (_a = this.asymId) !== null && _a !== void 0 ? _a : 'A' } } }); }); } } exports.MolstarAssemblyLoader = MolstarAssemblyLoader;