UNPKG

@gmod/cram

Version:

read CRAM files with pure Javascript

16 lines 681 B
import CramCodec from "./_base.js"; import { getBits } from "./getBits.js"; import { CramUnimplementedError } from "../../errors.js"; export default class BetaCodec extends CramCodec { constructor(parameters, dataType) { super(parameters, dataType); if (this.dataType !== 'int') { throw new CramUnimplementedError(`${this.dataType} decoding not yet implemented by BETA codec`); } } decode(_slice, coreDataBlock, _blocksByContentId, cursors) { const fromBits = getBits(coreDataBlock.content, cursors.coreBlock, this.parameters.length); return fromBits - this.parameters.offset; } } //# sourceMappingURL=beta.js.map