molstar
Version:
A comprehensive macromolecular library.
33 lines • 1.3 kB
JavaScript
/**
* Copyright (c) 2019-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
* @author David Sehnal <david.sehnal@gmail.com>
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.guessCifVariant = exports.DataFormatProvider = void 0;
var decode_1 = require("../../mol-io/common/msgpack/decode");
function DataFormatProvider(provider) { return provider; }
exports.DataFormatProvider = DataFormatProvider;
function guessCifVariant(info, data) {
if (info.ext === 'bcif') {
try {
// TODO: find a way to run msgpackDecode only once
// now it is run twice, here and during file parsing
if ((0, decode_1.decodeMsgPack)(data).encoder.startsWith('VolumeServer'))
return 'dscif';
}
catch (_a) { }
}
else if (info.ext === 'cif') {
var str = data;
if (str.startsWith('data_SERVER\n#\n_density_server_result'))
return 'dscif';
if (str.includes('atom_site_fract_x') || str.includes('atom_site.fract_x'))
return 'coreCif';
}
return -1;
}
exports.guessCifVariant = guessCifVariant;
//# sourceMappingURL=provider.js.map
;