A File Format for Cryo-TEM Data with Fast Compression

A File Format for Cryo-TEM Data with Fast Compression

Journal of Structural Biology 201 (2018) 252–257 Contents lists available at ScienceDirect Journal of Structural Biology journal homepage: www.elsevier.com/locate/yjsbi Technical Note MRCZ – A file format for cryo-TEM data with fast compression T ⁎ Robert A. McLeoda, , Ricardo Diogo Righettoa, Andy Stewartb, Henning Stahlberga a Center for Cellular Imaging and NanoAnalytics (C-CINA), University of Basel, Basel, Switzerland b Department of Physics, University of Limerick, Limerick, Ireland ARTICLE INFO ABSTRACT Keywords: The introduction of fast CMOS detectors is moving the field of transmission electron microscopy into the Lossless compression computer science field of big data. Automated data pipelines control the instrument and initial processing steps Data management which imposes more onerous data transfer and archiving requirements. Here we conduct a technical demon- − File archiving stration whereby storage and read/write times are improved 10× at a dose rate of 1 e /pix/frame for data from a Gatan K2 direct-detection device by combination of integer decimation and lossless compression. The example project is hosted at github.com/em-MRCZ and released under the BSD license. 1. Introduction floating point format. The most common initial step that results in decimal data is the application of a gain reference, where the bias of the The introduction of CMOS-based direct electron detectors for detector white values is removed. In-addition, conversion to floating- transmission electron microscopy greatly improved the duty cycle to point is often inevitable due to operations such as sub-pixel shifting in nearly 100% compared to traditional slow-scan CCD detectors. The drift correction (Li et al., 2013a,b; Grant and Grigorieff, 2015; McLeod high duty-cycle allows for nearly continuous read-out, such that dose et al., 2016; Zheng et al. 2017), or image filtration. If instead the mi- fractionation has become ubiquitous as a means to record many-frame crographs are stored as 8-bit integers, with the gain reference (and micrograph stacks in-place of traditional 2D images. The addition of a potentially other operations) stored in meta-data, then a 4× reduction time-dimension, plus the large pixel counts of CMOS detectors, greatly in storage and transfer requirements is realized. In this case, the gain increases both archival and data transfer requirements and associated reference and other bias corrections must be performed at the com- costs to a laboratory. Many laboratories have a 1 Gbit/s Ethernet con- puting center, rather than using the software provided by the direct nection from their microscope to their computing center, which implies electron detector vendor. Since vendor gain normalization techniques a data transfer rate of around 60–90 MB/s under typical conditions. If are often proprietary and secret, there is a need for open-source the microscope is run with automated data collection, such as SerialEM equivalent solutions (Afanasyev et al., 2015). (Mastronarde, 2005), then the so-called ‘movie’ may be 5–20 GB and Further improvements in data reduction can be realized by modern may be saved every few minutes, or even faster. In such a case, it may high-speed lossless compression codes. Lossless compression methods not be possible to transfer the data fast enough to keep up with col- operate on the basis of repeated patterns in the data. Nominally, purely- lection. Costs for storing data on spinning (hard disk) storage, for ex- random numbers are incompressible. However counting electron data is ample through the use of Google Cloud (Google Cloud Storage Pricing, Poisson distributed, such that its range of pixel histogram covers on accessed 2017), is typically US$100–200/TB/year. A cryo-TEM la- only a limited range of values. In such a regime substantial compression boratory producing 200 TB of data per year is potentially faced with an ratios may be achieved. Therefore due to the repetition of intensity annual data storage cost on the same order of magnitude as a post- values, integer-format data can be compressed much more efficiently doctoral fellow salary. than gain-normalized floating-point data. Generally when comparing One approach whereby considerable archival savings may be rea- compression algorithms one is interested in the compression rate (in lized is by decimation of the data from floating-point format to integer- units of megabytes/s) and the compression ratio (in percent). Modern format. Nominally, the analog-to-digital converted signal from the de- compression codecs such as Z-standard (github.com/facebook/zstd, tector is typically output as an integer. Due to data processing re- accessed 03/2017) or LZ4 (github.com/lz4/lz4, accessed 03/2017) are quirements, it is often necessary to convert the integer data to 32-bit designed for efficient multi-threaded operation on modern, parallel Abbreviations: Blosc, blocked, shuffle, compress library; CMOS, complementary metal-oxide semiconductor; float32, floating-point 32-bit computer data, ∼6 significant figures; FPGA, Field-Gate Programmable Arrays; GB, Gigabyte (230 bytes); Gb, Gigabit, network (109 bits); MB, Megabyte (220 bytes); uint8, unsigned 8-bit integer computer data, range 0255 ⁎ Corresponding author at: C-CINA, Biozentrum, University of Basel, Switzerland. E-mail address: [email protected] (R.A. McLeod). https://doi.org/10.1016/j.jsb.2017.11.012 Received 24 March 2017; Received in revised form 20 November 2017; Accepted 22 November 2017 Available online 23 November 2017 1047-8477/ © 2017 The Authors. Published by Elsevier Inc. This is an open access article under the CC BY license (http://creativecommons.org/licenses/BY/4.0/). R.A. McLeod et al. Journal of Structural Biology 201 (2018) 252–257 CPUs and can compress on the order of 1–2 GB/s/core, such that the fastest decompression, making it the best choice for archiving. On time for read/write/transfer plus compression operations is greatly the lowest compression level it maintains good compression rates. faster than when operating on uncompressed data. 3. Zlib is a very common library that has been accelerated by blosc. We demonstrate here combining decimation to 8-bit integer with Zlib provides a valuable baseline for comparison, although blosc lossless compression. We utilize an extension of the venerable MRC compression rate with zlib exceeds that of tools such as pigz. format (Cheng et al. 2015; CCP-EM), where meta-compression is im- plemented which implies the combination of lossless compression and 2.1. Blocked compression lossless filtering to improve compressibility as well as execution with efficient blocked and multi-threaded processing. We propose using Roughly around 2005, further increases in CPU clock-frequencies common serialization tools to embed metadata in the MRC2014 ex- were slowed due to heat generation limitations. Further performance tended header, and compare JSON (ECMA-404, 2013) and Message improvements where then realized by packing parallel arithmetic and Pack (msgpack.org, accessed 03/2017). logic cores per chip. Most common compression algorithms were de- signed before the era of parallel processing. 2. The MRCZ format Operations in image processing are often relatively simple and executed on the full-frame consisting of many million elements. With The MRC format was introduced by Crowther et al. (1996)asan the larger number of cores available on modern CPU, often program extension of the CCP4 format. It features a 1024-byte metadata header, execution rate is limited not by processing power but the amount of followed by binary image data with provisions for 3-dimensions. The memory bandwidth available to feed data to the cores. Typically supported data types are byte (int8), short (int16), or single-precision fetching data from random-access memory (RAM) is an order of mag- floating-point (float32). The simplicity of the MRC format, and its ease nitude slower than the cache found on the CPU die. Therefore if the of implementation, is a likely reason contributing to its popularity. data can be cut into blocks that fit into the lower-level caches large However, the MRC format suffers from some drawbacks. There is no speed improvements are often observed. Parallel algorithms can be one standard format for MRC, in-spite of many efforts to define one made to work efficiently in the case where a computational task can be (Cheng et al., 2015). Furthermore, it cannot compress the data, so it is cut into blocks, and each block can be dispatched to an individual core, inefficient from an archival and transmission/distributed computing and run through an algorithm to completion, as illustrated in Fig. 1a. perspective. Parallel algorithms should also avoid branching instructions (e.g. con- An alternative public domain archival format for electron micro- ditional if statements), as modern processors request instructions from scopy is HDF5. However, HDF5 is a “heavyweight” library consisting memory in-advance, and a wrong guess can leave the process idle of ∼350′000 of lines of code and 150-pages of specification (HDF waiting for memory. For example, zStandard also makes use an of a Group, accessed 2017), which makes integration in existing projects faster and more effective method for evaluating entropy, known as difficult. HDF5 has previously demonstrated compression filters in- Asymmetric Numeral System (ANS), than classic compression algo- cluding blosc and an additional LZ4-based filter funded by Dectris rithms. ANS significantly improves compression ratio in data with large (Baden, CH) (Nexus format, accessed

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    6 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us