molstar
Version:
A comprehensive macromolecular library.
31 lines • 1.24 kB
JavaScript
/**
* Copyright (c) 2019-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { __awaiter, __generator } from "tslib";
import { Task } from '../../../mol-task';
import { ReaderResult } from '../result';
import { Tokenizer } from '../common/text/tokenizer';
export function parsePDB(data, id, isPdbqt) {
var _this = this;
if (isPdbqt === void 0) { isPdbqt = false; }
return Task.create('Parse PDB', function (ctx) { return __awaiter(_this, void 0, void 0, function () {
var _a, _b;
var _c;
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
_b = (_a = ReaderResult).success;
_c = {};
return [4 /*yield*/, Tokenizer.readAllLinesAsync(data, ctx)];
case 1: return [2 /*return*/, _b.apply(_a, [(_c.lines = _d.sent(),
_c.id = id,
_c.isPdbqt = isPdbqt,
_c)])];
}
});
}); });
}
//# sourceMappingURL=parser.js.map