Spark-based parallel calculation of 3D fourier shell correlation for macromolecule structure local resolution estimation

Yongchun Lü, Xiangrui Zeng, Xinhui Tian, Xiao Shi, Hui Wang, Xiaohui Zheng, Xiaodong Liu, Xiaofang Zhao, Xin Gao, Min Xu

Introduction

In structural biology, cryo-electron microscopy (cryo-EM) and cryo-electron tomography (cryo-ET) have become indispensable for determining the 3D structures of macromolecules. However, these reconstructions often exhibit non-uniform resolution due to factors like conformational flexibility or uneven sample distribution. To address this, Fourier Shell Correlation (FSC) is used to estimate local resolution voxel-by-voxel. While tools like blocres are widely used, they are computationally intensive and typically restricted to single-node multi-threading, creating a bottleneck as dataset sizes grow. This paper presents a distributed parallel framework using Apache Spark to accelerate these calculations.

Methodology

The proposed approach leverages the distributed computing capabilities of Apache Spark. The core innovation lies in a fine-grained 3D array partitioning method using a Key-Value (K-V) data format.

Initially, 3D density maps are transformed into K-V pairs where the key identifies a partition and the value contains spatial and density data. The researchers developed an optimized partitioning strategy to overcome memory limitations. Instead of loading entire 3D sub-arrays into Spark's Resilient Distributed Datasets (RDDs), the system stores only the starting coordinates of the sliding windows. The actual data "cutting" and processing occur on-demand at the worker nodes, significantly reducing data shuffling and memory overhead—from approximately 27 GB down to 2.5 GB for standard tasks.

Experimental Setup

The framework was validated using two datasets from the Electron Microscopy Data Bank:

  1. Human Transcription Factor IIH (EMD-3802): A single-particle analysis dataset on a 256³ grid.
  2. Sar1-Sec23-Sec24 Complex (EMD-0044): A subtomogram averaging dataset on a 224³ grid.

Results and Discussion

The Spark-based method demonstrated substantial performance improvements over traditional single-node implementations. For the EMD-3802 dataset, the standard blocres method required 106 minutes. In contrast, the Spark-based optimized parallel method completed the task in 25 minutes using four nodes and just 13 minutes using eight nodes, representing a nearly 10x speedup.

Comparison of computation times between the traditional blocres method and the Spark-based optimized parallel method across different node counts.

Crucially, this speed increase did not compromise accuracy. The local resolution maps generated were consistent with those from established tools like blocres and ResMap. Furthermore, the distributed nature of Spark provides inherent fault tolerance; if a worker node fails, tasks are automatically redistributed, ensuring job completion without manual restarts.

Conclusion

By transitioning local resolution estimation to a distributed Spark framework, researchers can significantly reduce the time required for structural analysis. Future work will focus on integrating GPU acceleration and expanding the tool's feature set to include advanced masking and filtering options, further streamlining the cryo-EM/ET research pipeline.

Summary updated

Abstract

Background Resolution estimation is the main evaluation criteria for the reconstruction of macromolecular 3D structure in the field of cryoelectron microscopy (cryo-EM). At present, there are many methods to evaluate the 3D resolution for reconstructed macromolecular structures from Single Particle Analysis (SPA) in cryo-EM and subtomogram averaging (SA) in electron cryotomography (cryo-ET). As global methods, they measure the resolution of the structure as a whole, but they are inaccurate in detecting subtle local changes of reconstruction. In order to detect the subtle changes of reconstruction of SPA and SA, a few local resolution methods are proposed. The mainstream local resolution evaluation methods are based on local Fourier shell correlation (FSC), which is computationally intensive. However, the existing resolution evaluation methods are based on multi-threading implementation on a single computer with very poor scalability. Results This paper proposes a new fine-grained 3D array partition method by key-value format in Spark. Our method first converts 3D images to key-value data (K-V). Then the K-V data is used for 3D array partitioning and data exchange in parallel. So Spark-based distributed parallel computing framework can solve the above scalability problem. In this distributed computing framework, all 3D local FSC tasks are simultaneously calculated across multiple nodes in a computer cluster. Through the calculation of experimental data, 3D local resolution evaluation algorithm based on Spark fine-grained 3D array partition has a magnitude change in computing speed compared with the mainstream FSC algorithm under the condition that the accuracy remains unchanged, and has better fault tolerance and scalability. Conclusions In this paper, we proposed a K-V format based fine-grained 3D array partition method in Spark to parallel calculating 3D FSC for getting a 3D local resolution density map. 3D local resolution density map evaluates the three-dimensional density maps reconstructed from single particle analysis and subtomogram averaging. Our proposed method can significantly increase the speed of the 3D local resolution evaluation, which is important for the efficient detection of subtle variations among reconstructed macromolecular structures.
BibTeX
@article{lu2020spark,
  author = {Yongchun Lü and Xiangrui Zeng and Xinhui Tian and Xiao Shi and Hui Wang and Xiaohui Zheng and Xiaodong Liu and Xiaofang Zhao and Xin Gao and Min Xu},
  title = {{Spark-based parallel calculation of 3D fourier shell correlation for macromolecule structure local resolution estimation}},
  journal = {BMC Bioinformatics},
  year = {2020},
  doi = {10.1186/s12859-020-03680-6},
}
Figure