A single-cell upstream big data processing method based on UMI-tools and Spark

Through the combination of UMI-tools and Spark, the distributed processing capabilities of Spark are used to solve the problem of low efficiency of single-cell RNA sequencing data processing in a single-machine environment, and achieve efficient multi-machine parallel processing, significantly improving the data processing speed and Scalability.

CN114067910BActive Publication Date: 2024-10-22XIAMEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111346883.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-15
Publication Date
2024-10-22
Estimated Expiration
2041-11-15

AI Technical Summary

Technical Problem

Existing single-cell RNA sequencing data processing tools such as UMI-tools, CellRanger and STARsolo can only be run in a stand-alone environment, with low parallelism and poor scalability, resulting in a waste of computing resources and low data processing efficiency.

Method used

Using a method based on UMI-tools and Spark, the FASTQ file is read through the HadoopBAM interface, abstracted into a data set, and processed using Spark's map function and Java local interface to reduce intermediate file reading and writing and achieve distributed data processing.

Benefits of technology

The data processing speed is significantly improved, achieving a speed increase of 5-20 times, and under the same CPU core consumption, it supports parallel processing by multiple machines, improving processing efficiency and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114067910B_ABST
    Figure CN114067910B_ABST
Patent Text Reader

Abstract

The present invention discloses a single cell upstream big data processing method based on UMI-tools and Spark, comprising the following steps: S1, reading FASTQ R1 and FASTQ R2 files through the interface of HadoopBAM, and abstracting them into FASTQ R1 data set and FASTQ R2 data set respectively; S2, filtering out the FASTQ data set to be processed from the FASTQ R2 data set; S3, using software STAR to convert the FASTQ data set to be processed into a SAM data set; S4, reading the GTF data set and the SAM data set, respectively performing aggregation and grouping according to the chromosome names in their respective records, and obtaining the GTF data set group and the SAM data set group; S5, splicing the SAM records and GTF records with the same chromosome name in the GTF data set group and the SAM data set group, and counting; S6, saving the counting result as a result file. The present invention greatly reduces unnecessary intermediate reading and writing processes and improves the efficiency of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a single-cell upstream big data processing method based on UMI-tools and Spark. Background Art

[0002] The three most widely used droplet-based protocols (Drop-seq, inDrop, and 10XChromium) all utilize specific processing of two biological information, cell barcodes and unique molecular identifiers, to complete quantitative estimates. They can sequence a large number of cells in just one experiment and generate a large amount of raw FASTQ data. The FASTQ data file is the starting point of the entire data processing pipeline.

[0003] For high-throughput single-cell RNA sequencing (scRNA-seq) data, before analyzing scRNA-seq data, it is necessary to convert the original FASTQ type sequencing files into readable data, that is, to organize the original FASTQ data into a gene expression matrix for downstream analysis. This process includes barcode processing, sequence quality control, genome alignment, and transcript quantification. Currently, researchers have developed some software toolkits that can run in a stand-alone environment to complete the processing from raw FASTQ data to gene expression matrices. For example, UMI-tools, CellRanger, and STARsolo are the three most commonly used single-cell upstream data analysis and processing tools. However, these three tools all have the following problems: 1. They can only run on a single machine environment, with low parallelism and poor scalability; 2. There are a large number of redundant intermediate file reading and writing in the sub-steps, which consumes a lot of computing resources and slows down data processing efficiency. Summary of the invention

[0004] To solve the above problems, the present invention provides a single-cell upstream big data processing method based on UMI-tools and Spark.

[0005] The present invention adopts the following technical solutions:

[0006] A single-cell upstream big data processing method based on UMI-tools and Spark includes the following steps:

[0007] S1, read FASTQ R1 and FASTQ R2 files through the HadoopBAM interface, and abstract them into FASTQ R1 dataset and FASTQ R2 dataset respectively;

[0008] S2, screening out a FASTQ data set to be processed from the FASTQ R2 data set;

[0009] S3, using STAR software to convert the FASTQ data set to be processed into a SAM data set;

[0010] S4, reading the GTF dataset and the SAM dataset, and performing aggregation and grouping according to the chromosome names in their respective records to obtain a GTF dataset group and a SAM dataset group;

[0011] S5, splicing the SAM records and GTF records with the same chromosome name in the GTF data set group and the SAM data set group, and counting them;

[0012] S6. Save the counting result as a result file.

[0013] Furthermore, the step S2 of filtering out the FASTQ dataset to be processed from the FASTQ R2 dataset is specifically as follows:

[0014] S21. Construct a whitelist data set (WHITELIST RDD) according to the UMI with the highest frequency in the FASTQ R1 data set;

[0015] S22, compressing the FASTQ R1 dataset and the FASTQ R2 dataset respectively to obtain an indexed R1 dataset and an indexed R2 dataset;

[0016] S23, comparing the whitelist dataset, deleting the indexed R1 dataset corresponding to the FASTQ R1 dataset whose UMI does not appear in the whitelist dataset, to obtain a filtered R1 dataset;

[0017] S24, selecting a filtered R2 dataset from the indexed R2 dataset using the filtered R1 dataset as the FASTQ dataset to be processed.

[0018] Furthermore, in step S3, the software STAR utilizes a map function and a Java native interface to directly acquire and transform the FASTQ dataset to be processed.

[0019] Furthermore, the data sets are all elastically distributed data sets.

[0020] After adopting the above technical solution, the present invention has the following advantages compared with the background technology:

[0021] 1. The traditional process is to write the FASTQ file to the disk first, and then the software STAR reads the FASTQ file from the disk and processes it to obtain a SAM file; while the present invention first abstracts the FASTQ file into a FASTQ data set, and then uses the map function provided by Spark and the native interface of Java to directly transfer the FASTQ data set to the software STAR for processing to obtain a SAM data set; that is, the present invention directly abstracts the original STAR intermediate result SAM file into a SAM data set, which greatly reduces unnecessary intermediate reading and writing processes and improves the efficiency of data processing;

[0022] 2. Spark is an analysis engine for large-scale data processing, which has the advantages of high efficiency, ease of use, versatility and compatibility. The present invention utilizes the inherent scalability of Spark and transforms the counting process that can only be run on a single machine and a single thread into a process that can be processed in parallel on multiple machines in a cluster through its own functions, thereby realizing data processing on multiple computer nodes at the same time, significantly improving the data processing speed and achieving a speed increase of about 5-20 times with the same CPU core consumption;

[0023] 3. The invention of the present invention can process FASTQ files on a distributed file system. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 Schematic diagram of the process step S2 of the present invention;

[0025] Figure 2 It is a comparison diagram between the traditional process and the method of the present invention;

[0026] Figure 3 It is a schematic flow chart of steps S4, S5 and S6 of the present invention;

[0027] Figure 4 It is a correlation diagram between UMI-tools and scSpark of the present invention;

[0028] Figure 5 The following is a comparison of the running time of different tools on different datasets. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0030] Example

[0031] A single-cell upstream big data processing method based on UMI-tools and Spark includes the following steps:

[0032] S1, read FASTQ R1 and FASTQ R2 files through the HadoopBAM interface, and abstract them into FASTQ R1 dataset and FASTQ R2 dataset respectively;

[0033] S2, screening out a FASTQ data set to be processed from the FASTQ R2 data set;

[0034] like Figure 1 As shown, the step S2 of filtering out the FASTQ dataset to be processed from the FASTQ R2 dataset is specifically as follows:

[0035] S21. Construct a whitelist data set (WHITELIST RDD) according to the UMI with the highest frequency in the FASTQ R1 data set;

[0036] S22, compressing the FASTQ R1 dataset and the FASTQ R2 dataset respectively to obtain an indexed R1 dataset and an indexed R2 dataset;

[0037] S23, comparing the whitelist dataset, deleting the indexed R1 dataset corresponding to the FASTQ R1 dataset whose UMI does not appear in the whitelist dataset, to obtain a filtered R1 dataset;

[0038] S24, selecting a filtered R2 dataset from the indexed R2 dataset using the filtered R1 dataset as the FASTQ dataset to be processed.

[0039] like Figure 2 As shown in the figure, the traditional process is to write the FASTQ file to the disk first, and then the software STAR reads the FASTQ file from the disk and processes it to obtain a SAM file; while the method of the present invention (scSpark for short) is to first abstract the FASTQ file into a FASTQ data set, and then use the map function of Spark and the native interface of Java to directly transfer the FASTQ data set to the software STAR for processing to obtain a SAM data set; that is, the present invention directly abstracts the original STAR intermediate result SAM file into a SAM data set, which greatly reduces unnecessary intermediate reading and writing processes and improves the efficiency of data processing.

[0040] S3, using STAR software to convert the FASTQ data set to be processed into a SAM data set;

[0041] In step S3, the software STAR uses the map function and the Java Native Interface to directly acquire and transform the FASTQ data set to be processed.

[0042] S4, reading the GTF data set and the SAM data set, respectively performing aggregation and grouping according to the chromosome names in their respective records, to obtain a GTF data set group and a SAM data set group; the SAM data may also be a BAM data set, and what is finally obtained is a BAM data set group;

[0043] S5, splicing the SAM records and GTF records with the same chromosome name in the GTF data set group and the SAM data set group, and counting them;

[0044] S6. Save the counting result as a result file.

[0045] The data sets are all elastically distributed data sets.

[0046] Spark is an analytical engine for large-scale data processing, which has the advantages of high efficiency, ease of use, versatility and compatibility. The present invention utilizes the inherent scalability of Spark and transforms the counting processing flow that can only be run on a single machine and a single thread into a flow that can be processed in parallel on multiple machines in a cluster through its own functions, thereby realizing data processing on multiple computer nodes at the same time, significantly improving the data processing speed and achieving a speed increase of about 5-20 times with the same CPU core consumption.

[0047] This embodiment has greatly improved performance and scalability. By comparing the performance of scSpark (i.e., the process of this embodiment) and traditional processes (UMI_tools, CellRanger, STARsolo), Figure 3 As shown, we found that in terms of running speed, when the total number of CPUs occupied by the scSpark cluster and the traditional process is the same, the processing events required by the scSpark of this embodiment are far less than those of the traditional process. The running speed of scSpark can reach 5-20 times that of the traditional process, and scSpark inherits the scalability of Spark.

[0048] like Figure 4 As shown in the figure, we also found that the results of UMI-tools and scSpark are highly correlated; the performance improvement of the traditional process will converge quickly with the increase in the number of CPUs, but for scSpark, its performance can achieve a nearly linear improvement. At the same time, we found that due to the modification of the file reading and writing interface, scSpark can also achieve higher performance and better scalability without modifying the align step of the processing logic.

[0049] like Figure 5 As shown, by comparing with the results of UMI-tools, we can find that the results generated by scSpark are correct.

[0050] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A single-cell upstream big data processing method based on UMI-tools and Spark, characterized by: The steps include: S1, read FASTQ R1 and FASTQ R2 files through the HadoopBAM interface, and abstract them into FASTQ R1 dataset and FASTQ R2 dataset respectively; S2, screening out a FASTQ data set to be processed from the FASTQ R2 data set; The step S2 of selecting the FASTQ dataset to be processed from the FASTQ R2 dataset is specifically: S21, constructing a whitelist dataset WHITELISTRDD according to the UMI with the highest frequency in the FASTQ R1 dataset; S22, compressing the FASTQ R1 dataset and the FASTQ R2 dataset respectively to obtain an indexed R1 dataset and an indexed R2 dataset; S23, comparing the whitelist dataset, deleting the indexed R1 dataset corresponding to the FASTQ R1 dataset whose UMI does not appear in the whitelist dataset, to obtain a filtered R1 dataset; S24, filtering out the filtered R2 dataset from the indexed R2 dataset through the filtered R1 dataset as the FASTQ dataset to be processed; S3, using STAR software to convert the FASTQ data set to be processed into a SAM data set; S4, reading the GTF dataset and the SAM dataset, and performing aggregation and grouping according to the chromosome names in their respective records to obtain a GTF dataset group and a SAM dataset group; S5, splicing the SAM records and GTF records with the same chromosome name in the GTF data set group and the SAM data set group, and counting them; S6. Save the counting result as a result file.

2. The single-cell upstream big data processing method based on UMI-tools and Spark as claimed in claim 1, characterized in that: In step S3, the software STAR uses the map function and the Java native interface to directly acquire and transform the FASTQ data set to be processed.

3. A single-cell upstream big data processing method based on UMI-tools and Spark as described in any one of claims 1-2, characterized in that: The data sets are all elastically distributed data sets.