Long-read sequencing optimizes device and system for error correction method of genome assembly results
Patent Information
- Authority / Receiving Office
- HK · HK
- Patent Type
- Patents
- Filing Date
- 2023-06-15
- Publication Date
- 2026-07-17
AI Technical Summary
Error correction of long-read sequencing data suffers from memory spikes and excessive time consumption, especially in large-scale genome analysis, where existing error correction software cannot effectively reduce memory and time consumption.
The long read data error correction task is divided into multiple smaller tasks and executed in parallel. Through grouping and alignment modules, the association information between long read data and the reference genome is preserved. Minimap2 alignment software and Racon error correction software are used, and multi-task parallel processing technology is employed to reduce memory and time consumption.
It significantly reduces the time and memory consumption for error correction of long-read sequencing data, improves error correction efficiency, and is suitable for large genome analysis, especially in cluster environments with limited computing resources.
Smart Images

Figure 00000015_0000 
Figure 00000015_0001 
Figure 00000016_0000
Abstract
Description
Technical Field
[0001] This invention relates to the field of bioinformatics, specifically to an apparatus and system for optimizing the error correction method of genome assembly results from long-read sequencing, and more specifically to a method for correcting long-read assembly results, an apparatus for correcting long-read assembly results, and a computer-readable storage medium. Background Technology
[0002] With technological advancements, single-molecule sequencing data, represented by PacBio and Nanopore, possesses ultra-long read lengths, enabling the assembly of complex genomic regions. Therefore, single-molecule sequencing has become a crucial sequencing technology for genome assembly analysis. However, while offering long reads, single-molecule sequencing also suffers from high sequencing error rates. Some assembly software, such as WTDBG2, Miniasm, and Flye, can assemble data with high sequencing errors, making error correction for long-read assembly results particularly important. Other software corrects high-error-rate data before assembly; for example, Canu software offers high accuracy but has high computational costs, performs poorly on highly complex genomes, and is not applicable to all species. Software like Falcon can effectively handle highly complex regions, but its assembly accuracy is lower, making error correction after genome assembly an essential step.
[0003] For the error correction stage after assembly, although short read data is more accurate than long read data, long read data has the characteristic of ultra-long read length, which can cross large repetitive sequence regions and is more accurate in correcting complex regions of the genome. In order to obtain high-quality and high-accuracy assembly results, long read data should be used first for genome assembly correction.
[0004] Although Minimap2 has replaced all other alignment software for long reads and has proven highly effective in correcting errors in long-read genomes, especially when the input file format is PAF, the alignment speed is still very fast. However, for large genomes, the data correction step still requires significant memory and is time-consuming. While dividing a large genome and aligning and correcting each segment separately, similar to aligning and correcting smaller genomes, can reduce memory usage and analysis time to some extent, the presence of numerous repetitive sequences in eukaryotes and the resulting sequence similarities mean that this local alignment cannot consider the alignment information of the entire genome. This bias in the correction results can lead to inaccuracies. Therefore, current correction software only supports global alignment (i.e., all data aligned to the entire genome) and then correction based on the global alignment results (i.e., correction of genomic sequences based on the alignment results of all data). Even this approach still presents memory and time consumption issues during the correction process. Therefore, further optimization of the error correction method is still needed to reduce the peak memory usage and execution time during the error correction process. Summary of the Invention
[0005] This application is based on the inventor's discoveries and understanding of the following problems:
[0006] Multiple studies have shown that long-read error correction in large genomes results in significant memory consumption and long processing times. Therefore, the inventors, through extensive research, discovered that processing genome modules, alignment result modules, and long-read data modules effectively divides a large error correction task into multiple smaller error correction tasks. This preserves all the association information between long-read data and the reference genome, ensuring the accuracy of the error correction results. Furthermore, this segmentation method allows multiple subtasks to be executed in parallel, effectively reducing the peak memory consumption and execution time of the error correction process, maximizing time efficiency, and ultimately reducing the overall cost of genome error correction analysis.
[0007] In a first aspect, the present invention provides a method for error correction of long-read sequencing data. According to an embodiment of the invention, the method includes: (1) grouping reference sequences to obtain multiple reference sequence subsets consisting of a portion of the reference sequences; (2) performing error correction processing on each of the multiple reference sequence subsets, the error correction processing being based on: (a) the reference sequences contained in the reference sequence subsets; (b) the alignment result corresponding to (a) in the overall alignment result; (c) the partial data corresponding to (a) in the long-read sequencing data; and (d) integrating the error correction results obtained in each of the reference sequence subsets in step (2) to obtain the error correction result of the long-read sequencing data. The method of the present invention for error correction of long-read sequencing data significantly reduces the time for data error correction and improves the error correction efficiency of sequencing data by performing data import, alignment, and error correction operations in parallel through multiple tasks.
[0008] According to embodiments of the present invention, the above method may further include at least one of the following additional technical features:
[0009] According to an embodiment of the present invention, before correcting errors in long read sequencing data, the following further processing is included: (3) grouping the long read sequencing data to obtain multiple sequencing data subsets composed of sequencing reads; (4) aligning each of the multiple sequencing data subsets with the reference sequence to obtain alignment results for each sequencing data subset; (5) merging the alignment results of the multiple sequencing data subsets to obtain a total alignment result for the multiple sequencing data subsets.
[0010] According to an embodiment of the present invention, the long sequencing read is a sequencing read with a length of 10K or more.
[0011] According to an embodiment of the present invention, the grouping is performed randomly.
[0012] According to embodiments of the present invention, the number of sequencing reads in each subset of sequencing data is not particularly limited.
[0013] According to an embodiment of the present invention, before step (3), the method includes assembling the long read sequencing data to obtain a preliminary assembly result, the preliminary assembly result constituting the reference sequence in step (4).
[0014] According to an embodiment of the present invention, at least one of steps (4) and (2) is performed simultaneously by multiple tasks.
[0015] According to an embodiment of the present invention, the grouping of the reference sequence is based on the following criteria: (1) each sequence in the reference sequence is not internally segmented; (2) the total length difference of the sequences contained in each subset of the reference sequence does not exceed 20%.
[0016] In a second aspect, the present invention provides a sequencing method. According to an embodiment of the invention, the method includes: acquiring a nucleic acid sample; performing long-read sequencing on the nucleic acid sample to obtain long-read sequencing data; and performing error correction processing on the sequencing data according to the method described in the first aspect to obtain error-corrected sequencing results. The method of the present invention for error correction of long-read sequencing data significantly reduces the time required for data error correction and improves the efficiency of error correction for sequencing data by performing data import, alignment, and error correction operations in parallel through multiple tasks.
[0017] According to embodiments of the present invention, the above method may further include at least one of the following additional technical features:
[0018] According to an embodiment of the present invention, the nucleic acid sample is derived from a host with an unknown genome sequence.
[0019] In a third aspect, the present invention provides an apparatus for error correction of long read sequencing data. According to an embodiment of the present invention, the method includes: a first grouping module for grouping the long read sequencing data to obtain multiple sequencing data subsets composed of sequencing reads; an alignment module for aligning each of the multiple sequencing data subsets with a reference sequence to obtain an alignment result for each of the sequencing data subsets; an alignment result merging module for merging the alignment results of the multiple sequencing data subsets to obtain a total alignment result for the multiple sequencing data subsets; a second grouping module for grouping the reference sequence to obtain multiple reference sequence subsets composed of a portion of the reference sequence; an error correction module for performing error correction processing on each of the multiple reference sequence subsets, the error correction processing being based on: (a) the reference sequence contained in the reference sequence subset; (b) the partial alignment result corresponding to (a) in the total alignment result; and (c) the partial sequencing data corresponding to (a) in the sequencing data; and an error correction result integration module for integrating the error correction results obtained from the multiple reference sequence subsets to obtain an error correction result for the long read sequencing data.
[0020] In a fourth aspect, the present invention provides an apparatus for error correction of long-read sequencing data. According to an embodiment of the invention, the apparatus includes a memory and a processor; the memory includes a program for storing data; the processor includes a program for executing the program stored in the memory to implement the method described in the first aspect. The apparatus according to the embodiments of the present invention performs error correction on long-read sequencing data by performing data import, alignment, and error correction operations in parallel across multiple tasks, which can significantly improve the efficiency of error correction for sequencing data and reduce time costs.
[0021] In a fifth aspect, the present invention provides an apparatus for a computer-readable storage medium. According to an embodiment of the invention, the storage medium stores a program that can be executed by a processor to implement the method described in the first aspect.
[0022] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0023] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0024] Figure 1 This is a long read long error correction process according to an embodiment of the present invention, wherein,
[0025] Step 101 represents the preparation of the assembly result file and the long read data file.
[0026] Step 102 involves aligning the long read data to the assembled result file.
[0027] Step 103 indicates that, based on the information from the alignment results, the genome assembly results are corrected using long-read data.
[0028] Step 104 represents the final error correction result generated after error correction and rectification;
[0029] Figure 2 This is a flowchart of the splitting comparison and splitting error correction method according to an embodiment of the present invention, wherein:
[0030] Step 201 represents genome preparation and slicing, in which the genome sequence is divided into M modules.
[0031] Step 202 represents the preparation and segmentation of the alignment file. This step ultimately yields M alignment results corresponding to the M sub-reference sequences.
[0032] Step 203 represents the segmentation of long read data into blocks. This step ultimately yields M long read data blocks corresponding to the M alignment results.
[0033] Step 204 indicates that for correcting M sub-blocks, M correction results are ultimately obtained.
[0034] Step 205 represents merging the error correction results to obtain the final error correction result; and,
[0035] Figure 3 This is a flowchart of obtaining the comparison results according to an embodiment of the present invention, wherein:
[0036] Step 301 means dividing the long-read data into N data blocks.
[0037] Step 302 means aligning N sub-block data to the reference genome to obtain N alignment results;
[0038] Step 303 means merging N alignment results into a final long read length alignment result; and
[0039] Figure 4 This is an apparatus for correcting long-read sequencing data according to an embodiment of the present invention, comprising: a first grouping module, an alignment module, a merged alignment module (alignment result merging module), a second grouping module, an error correction module, and an error correction result integration module. Detailed Implementation
[0040] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0041] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0042] The following description, with reference to the accompanying drawings, describes an apparatus and system for optimizing genome assembly results using long-read sequencing as an example. Before detailing the embodiments of the present invention, for ease of understanding, the method for correcting genome assembly results using long-read sequencing will first be introduced:
[0043] 1. Preparation and cutting of the reference genome
[0044] The long read data is assembled using long read assembly software to obtain the long read assembly result containing the error rate, as shown in step 201.
[0045] The segmentation process of the assembly result file is as follows: First, the total size of the reference genome and the length of the longest sequence are calculated, and the sub-block size is determined. Significant differences in the length of the segmented blocks can affect the memory settings and time efficiency of subsequent analyses. To ensure consistency in sub-block sizes, this method recommends that the set sub-block length be at least greater than the longest reference genome sequence. After determining the sub-block length, the assembly result file is read, and the lengths are accumulated. When a file exceeds the specified sub-block size, the first sub-block is generated. The next sub-block is then constructed using the same method, as shown in step 201, ultimately resulting in M sub-blocks. This method segments based on sequence names and their corresponding sequence lengths without breaking the sequences.
[0046] 2. Comparison document preparation and segmentation
[0047] The process includes the following steps:
[0048] (1) Data comparison
[0049] The Minimap2 alignment software was used to align the sequencing long-read data to the reference genome. This method supports both global alignment results and block alignment results, as shown in the attached figure. Figure 3 As shown, the block alignment result refers to the alignment result obtained after segmenting, aligning, sorting, and merging long read data without segmenting the reference genome. There are two formats for long read data: bam format (PacBio raw data file) and Fastq format (obtained after conversion of PacBio raw data file or Nanopore raw data file). The segmentation methods for these two different data formats are shown here.
[0050] Splitting BAM format files:
[0051] PacBio sequencing is performed on a chip containing millions of zero-mode waveguide holes (ZMW holes, a type of nano-optical device that confines light to a small observation volume; these are small holes with conductive layers). During sequencing, the DNA template passes through the bottom of the ZMW hole and undergoes a polymerization reaction with immobilized DNA polymerase to synthesize DNA. Real-time sequencing is achieved by detecting the fluorescence signal excited during synthesis. Because PacBio libraries consist of double-stranded DNA with sequencing adapters on both sides, forming a dumbbell shape, the DNA double strands open during sequencing, and sequencing occurs cyclically within the same ZMW hole. After sequencing, the adapter sequences are removed, and the ZMW hole information is added. Therefore, sequencing reads from the same ZMW hole originate from the same DNA fragment. Placing the same DNA fragment sequences in different subfiles would lead to alignment redundancy and increased computational and storage requirements. Therefore, when splitting PacBio bam files, sequences from the same ZMW hole must be placed in the same subfile. This process is achieved using the software program bamsieve, included in the SMRT Link installation package from the official PacBio download address (https: / / www.pacb.com / support / software-downloads / ). First, the list of ZMWs (Zero Modules) of the chipset is obtained from the PacBio boot data using the parameter "--show-zmws" of the Bamsieve software, and the total number of ZMWs M is obtained. By setting the number of sub-files N after splitting (for example, setting it to 100, the ZMW list information is split into 100 parts), the number of ZMWs in each sub-file is determined, and a sub-ZMW list is generated. Then, according to the Bamsieve parameter "--whitelist", the long reads information corresponding to each sub-ZMW list is extracted, thus obtaining N sub-files in BAM format.
[0052] Fastq file splitting:
[0053] Splitting a Fastq file only requires calculating the total number of reads S in the Fastq format file, setting the number of sub-files N (e.g., 100), determining the number of reads in each sub-file, splitting the reads first, and then dividing the long read sequence into N sub-files based on the list of sequence names of the reads.
[0054] As attached Figure 3As shown in step 301, after data segmentation, N data blocks are obtained. Each sub-block is aligned to the reference genome, resulting in N alignment results, as shown in step 302 of the attached figure. This method recommends using Minimap2 for alignment. These are then merged into the final alignment result, as shown in step 303 of the attached figure. Since the alignment results are in two formats, PAF and BAM, PAF, being in tabular form, is directly merged. For BAM format, samtoolssort is used to sort the alignment results of each sub-file before samtools merge is used to merge them into the final BAM format alignment result. The download address for samtools is (https: / / github.com / samtools / samtools). If using PacBio's official error correction software GCPP, the Smartlink package pbmm2 (which includes Minimap2 alignment and sorting) can be used for alignment. The merging of alignment results can be achieved using "dataset create --type AlignmentSet".
[0055] (2) Compare the splitting of the files
[0056] The comparison result of (1) is attached. Figure 2 The global alignment results shown in Figure 202 are attached. Figure 2 Step 202 shows how to obtain the alignment result file X based on each sequence file sequence X and the global alignment result, where X = 1, 2 to M.
[0057] If the global alignment file is in PAF format, sub-alignment files corresponding to the reference genome sub-blocks are obtained based on pattern matching. If the alignment file is in BAM format, BED files are generated from the sequence sub-block files. The start and end positions of the BED files are the start and end positions of each sequence in the reference sequence. Then, SAM Tools View is used to split the BAM files. If using PacBio's official error correction software GCPP, the SmartLink package "dataset split-contigs" can be used for splitting.
[0058] Furthermore, when the alignment file is segmented, the alignment results of the sub-blocks are not used directly. The alignment results of the sub-blocks must be merged first, and then the corresponding alignment results are extracted based on the sub-blocks split from the reference genome. The alignment results of the reference sequence subset contain all alignment results of all sequencing long read data for that subset sequence. This is because the optimal alignment information of each position in the reference genome needs to be considered during error correction. The optimal alignment of each block in the segmented alignment results cannot reflect the optimal alignment of all data at the whole genome level. Only after merging the entire sub-block alignment file and determining the alignment information of all long read sequences at each position in the reference genome can the optimal alignment at each position in the reference genome be obtained.
[0059] Minimap2 consumes very little time and memory when generating PAF format files. If CPU resources are plentiful, this alignment mode can be considered without segmentation.
[0060] 3. Long read data segmentation
[0061] The BAM file itself contains the original long read sequence information, and the long read sequence information has already been split during the file splitting process. However, the PAF alignment format file does not contain base sequence information, so the long read data information needs to be read during error correction. This requires matching the long read information corresponding to the alignment result for each sub-block.
[0062] As attached Figure 2 As shown in step 203, the long-read data is segmented based on the alignment results in PAF format to obtain a subset of long-read data contained in each alignment sub-file. Specifically, the corresponding long-read sequence name list is obtained from each PAF format alignment file sub-block in step 202. The long-read sequence name list is used to extract long-read data from the original long-read sequencing data file according to the pattern matching method, which is the data sub-block in step 203: data X, where X = 1, 2 to M. The long-read data format in this step is Fasta and Fastq format.
[0063] 4. Reference sequence sub-block error correction
[0064] As attached Figure 2As shown in Figure 204, sequence sub-block X, alignment sub-block X, and long read data sub-block X are generated by error correction software to correspond to error correction sub-block X, where X = 1, 2 ~ M. This step relies on the fact that the sub-block error correction process of the reference genome is completed independently. In commonly used long read data error correction software such as Arrow and RACON, the error correction of each sequence is based on obtaining consistent sequences from the corresponding alignment results, and their error correction is relatively independent, so this approach is feasible. This method transforms large alignment information and large long read data into hundreds of small alignment blocks and hundreds of small long read data, significantly reducing peak memory requirements and shortening analysis time.
[0065] 5. Merge error correction results
[0066] The final results are attached. Figure 2 As shown in Figure 205, the error correction results of the M error correction sub-blocks are merged to obtain a final consistent sequence file, which is the error correction result of the long read data against the reference genome.
[0067] This invention divides large datasets into many smaller datasets while preserving the complete association between long-read data and the entire genome sequence. Since genome error correction is performed sequence-by-sequence, it effectively ensures the accuracy of the error correction results. This segmentation method consumes minimal resources in the initial processing, but reduces the runtime and peak memory usage of individual subtasks during error correction. Multiple subtasks can also be performed in parallel, significantly shortening the overall runtime and reducing the overall cost of genome error correction analysis. This optimized long-read error correction strategy is particularly suitable for use in clusters consisting of many small machines, offering very high analysis efficiency.
[0068] As an example, see Figure 4 , Figure 4To implement the above-described long-read sequencing data error correction device in this embodiment of the invention, the device includes: a first grouping module for grouping the long-read sequencing data to obtain multiple sequencing data subsets composed of sequencing reads; an alignment module for aligning each of the multiple sequencing data subsets with a reference sequence to obtain alignment results for each of the sequencing data subsets; a second grouping module for grouping the reference sequence to obtain multiple reference sequence subsets composed of a portion of the reference sequence; an error correction module for performing error correction processing on each of the multiple reference sequence subsets, the error correction processing being based on: (a) the reference sequence contained in the reference sequence subset; (b) the partial alignment results corresponding to (a) in the total alignment results; and (c) the partial sequencing data corresponding to (a) in the sequencing data; and an error correction result integration module for integrating the error correction results obtained from the multiple reference sequence subsets to obtain the long-read sequencing data error correction result.
[0069] This system can effectively group and process the long reads, reference genome, and alignment results mentioned above, preserving all association information between the long reads and the reference genome. Therefore, while ensuring the accuracy of the error correction results, it effectively divides a large error correction task into multiple error correction subtasks, which are executed in parallel. This effectively reduces the peak memory consumption and execution time of the error correction process, maximizing time efficiency and reducing the overall cost of genome error correction analysis.
[0070] The present invention also provides a computer device, including a memory and a processor; the memory includes a program for storing programs; the processor includes a method for implementing the long read segment data error correction method described above by executing the program stored in the memory.
[0071] In addition, the present invention provides a computer-readable storage medium storing a program that can be executed by a processor to implement the long-read data error correction method described above.
[0072] The present invention will now be described with reference to specific embodiments. It should be noted that these embodiments are merely descriptive and do not limit the present invention in any way.
[0073] Example 1 involves module comparison and error correction of the initial assembly results of long read lengths.
[0074] In this embodiment, the size of the animal genome used is approximately 3G. The sequencing depth using Nanopore Promethion is approximately 50X, and the total data volume is approximately 150G. The RACON software was used to correct the initial assembly results with a total length of approximately 2.87G. The reference genome mentioned below is the initial assembly result with a long read length.
[0075] 1. Document preparation for comparison
[0076] Data alignment: The 50X long-read Fastq format data was divided into 299 sub-blocks, each 500MB in size. Each sub-block was aligned to a 2.87GB reference genome for global alignment, generating PAF-formatted alignment results. After all sub-tasks were completed, the 299 PAF-formatted sub-alignment files were merged to obtain a single PAF-formatted master alignment file. The specific process is as follows: Figure 3 As shown.
[0077] 2. Preparation and cutting of the reference genome
[0078] The total size of the statistical reference genome is 2.87G, the sequence format is Fasta, the maximum length of the assembled sequence is 36M, the size of the sub-file data is set to 50M, and the final number of sub-files obtained after segmentation is 60.
[0079] 3. Compare the splitting of the files.
[0080] In the alignment results obtained in step 1, the sixth column is the sequence name of the reference genome. Therefore, based on the reference sequence name of each reference genome sub-block in step 2, the corresponding alignment information is extracted from the overall alignment result file in PAF format. That is, 60 alignment sub-files are finally generated, where the sixth column of each alignment sub-file contains all the sequence names of its corresponding reference genome sub-block.
[0081] 4. Long read long data chunking
[0082] The alignment results obtained in step 1, in PAF format, show the sequence names of the sequencing data involved in the alignment in the first column. Therefore, for each of the 60 sub-alignment files obtained in step 3, the following processing is performed: based on the long-read sequence name information provided in the first column of each PAF file, the corresponding sequence names are extracted from all long-read data files, and the sequences are extracted to generate new long-read data sub-files. This results in 60 long-read data sub-files with the same format as the long-read data files. It should be noted that the number of sequences in each long-read data sub-block extracted from the long-read data should be consistent with the number of sequences used in the alignment file. Finally, there is a one-to-one correspondence between the reference sequence sub-block, the alignment sub-block, and the long-read data sub-block; in this example, there are 60 of each.
[0083] 5. Reference genome sub-block data error correction
[0084] Using Racon v1.3.3 software, with reference genome sub-blocks, alignment sub-blocks, and long read data sub-blocks that have a one-to-one correspondence as input, the reference genome sub-block data was corrected to obtain 60 error correction sub-files in Fasta format.
[0085] 6. Merge error correction results
[0086] The results of each error-corrected subfile are merged to obtain the final consistency sequence in Fasta format, which is the final error-correction result of long-read data against the reference genome.
[0087] 7. Statistics on time and resources
[0088] The specific time and resource statistics are shown in Table 1. In the comparison step, the long read long data splitting used 5 threads, the splitting time was 1.67 hours, the peak memory usage was 0.2 GB, and the total CPU time was 8.33 MHz. The data comparison split the large comparison task into 299 sub-comparison tasks, with a CPU usage of 5. The peak memory usage of all comparison tasks was 17 GB, the maximum running time was 0.12 hours, and the total CPU time was 96.1 MHz. The CPU time for merging the comparison results was 0.05 MHz. Therefore, the total CPU time for the error correction step in this embodiment is 104.48 MHz.
[0089] In the error correction step, the CPU time for genome splitting is 0.1; the CPU time for alignment result splitting is 3; for splitting sequencing long read data, each subtask uses 5 threads, with a peak memory of 0.3G, and the peak runtime for 60 tasks is 1.28h, for a total CPU time of 243; the RACON error correction thread is set to 5, with a peak memory of 29G, a peak runtime of 4.71h, and a total CPU time of 302.56; the total CPU time for merging error correction results is 0.08. Therefore, the total CPU time for the entire error correction step in this embodiment is 548.74.
[0090] After splitting, a machine with 5 CPUs and 32G can complete RACON error correction of the genome for long read data in about 8 hours, with a total CPU time of 653.22 for the entire analysis process.
[0091] Table 1:
[0092]
[0093]
[0094] Example 2 performs a global comparison of the initial assembly results of the long read length and performs module error correction.
[0095] The genome of an animal used in this example is approximately 3G in size. It was sequenced using Nanopore Promethion at a depth of approximately 50X, resulting in a total data volume of approximately 150G. The RACON software was used to correct errors in the initial assembly results, which had a total length of approximately 2.87G.
[0096] 1. Global comparison
[0097] The approximately 150GB Fastq format data was aligned to a 2.87GB primary assembly result, generating a PAF format alignment result. The alignment software used was Minimap2.
[0098] 2. Block-based error correction
[0099] The total size of the reference genome is 2.87G, the maximum length of the assembled sequence is 36M, the size of the segmented sub-blocks is set to 50M, and the segments are divided based on the sequence length and sequence name of the reference genome. The final number of genome sub-files after segmentation is 60.
[0100] Based on the reference sequence names in the sub-files after the reference genome is segmented, they are matched with the name information in the sixth column of the alignment file obtained in (1) to extract the alignment results corresponding to each reference genome sub-block, generating a list of sub-alignment files that completely correspond to the reference genome sub-blocks, for a total of 60 sub-alignment result files. According to the long read sequence name information provided in the first column of each sub-alignment file, the corresponding sequence information is extracted from all long read data files to generate 60 long read data sub-files corresponding to the reference sequence sub-blocks and alignment sub-blocks.
[0101] Using Racon v1.3.3 software, the reference genome subfiles were corrected based on each reference genome subfile and its corresponding alignment subfile and long read data subfile, and the correction results for each reference genome subfile were obtained.
[0102] The error correction results are merged to obtain the final error correction result.
[0103] 3. Time and resource statistics
[0104] The results of time and resource statistics are shown in Table 2. In the alignment process, this method adopts the strategy of aligning all long read data to the whole genome, using 20 threads, with a peak memory of 20.92G, a running time of 3.45h, and a total CPU time consumption of 69.05.
[0105] The only difference between Example 2 and Example 1 is the comparison step, but the comparison results obtained by the two methods are completely consistent. Therefore, the specific operation and resource utilization time for the error correction step are also the same, and will not be described in detail here. The total CPU time for this step is 548.74.
[0106] The overall analysis time for this embodiment was 9.67 hours, with a peak memory usage of 29GB, a peak thread usage of 20, and a total CPU usage of 614.43.
[0107] Table 2:
[0108]
[0109] Example 3 performs global comparison and global error correction on the preliminary assembly results of long reads.
[0110] The genome of an animal used in this example is approximately 3G in size. It was sequenced using Nanopore Promethion at a depth of approximately 50X, resulting in a total data volume of approximately 150G. The RACON software was used to correct errors in the initial assembly results, which had a total length of approximately 2.87G.
[0111] The approximately 150G Fastq format data was aligned to the 2.87G primary assembly result to generate the alignment result in PAF format. The alignment software used was Minimap2. The alignment result, the original Fastq format sequencing long read data, and the primary assembly result were used as inputs. Racon v1.3.3 was used to correct the errors in the primary assembly result using the long read data.
[0112] The time and resource usage results are shown in Table 3. In this embodiment, the number of threads for the comparison step was set to 32, the peak memory usage was 21.16G, the total running time was 2.09h, and the total CPU time for comparison was 66.98. The number of threads for the error correction process was set to 60, the peak memory usage was 444.15G, the running time was 89.68h, and the CPU time for the error correction step was 5380.18. Therefore, the total time used for the entire error correction process was 91.77h, the peak memory usage was 445G, the peak number of threads was 60, and the total CPU time was 5646.95.
[0113] Table 3:
[0114] project Peak time (h) Thread count Number of tasks Peak memory (G) CPU time Global comparison 2.09 32.00 1.00 21.16 66.98 Global error correction 89.68 60.00 1.00 444.15 5380.18 total 91.77 60.00 1.00 444.15 5646.95
[0115] Example 4: Comparison of Error Correction Methods
[0116] This embodiment compares the methods described in Embodiments 1 to 3. The specific comparison process and results are as follows:
[0117] 1. Comparison of the comparison process
[0118] Table 4 shows the resource consumption of the alignment process for three methods: Example 1 (splitting long-read sequencing data, aligning each subset of long-read data with the reference genome, and then merging them), Example 2 (direct alignment, thread setting 20), and Example 3 (direct alignment, thread setting 32). Here, "time" represents peak runtime; "actual threads" refers to the number of threads set during analysis; "peak memory" refers to the maximum memory usage during operation; and "actual CPU time" is the total CPU time calculated for the entire alignment process, including the CPU time used for data splitting and merging alignment results in Example 1. "Alignment entry" refers to the number of rows of alignment information after alignment, and "alignment file size" is the final size of the generated alignment file. As can be seen from Table 4, the alignment file size and alignment results obtained by the three methods are consistent. After sorting the alignment files, the results obtained using the `diff` command are completely consistent. However, in terms of time usage, a higher thread setting results in less total CPU time. When thread resources are limited, it is recommended to use the method described in Example 1, that is, to compare multiple long-read sequencing data subsets obtained after splitting the long-read sequencing data with the reference genome to obtain the comparison results of each sequencing data subset. This method can perform multiple tasks in parallel, improve analysis efficiency, and slightly reduce peak memory usage. The total running time is the shortest and controllable.
[0119] Table 4:
[0120]
[0121] 2. Comparison of error correction processes
[0122] Since all alignment results are consistent regardless of whether the long read data of the sequencing is split during alignment, only the comparison results of two implementation methods, Example 2 (module error correction) and Example 3 (global error correction), are shown here.
[0123] Table 5 shows the time and resource usage results during the error correction process in Examples 2 and 3. The results show that the method described in Example 2 is significantly lower than the method described in Example 3 in terms of time, thread usage, peak memory, and total CPU usage. Furthermore, the inventors used the longest-running sub-block (approximately 52MB) after whole-genome segmentation as an example to illustrate the effectiveness of the error correction method described in Example 2. With a CPU set to 5, the reference sequence import time was 0.395s, the long read data import time was 1614.617s, the alignment result import time was 4.017s, the time to determine the overlap relationship from the alignment results was 2050.158s, the interface output time was 11.790s, the time to obtain the corrected consistent sequence was 13271.216s, and the total time was 16953.343s, showing a significant reduction in total time.
[0124] Table 5:
[0125] Correction Time (h) actual thread Peak memory (G) Actual CPU time Implementation Method 2 (Module Error Correction) 6.22 5.00 30.00 694.54 Implementation Method 3 (Global Error Correction) 89.68 60.00 444.15 5380.18
[0126] Furthermore, the inventors compared the method described in Example 1 (optimized method, i.e., module error correction) with the method described in Example 3 (unoptimized method, i.e., global error correction). Table 6 shows the percentage of time consumed by each step in the methods of Examples 2 and 3 relative to the total time. After genome segmentation and error correction, the percentage of time spent importing long-read data decreased from 93.86% to 9.2%. The most time-consuming step was shifted to the sequence consistency step, which increased its percentage from 3.6% to 78.28%. Since genome sequence consistency is based on the alignment results corresponding to the sequence, and the alignment results for each reference genome sub-block are complete, the time efficiency of sequence consistency remains largely unchanged regardless of whether the sequence is segmented. Therefore, the method described in Example 1 effectively optimizes the overall error correction efficiency by reducing data import time.
[0127] Table 6:
[0128] project Before optimization (%) After optimization (%) Importing reference sequences 0.05 0.00 Importing long-read data 93.86 9.52 Import comparison results 0.04 0.02 Determine overlap relationship 2.28 12.09 Interface output 0.13 0.07 Consistent sequence acquisition 3.64 78.28 total 100.00 100.00
[0129] The error correction results of the methods described in Example 1 and Example 3 are compared in Table 7. The first column, Ctg_N50_len, represents the N50 length of the assembled genome (the genome assembly results are sorted from largest to smallest; sequences with a total length greater than 50% reflect the overall length of the genome, thus determining the integrity of the genome sequence). The second column, Ctg_length, represents the total length of the assembled sequence. The third column, Busco_comp, represents the proportion of complete genes compared to the baseline single-copy orthologous genes. Theoretically, the single-copy orthologous gene set is conserved across species. The proportion of single-copy orthologous genes identified in the assembly results relative to the baseline dataset can assess genome integrity; a higher proportion of complete single-copy genes indicates a more complete assembly, with a maximum value of 100. The fourth and fifth columns are the Merqury evaluation results, which compare a set of k-mers from high-precision sequencing reads with the genome assembly results. The fourth column, QV(Pred), refers to the QV value evaluated by Merqury, reflecting the precision of the genome. The fifth column, Completeness, represents the Completeness value assessed by Merqury. As shown in Table 7, after error correction, compared to the original data, the quality score improved from 22 to 28, Kmer coverage completeness improved from 82% to over 92%, and BUSCO assessment completeness improved from 63.3% to over 84%. The results of the methods described in Example 2 and Example 3 differ slightly, but due to errors in the analysis software, the overall accuracy and completeness of the genome are comparable. The method described in Example 2 effectively solves the problems of high memory consumption and long analysis time during error correction of long datasets while ensuring the analysis results remain unchanged.
[0130] Table 7:
[0131]
[0132] 3. Conclusion:
[0133] In summary, when a machine consists of a large number of small CPU resources and the CPU of a single machine is limited, it is recommended to use the module comparison and module error correction method. Among them, the optimization effect of the module error correction step is obvious. In this embodiment, the CPU time is reduced to 1 / 7 of the original, and the overall analysis time is reduced to 1 / 10 of the original. Therefore, the module comparison and module error correction method described in Embodiment 1 can effectively improve the time efficiency and CPU utilization of the error correction process.
[0134] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0135] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for long read sequencing data error correction, characterized in that, The method comprises: (1) grouping the reference sequences to obtain a plurality of reference sequence subsets, each of which consists of a part of the reference sequences; (2) performing error correction for each of the plurality of reference sequence subsets, respectively, based on the following: (a) the reference sequences contained in the reference sequence subset; (b) the partial alignment results corresponding to (a) in the total alignment results; (c) the partial sequencing data corresponding to (a) in the long read sequencing data; (d) integrating the error correction results obtained in each of the reference sequence subsets in step (2) to obtain the long read sequencing data error correction result; wherein, the total alignment results are obtained by: (3) grouping the long read sequencing data to obtain a plurality of sequencing data subsets consisting of sequencing reads; (4) aligning each of the plurality of sequencing data subsets with the reference sequences, respectively, to obtain the alignment results of each of the sequencing data subsets; (5) merging the alignment results of the plurality of sequencing data subsets to obtain the total alignment results of the plurality of sequencing data subsets; the reference sequences are obtained by: assembling the long read sequencing data to obtain a preliminary assembly result, which constitutes the reference sequences in step (4); the grouping of the reference sequences is based on the following criteria: no internal splitting is performed on each of the sequences in the reference sequences; the total length of the sequences in each of the reference sequence subsets differs by no more than 20%; each of the reference sequence subsets contains sequences longer than the longest reference sequence.
2. The method of claim 1, wherein, The long read is a sequencing read with a length of more than 10K.
3. The method of claim 1, wherein, The grouping is random.
4. The method of claim 1, wherein, At least one of step (4) and step (2) is performed simultaneously.
5. A sequencing method, characterized by, The method comprises: obtaining a nucleic acid sample; performing long read sequencing on the nucleic acid sample to obtain long read sequencing data; performing error correction on the sequencing data according to the method of any one of claims 1-4 to obtain error-corrected sequencing results.
6. The method of claim 5, wherein, The nucleic acid sample is derived from a host with unknown genomic sequence.
7. An apparatus for long read sequencing data error correction, comprising: a first grouping module for grouping the long read sequencing data to obtain a plurality of sequencing data subsets consisting of sequencing reads; an alignment module for aligning each of the plurality of sequencing data subsets with reference sequences, respectively, to obtain the alignment results of each of the sequencing data subsets; an alignment result merging module for merging the alignment results of the plurality of sequencing data subsets to obtain the total alignment results of the plurality of sequencing data subsets; a second grouping module for grouping the reference sequences to obtain a plurality of reference sequence subsets, each of which consists of a part of the reference sequences; an error correction module for performing error correction for each of the plurality of reference sequence subsets, respectively, based on the following: (a) the reference sequences contained in the reference sequence subset; (b) a part of the total alignment result corresponding to (a); (c) a part of the total sequencing data corresponding to (a); an error correction result integration module, configured to integrate error correction results obtained from the reference sequence subsets, so as to obtain the long read sequencing data error correction result; wherein the grouping of the reference sequences is based on the following criteria: no internal split is performed on each sequence in the reference sequences; the total length of sequences in each of the reference sequence subsets differs by no more than 20%; the length of sequences in each of the reference sequence subsets is greater than the longest reference sequence.
8. A computer device, comprising: comprising a memory and a processor; the memory, comprising a program for storing; the processor, comprising a program for executing the program stored in the memory to implement the method of any one of claims 1-4.
9. A computer-readable storage medium, characterized in that: the storage medium stores a program, and the program can be executed by the processor to implement the method of any one of claims 1-4. the storage medium stores a program, and the program can be executed by the processor to implement the method of any one of claims 1-4.