UNPKG

@rcsb/rcsb-saguaro-app

Version:
27 lines (26 loc) 1.34 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MultipleInstanceSequencesCollector = void 0; const tslib_1 = require("tslib"); const RcsbClient_1 = require("../../RcsbGraphQL/RcsbClient"); const Assertions_1 = require("../../RcsbUtils/Helpers/Assertions"); var assertDefined = Assertions_1.Assertions.assertDefined; class MultipleInstanceSequencesCollector { constructor() { this.rcsbFvQuery = RcsbClient_1.rcsbClient; } collect(requestConfig) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const result = yield this.rcsbFvQuery.requestMultipleInstanceSequences(requestConfig); return result.map(r => { var _a, _b, _c, _d; assertDefined(r.rcsb_id), assertDefined((_b = (_a = r.polymer_entity) === null || _a === void 0 ? void 0 : _a.entity_poly) === null || _b === void 0 ? void 0 : _b.pdbx_seq_one_letter_code_can); return { rcsbId: r.rcsb_id, sequence: (_d = (_c = r.polymer_entity) === null || _c === void 0 ? void 0 : _c.entity_poly) === null || _d === void 0 ? void 0 : _d.pdbx_seq_one_letter_code_can }; }); }); } } exports.MultipleInstanceSequencesCollector = MultipleInstanceSequencesCollector;