Motivation: The CRAM format addresses rising DNA storage costs for short-read sequencing by aligning reads to a reference genome and encoding the resulting alignment with Huffman, subexponential, Elias gamma, rANS, gzip and other codes. The CRAM codec is complex, and until now, there has been no JavaScript implementation.
Results: We have developed a JavaScript library, Cram-JS, that natively reads and decompresses the CRAM format on-the-fly. The library is used in the JBrowse and IGV-JS genome browsers and can readily be used by other JavaScript applications, in the web browser or in Node.
Availability and implementation: Cram-JS is written to the ES-6 standard and is available from the GitHub repository at https://github.com/GMOD/cram-js.
© The Author(s) 2019. Published by Oxford University Press. All rights reserved. For permissions, please e-mail: [email protected].