Compression and decompression method based on generic genome representation
By constructing a pan-genome data structure based on pan-genome representation compression and decompression methods, the problems of insufficient population genetic diversity processing capacity and excessive memory consumption in existing technologies are solved, and efficient data compression and decompression are achieved.
Patent Information
- Application Number
- CN202511371987.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-24
- Publication Date
- 2025-12-30
AI Technical Summary
Existing technologies struggle to effectively handle population genetic diversity, resulting in low compression efficiency, inability to restore original sequencing quality information during decompression, and excessive memory consumption during large-scale data processing.
A compression and decompression method based on pan-genome representation is adopted. By constructing a pan-genome data structure, the sequence files are compressed using a reference genome and index files, and then decompressed back to the original files using a simple framework.
It improves the ability to handle population genetic diversity, effectively restores the original sequencing quality information during decompression, and reduces memory usage during data processing.
Smart Images

Figure CN121237234A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of DNA next-generation sequencing data compression and decompression technology, specifically to compression and decompression methods based on pan-genome representation. Background Technology
[0002] With the rapid development of DNA sequencing technology, biomedical research faces the challenge of storing and transmitting massive amounts of data. Traditional compression methods based on a single reference genome are unable to effectively handle genetic variations between individuals, resulting in low compression efficiency, which in turn makes it difficult to achieve breakthroughs in decompression efficiency and speed.
[0003] The existing technology has the following main limitations:
[0004] Insufficient capacity to address population genetic diversity;
[0005] The original sequencing quality information cannot be effectively restored during decompression;
[0006] Excessive memory usage during large-scale data processing;
[0007] Therefore, it is essential to propose a method that can efficiently process second-generation sequencing information and reduce decompression time and storage space. Summary of the Invention
[0008] The purpose of this invention is to address the problems of insufficient capacity of existing technologies to handle population genetic diversity, inability to effectively restore original sequencing quality information during decompression, and excessive memory consumption during large-scale data processing. Therefore, this invention proposes a compression and decompression method based on pan-genome representation.
[0009] The specific process of a compression and decompression method based on pan-genome representation is as follows:
[0010] Compressed section:
[0011] Step 1: Obtain the sequencing sequence data file to be compressed. The quality score of the sequencing sequence data file to be compressed is level 4; there are 2 reads with the same name in the sequencing sequence data file to be compressed.
[0012] Obtain the reference genome sequence; obtain genomic variant samples from the 1000-person database;
[0013] Step 2: Construct a pan-genome data structure based on the reference genome sequence and the 1,000 genome variant samples;
[0014] Based on the information in the pangenome data structure, obtain the haplotype list and variant list corresponding to each window block, as well as the haplotype offset table hap_id_list;
[0015] The haplotype list information includes: the window block number corresponding to the haplotype list, the chromosome number where the window block of the haplotype list is located, the start position of the window block of the haplotype list on the chromosome, the total number of haplotypes in the haplotype list, the base sequence length of each haplotype in the corresponding window block, and the mutation number of each haplotype.
[0016] The mutation list information includes: the window block number corresponding to the mutation list, the total number of mutations in the mutation list, the position where each mutation occurs, the sequence before each mutation occurs, the sequence after each mutation occurs, and the mutation number;
[0017] Step 3: Check the sequence file to be compressed for errors; delete erroneous sequences and retain the correct sequencing sequences to be compressed;
[0018] Step 4: Obtain the window number and window offset by retaining the correct position coordinates of the sequencing sequence to be compressed;
[0019] Based on the CIGAR and MD information of the correct sequencing sequence to be compressed, obtain the sequence matching block list, head unmatched sequence hs, and tail unmatched sequence ts. Then, based on the matching block list and the bidirectional expansion algorithm, finally determine the haplotype number hap_id and haplotype offset hap_offset corresponding to the sequence.
[0020] Finally, the window number, haplotype number, haplotype offset, unmatched sequences at the head and tail, the current sequence name of the correct sequencing sequence to be compressed, and the quality score string are stored in a single compressed block.
[0021] Step 5: For the compressed block information stored in two sequences with the same name, perform binding storage; the specific process is as follows:
[0022] First, the window number and haplotype number information are calculated and converted into the actual haplotype numbers hapid1 and hapid2;
[0023] Take the absolute value of the difference between hapid1 and hapid2;
[0024] The addition / subtraction flag cbs.add_flag is used to determine the size relationship between hapid1 and hapid2;
[0025] Save hapid1, the absolute value of the difference between hapid1 and hapid2, hap_offset1, and hap_offset2;
[0026] hap_offset1 is the single offset of the first sequence;
[0027] hap_offset2 is the single offset of the first sequence;
[0028] Convert hapid1, the absolute difference between hapid1 and hapid2, hap_offset1, hap_offset2, the addition / subtraction flags cbs.add_flag, hs1, ts1, hs2, and ts2 into base sequences according to the base conversion rules;
[0029] hs1 is the unmatched head sequence of the first sequence;
[0030] ts1 is the unmatched sequence at the end of the first sequence;
[0031] hs2 is the unmatched head sequence of the second sequence;
[0032] ts2 is the unmatched sequence at the end of the second sequence;
[0033] The base sequence is converted into a binary sequence to compress the positional information;
[0034] Step 6: Read the fourth-order quality score sequence with a sequence length of 150 stored in each compressed block of each file block, process the fourth-order quality score sequence with a sequence length of 150 to generate WebP images, and finally complete the quality score compression process. One file block corresponds to several WebP images.
[0035] Unzipping section:
[0036] Based on the results of step six in the compression section, reverse steps six, five, and four are performed to obtain each sequencing sequence to be compressed.
[0037] The beneficial effects of this invention are as follows:
[0038] The purpose of this invention is to propose a decompression algorithm based on a pan-reference genome representation to construct a novel pan-genome data structure for second-generation sequencing data and improve compression and decompression efficiency, based on existing compression and decompression technologies and relying on a reference genome.
[0039] The technical solution adopted by the present invention to solve the above-mentioned technical problems is as follows: by using a compression and decompression algorithm based on pan-genome representation, the input sequence file is compressed using a known reference genome and index file, and then decompressed back to the original file using a simple framework.
[0040] This invention improves upon the insufficient capacity to handle population genetic diversity, effectively restores the original sequencing quality information during decompression, and has low memory usage during data processing. It solves the problems of insufficient capacity to handle population genetic diversity, inability to effectively restore the original sequencing quality information during decompression, and excessive memory usage during large-scale data processing in existing technologies. Attached Figure Description
[0041] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0042] Specific Implementation Method 1: The specific process of this implementation method, a compression and decompression method based on pan-genome representation, is as follows:
[0043] Compressed section:
[0044] Step 1: Obtain the sequencing sequence data file to be compressed (the human reference genome is used for experiments in the testing phase). The quality score of the sequencing sequence data file to be compressed is level 4; there are two reads with the same name in the sequencing sequence data file to be compressed.
[0045] Obtain the reference genome sequence; obtain genomic variant samples from the 1000-person database;
[0046] Step 2: Construct a pan-genome data structure based on the reference genome sequence and the 1,000 genome variant samples;
[0047] Based on the information in the pangenome data structure, obtain the haplotype list and variant list corresponding to each window block, as well as the haplotype offset table hap_id_list;
[0048] The haplotype list information includes: the window block number corresponding to the haplotype list, the chromosome number where the window block of the haplotype list is located, the start position of the window block of the haplotype list on the chromosome, the total number of haplotypes in the haplotype list, the base sequence length of each haplotype in the corresponding window block, and the variant number of each haplotype (there may be several).
[0049] The mutation list information includes: the window block number corresponding to the mutation list, the total number of mutations in the mutation list, the position where each mutation occurs, the sequence before each mutation occurs, the sequence after each mutation occurs, and the mutation number;
[0050] Step 3: Check the sequence files to be compressed for errors to ensure that the compression algorithm will not malfunction due to missing or incorrect sequence information before execution; delete erroneous sequences and retain the correct sequencing sequences to be compressed;
[0051] Step 4: Obtain the window number (window_id) and window offset (local_offset) by retaining the correct position coordinates of the sequencing sequence to be compressed;
[0052] Based on the CIGAR and MD information of the correct sequencing sequence to be compressed, obtain the sequence matching block list, head unmatched sequence hs, and tail unmatched sequence ts. Then, based on the matching block list and the bidirectional expansion algorithm, finally determine the haplotype number hap_id and haplotype offset hap_offset corresponding to the sequence.
[0053] Finally, the window number (window_id), haplotype number (hap_id), haplotype offset (hap_offset), unmatched sequences at the head and tail (hs and ts), the current sequence name of the correct sequencing sequence to be compressed, and the quality score string are stored in a single compression block (compress_b).
[0054] Step 5: For the compressed block information stored in two sequences with the same name, perform binding storage; the specific process is as follows:
[0055] First, the window number and haplotype number (hap_id) information are calculated and converted into the actual haplotype numbers hapid1 and hapid2;
[0056] Take the absolute value of the difference between hapid1 and hapid2;
[0057] The addition / subtraction flag cbs.add_flag is used to determine the size relationship between hapid1 and hapid2;
[0058] Save hapid1, the absolute value of the difference between hapid1 and hapid2, hap_offset1, and hap_offset2;
[0059] hap_offset1 is the single offset of the first sequence;
[0060] hap_offset2 is the single offset of the first sequence;
[0061] Convert hapid1, the absolute difference between hapid1 and hapid2, hap_offset1, hap_offset2, the addition / subtraction flags cbs.add_flag, hs1, ts1, hs2, and ts2 into base sequences according to the base conversion rules;
[0062] hs1 is the unmatched head sequence of the first sequence;
[0063] ts1 is the unmatched sequence at the end of the first sequence;
[0064] hs2 is the unmatched head sequence of the second sequence;
[0065] ts2 is the unmatched sequence at the end of the second sequence;
[0066] The base sequence is converted into a binary sequence to compress the positional information;
[0067] Step 6: Read the fourth-order quality score sequence with a sequence length of 150 stored in each compressed block of each file block, process the fourth-order quality score sequence with a sequence length of 150 to generate WebP images, and finally complete the quality score compression process. One file block corresponds to several WebP images.
[0068] Unzipping section:
[0069] Based on the results of step six in the compression section, reverse steps six, five, and four are performed to obtain each sequencing sequence to be compressed.
[0070] The specific process is as follows:
[0071] Step 1: Restore the Webp image obtained in Step 6 to a uint8 digital matrix using the decoding function;
[0072] Since the length of the uint8 number sequence corresponding to each sequence is 38, when traversing the uint8 number matrix, after reading each number sequence of length 38, the number sequence of length 38 is converted into a binary 01 sequence of length 304.
[0073] Then delete the last 4 bits of the 304-bit sequence to get a 300-bit binary 01 sequence.
[0074] Then, traverse the binary 01 sequence of length 300 from the beginning, converting every 2 bits into the corresponding fourth-order quality score, thus finally obtaining a fourth-order quality score string of length 150.
[0075] Each two bits are converted into a corresponding fourth-order quality score, according to the following rules: 'F' corresponds to 00; ':' corresponds to 01; '#' corresponds to 10; ',' corresponds to 11.
[0076] This completes the decompression of the quality score information;
[0077] Step 2: Based on the binary file containing the location information corresponding to each file block, perform the reverse process of Step 5 and Step 4 to obtain the information of all compressed blocks within each file block (including window_id1, hap_id1, hap_offset1, hs1, ts1, window_id2, hap_id2, hap_offset2, hs2, ts2, and sequence name). A compressed block contains the pan-genome location information of two sequences with the same name.
[0078] Step 3: Next, determine the base sequence of a specific sequence in the pan-genome location information based on the pan-genome location information. The specific process is as follows:
[0079] First, determine the window block containing a specific sequence in the pan-genome location information based on `window_id`. Then, determine the offset of that sequence within the window block using `hap_offset`. Since each sequence has a fixed length of 150, if both `hs` and `ts` are empty strings (no information in `hs` and `ts`), it indicates that no splicing has occurred. In this case, simply obtain the sequence from the reference genome within the range [hap_offset, hap_offset+150] as the standard sequence. Then, retrieve the haplotype and variant lists corresponding to that window block. Determine the variant number and its specific details based on `hap_id`. Adjust the standard sequence to finally obtain the base sequence of that sequence. Align this sequence with the reference genome sequence to re-obtain CIGAR and MD information. Finally, insert the sequence name to reconstruct all the positional information of the entire sequence.
[0080] Step 4: Concatenate the recovered quality score information with the position information to restore the complete information of the entire sequence. At this point, the decompression is complete.
[0081] This invention selects two BAM files for testing: hg001_bgi.sortn.bam (92GB in size, using a 40th-order quality score) and hg002.bwa.sn.bam (83GB in size, using a 4th-order quality score). The quality score compression and overall file compression of the two datasets are displayed.
[0082] All quality score files are sequences of strings extracted from the original BAM files.
[0083] Specific Implementation Method Two: This implementation method differs from Specific Implementation Method One in that: in step two, a pan-genome data structure is constructed based on the reference genome sequence and the 1,000 genome variant samples;
[0084] Based on the information in the pangenome data structure, obtain the haplotype list and variant list corresponding to each window block, as well as the haplotype offset table hap_id_list;
[0085] The haplotype list information includes: the window block number corresponding to the haplotype list, the chromosome number where the window block of the haplotype list is located, the start position of the window block of the haplotype list on the chromosome, the total number of haplotypes in the haplotype list, the base sequence length of each haplotype in the corresponding window block, and the variant number of each haplotype (there may be several).
[0086] The mutation list information includes: the window block number corresponding to the mutation list, the total number of mutations in the mutation list, the position where each mutation occurs, the sequence before each mutation occurs, the sequence after each mutation occurs, and the mutation number;
[0087] The specific process is as follows:
[0088] Step 2: Divide each chromosome sequence of the reference genome into window blocks (WBs) of fixed length;
[0089] The specific process is as follows:
[0090] The length of each window block shall not be less than twice the length of the sequencing sequence data to be compressed;
[0091] There is an overlap of length L between adjacent window blocks, where L is the length of the sequencing sequence to be compressed;
[0092] In the experiment, the length of the second-generation sequencing sequence data to be decompressed obtained in step one was 150bp, and the length of each window block was 300bp.
[0093] Step 22: Starting from the first chromosome of the reference genome, determine the starting position of the window block for each chromosome and obtain the list of starting window block numbers (chr_bg_wb_ID) for each chromosome;
[0094] The specific process is as follows:
[0095] First, the window block numbering starts from 0, so the starting window block number of the first chromosome is obviously 0, hence chr_bg_wb_ID[1] = 0;
[0096] The first window block on the first chromosome corresponds to the interval [1, 300], the second window block corresponds to the interval [151, 450], and so on, until the last window block is divided;
[0097] This applies to every window block on every chromosome;
[0098] The first window block on the second chromosome corresponds to the interval [1, 300], the second window block corresponds to the interval [151, 450], and so on, until the last window block is divided;
[0099] Finally, the starting positions of all window blocks on the 22 autosomes were determined;
[0100] Suppose that the first chromosome is eventually divided into a window blocks, numbered from 0 to (a-1);
[0101] Therefore, the first window block number of the second chromosome is 'a';
[0102] In other words, the window block numbering is continuous for all chromosomes, and the numbering will not start from 0 again after the window block division and numbering of a chromosome is completed.
[0103] Next, the starting window block number list chr_bg_wb_ID for each chromosome is determined. When dividing and numbering the first window block of each chromosome, the starting window block number of each chromosome is determined. If the first window block number of the i-th chromosome is k, then chr_bg_wb_ID[i] = k. After the window blocks of all chromosomes are divided and numbered, the starting window block number list chr_bg_wb_ID for each chromosome is also determined.
[0104] Steps two and three: Constructing the pan-genome data structure; the specific process is as follows:
[0105] After clarifying the window block division intervals of each reference genome chromosome, the haplotype sequences in the 1,000 genome variant samples were traversed to determine the haplotype sequences in the 1,000 genome variant samples corresponding to each window block of the reference genome.
[0106] Subsequently, within the same window block, duplicate haplotype sequences in completely identical variant samples are removed, and sequences that are exactly the same as those in the reference genome are deleted. The remaining sequences are locally distinct haplotype sequences, and each remaining sequence contains at least one variant. This is because if there is no variant, the sequence is the same as that in the reference genome within the window block. Thus, the pan-genome data structure is completed.
[0107] Step 24: Obtain the haplotype list and variant list corresponding to each window block, as well as the haplotype offset table hap_id_list, based on the information in the pan-genome data structure;
[0108] The specific process is as follows:
[0109] The haplotype list information includes: the window block number corresponding to the haplotype list (determined in step 22), the chromosome number where the window block of the haplotype list is located (determined in step 22), the start position of the window block of the haplotype list on the chromosome (determined in step 22), the total number of haplotypes in the haplotype list (counted by counting the number of distinct local haplotype sequences after deduplication under a certain window), the length of the base sequence corresponding to each haplotype in the corresponding window block (counted by counting the length of these distinct local haplotype sequences in the corresponding window block), and the variant number of each haplotype (obtained after obtaining the variant list, there may be several).
[0110] One window corresponds to one list of haplotypes;
[0111] The mutation list information includes: the window block number corresponding to the mutation list (determined in step 22), the total number of mutation positions in the mutation list, the position where each mutation occurs, the sequence before each mutation occurs, the sequence after each mutation occurs, and the mutation number.
[0112] One window corresponds to one mutation list;
[0113] For each variant, the location, the sequence before and after the variant, and its number are determined by comparing the base sequence of each distinct local haplotype sequence with that of the reference genome within the window block. This determines the variant location, the sequence before the variant (the reference genome consists entirely of standard sequences), and the sequence after the variant (the difference between the distinct local haplotype sequence and the reference genome sequence). Finally, each variant is sequentially numbered. In the haplotype list, for each haplotype sequence, the variant number can be used to iterate through all variants in the variant list. If a corresponding variant is found, its number is recorded. Each haplotype sequence may correspond to several variant numbers. At this point, this step successfully obtains the pan-genome data structure, including the haplotype and variant lists for each window block.
[0114] Obtain the haplotype offset table hap_id_list; the specific process is as follows:
[0115] Iterate through the list of haplotypes. The list of haplotypes records the total number of haplotypes corresponding to each window, which is the number of haps. Let hap_size[i] represent the total number of haplotypes that the i-th window has.
[0116] The `hapid_sum` represents the current cumulative total of singletons, initially set to 0.
[0117] And set hap_id_list[0]=0, indicating that there are a total of 0 haplotypes before the 0th window. Then add hapid_sum to the total number of haplotypes hap_size[0] of the 0th window and assign the value to hap_id_list[1], indicating that there are a total of hap_size[0] haplotypes before the 1st window.
[0118] Then, add the total number of haplotypes in the first window, hap_size[1], to hapid_sum and assign the value to hap_id_list[2], indicating that there are a total of hap_size[0]+hap_size[1] haplotypes before the second window, and so on; finally, obtain the haplotype offset table hap_id_list.
[0119] The other steps and parameters are the same as in Specific Implementation Method 1.
[0120] Specific Implementation Method 3: This implementation method differs from Specific Implementation Method 1 or 2 in that: in step 3, the sequence file to be compressed is checked for errors to ensure that the algorithm will not malfunction due to missing or incorrect sequence information before the compression algorithm is executed; erroneous sequences are deleted, and correct sequencing sequences to be compressed are retained;
[0121] The specific process is as follows:
[0122] Given that the sequencing sequence data file to be compressed contains two reads with the same name, the location information is stored by binding the information of the two reads together. The following error handling is included when processing the sequence location information:
[0123] Step 31: Check if there are two sequences with the same name in the sequencing sequence to be compressed (bams1 and bams2). If not, delete the sequences. If so, keep the sequencing sequence to be compressed and proceed to Step 32.
[0124] This ensures that subsequent compression processing can proceed normally (because we are binding the position information of a pair of reads for processing);
[0125] Step 32: Check if the chromosome ID of the sequencing sequence to be compressed is greater than 22 (the number of human autosomes). If it is greater than 22, discard the sequencing sequence to be compressed; otherwise, keep the sequencing sequence to be compressed and proceed to Step 33.
[0126] It is mainly used to deal with cases involving sex chromosomes or non-standard chromosomes;
[0127] Step 33: If the length of the CIGAR string between the sequencing sequence to be compressed and the reference genome sequence is zero (the read was not aligned), discard the sequencing sequence to be compressed; otherwise, retain the sequencing sequence to be compressed and proceed to Step 34.
[0128] Avoid unnecessary comparison information processing;
[0129] Steps 3 and 4: If the size of the inserted fragment is zero, it means that the paired-end reads are mapped to different chromosomes. In this case, the fragment will be marked as cross-chromosome and the sequencing sequence to be compressed will be discarded. Otherwise, the sequencing sequence to be compressed will be retained and proceed to step 3 and 5.
[0130] This is to prevent misjudgment of some more complex comparison results;
[0131] The insert size represents the distance between two sequences when they are aligned to the same chromosome. If it is 0, it means that the two sequences are mapped to different chromosomes, which is a cross-chromosome state. We do not process such states.
[0132] Step 35
[0133] Analysis of the CIGAR of the sequencing sequence to be compressed and the reference genome sequence;
[0134] Analyze the MD of the sequencing sequence to be compressed and the reference genome sequence;
[0135] Check the consistency of the insertion ($) and deletion (^) markers. If they are inconsistent, discard the sequencing sequence to be compressed; otherwise, keep the sequencing sequence to be compressed and proceed to step three or six.
[0136] Step 36: Check if the read length of the sequencing sequence to be compressed is 150bp. If not, discard the sequencing sequence to be compressed; otherwise, keep the sequencing sequence to be compressed and proceed to Step 37.
[0137] Ensure that the sequencing pair is complete;
[0138] Step 37: Discard sequencing sequences that cannot be processed by the CIGAR type (this compression algorithm can only process M, I, D, S, H types), otherwise retain the sequencing sequences to be compressed.
[0139] Other steps and parameters are the same as in specific implementation method one or two.
[0140] Specific Implementation Method Four: This implementation method differs from one of Specific Implementation Methods One to Three in that: in step four, the window number (window_id) and window offset (local_offset) are obtained by retaining the correct position coordinates of each sequencing sequence to be compressed;
[0141] Based on the CIGAR and MD information of the retained correct sequencing sequence to be compressed, obtain the sequence matching block list, the unmatched head sequence (hs), and the unmatched tail sequence (ts). Then, based on the matching block list and the bidirectional expansion algorithm, determine the haplotype number (hap_id) and haplotype offset (hap_offset) corresponding to the sequence. Finally, store the window number (window_id), haplotype number (hap_id), haplotype offset (hap_offset), unmatched head and tail sequences (hs and ts), the current sequence name of the retained correct sequencing sequence to be compressed, and the quality score string into a single compression block (compress_b).
[0142] The specific process is as follows:
[0143] Step 41: Obtain basic information for each sequencing read to be compressed:
[0144] Obtain the chromosome number corresponding to each sequencing read to be decompressed, obtain the first base coordinate of each sequencing read to be compressed on the corresponding chromosome, obtain the CIGAR string of each sequencing read to be compressed and the reference genome sequence, obtain the MD tag of each sequencing read to be compressed and the reference genome sequence (indicating the actual match, insertion, deletion, etc. in the sequence alignment), and the base string of the sequencing read to be compressed.
[0145] Step 42: Obtain the window number and window offset for each sequencing sequence to be compressed;
[0146] The window number and window offset of each sequencing sequence to be compressed are adjusted to obtain the final window number and window offset of each sequencing sequence to be compressed.
[0147] Step 43: Based on the CIGAR and MD information of the retained correct sequencing sequence to be compressed, obtain the list of matching blocks, the unmatched head sequence (hs), and the unmatched tail sequence (ts). Then, based on the list of matching blocks and the bidirectional expansion algorithm, finally determine the haplotype number (hap_id) and haplotype offset (hap_offset) corresponding to the sequence. Finally, store the window number, haplotype number, haplotype offset, unmatched head and tail sequences, the current sequence name of the retained correct sequencing sequence to be compressed, and the quality score string into a single compressed block.
[0148] The other steps and parameters are the same as those in one of the specific implementation methods one to three.
[0149] Specific Implementation Method 5: This implementation method differs from one of the specific implementation methods 1 to 4 in that: in step 42, the window number and window offset of each sequencing sequence to be compressed are obtained;
[0150] The window number and window offset of each sequencing sequence to be compressed are adjusted to obtain the final window number and window offset of each sequencing sequence to be compressed.
[0151] The specific process is as follows:
[0152] Step 421: Based on the retained correct position coordinates of the sequencing sequences to be compressed (including the chromosome number and the start position of the sequence on that chromosome), obtain the window number and window offset for each sequencing sequence to be compressed; the specific process is as follows:
[0153] The chromosome number and the coordinates of the first base on the chromosome are known to correspond to the correct sequence to be compressed;
[0154] The coordinate of the first base on the chromosome corresponding to each sequencing sequence to be compressed is pos;
[0155] If pos=0, then the window number is the first window number of the chromosome corresponding to each sequencing sequence to be compressed (chr_bg_wb_ID[chr_ID]);
[0156] Otherwise, divide the value of pos by 150 and round down (the value of pos is only used for calculation when doing this operation), and add the first window number of the corresponding chromosome to obtain the window number of each sequencing sequence to be compressed.
[0157] Based on the window start position corresponding to the window number in the haplotype list, subtract the window start position from pos to obtain the window offset for each sequencing sequence to be compressed;
[0158] Step 422: Adjust the window number and window offset of each sequencing sequence to be compressed to obtain the final window number and window offset for each sequencing sequence to be compressed; the specific process is as follows:
[0159] Considering window overlap, the coordinates are adjusted (local_offset is used).
[0160] Since there is a 150bp overlap between the two windows, in order to determine the number of the window block to which the sequence with the starting position in the overlapping area belongs;
[0161] If the window offset of each sequencing sequence to be compressed is greater than or equal to 150, then subtract 150 from the window offset and increment the window number by 1, thus completing the adjustment of the window number and window offset.
[0162] Otherwise, the window number and window offset values for each sequencing sequence to be compressed remain unchanged.
[0163] For example, if the window ID obtained in step 421 is 1 and the window offset is 160, according to the adjustment rule in step 422, since 160>150, we will reduce 160-150=10 and increase the window ID by 1. The final window ID is 2 and the window offset is 10.
[0164] The other steps and parameters are the same as those in one of the specific implementation methods one to four.
[0165] Specific Implementation Method Six: This implementation method differs from Specific Implementation Methods One to Five in that: in step four-three, the matching block list, unmatched head sequence (hs), and unmatched tail sequence (ts) of the sequence are obtained based on the CIGAR and MD information of the retained correct sequencing sequence to be compressed. The haplotype number hap_id and haplotype offset hap_offset corresponding to the sequence are then determined based on the matching block list and the bidirectional expansion algorithm. Finally, the window number, haplotype number, haplotype offset, unmatched head and tail sequences, the current sequence name of the retained correct sequencing sequence to be compressed, and the quality score string are stored in a single compressed block.
[0166] The specific process is as follows:
[0167] Step 431: Create an empty list of match blocks (match_block_list);
[0168] Step 432: Based on the CIGAR and MD information of the retained correct sequencing sequence to be compressed, obtain the matching position information, the head unmatched sequence hs, and the tail unmatched sequence ts;
[0169] Then the matched position information is added to the matched block list;
[0170] The matching location information includes: the sequencing position to be compressed (read_pos), the reference genome position (wb_ref_pos), and the matching length (num).
[0171] Step 433: Based on the matching block list and the bidirectional expansion algorithm, finally determine the haplotype number hap_id and haplotype offset hap_offset corresponding to the sequence; finally, store the window number, haplotype number, haplotype offset, unmatched sequences at the head and tail, the current sequence name of the correct sequencing sequence to be compressed, and the quality score string into a single compressed block.
[0172] The other steps and parameters are the same as those in one of the specific implementation methods one to five.
[0173] Specific Implementation Method Seven: This implementation method differs from Specific Implementation Methods One to Six in that: in step four, three, and two, the matching position information, the head unmatched sequence hs, and the tail unmatched sequence ts are obtained based on the CIGAR and MD information of the retained correct sequencing sequence to be compressed.
[0174] Then the matched position information is added to the matched block list;
[0175] The matching location information includes: the sequencing position to be compressed (read_pos), the reference genome position (wb_ref_pos), and the matching length (num).
[0176] The specific process is as follows:
[0177] 1) Initialize the pointer read_pos pointing to the position of the sequencing sequence to 0;
[0178] Initialize the pointer wb_ref_pos pointing to the position of the reference genome to local_offset;
[0179] Initialize the pointer md_idx pointing to the position of the MD string to 0;
[0180] Initialize the length head_s of the clipped part at the front of the sequence to 0;
[0181] Initialize the length tail_s of the clipped part at the back of the sequence to 0;
[0182] 2) Traverse the CIGAR string of the sequencing sequence to be compressed, and obtain each component (consisting of numbers and capital letters) of the CIGAR string. For example, when the CIGAR string is 67M1D83M, the CIGAR consists of three parts: 67M, 1D, and
[0183] 3) Process each component of the CIGAR string of the sequencing sequence to be compressed as follows;
[0184] 31) Let the numeric part in the CIGAR string of the sequencing sequence to be compressed be length, and the cumulative count k = 0:
[0185] 32) If the letter in a certain component of the CIGAR string of the sequencing sequence to be compressed is M, it means that the sequencing sequence is aligned with the reference genome in the interval [read_pos, read_pos + length - 1] (including both cases of identical bases and different bases);
[0186] 33) Then traverse the information in the interval [read_pos, read_pos + length - 1] of the MD string of the sequencing sequence to be compressed;
[0187] 34) When k < length, first obtain the numeric part num in the corresponding interval [read_pos, read_pos + length - 1] of the MD string, then increase k by num, move md_idx to the position of the letter after num, and then put the matching position information into the matching block list;
[0188] The matching position information includes: the sequencing position read_pos to be compressed, the reference genome position wb_ref_pos, and the matching length num;
[0189] Subsequently, read_pos is incremented by num, wb_ref_pos is incremented by num, then the letter immediately following the numeric part num is obtained, k is incremented by 1, read_pos is incremented by 1, wb_ref_pos is incremented by 1, and md_idx is moved to the position of the next number after the letter;
[0190] 35) Determine whether k < length is satisfied. If so, repeat step 34) until k ≥ length; that is, the processing of the M part in the CIGAR component is completed;
[0191] 36) If the letter of a certain component of the CIGAR string of the sequencing sequence to be compressed is I, it indicates that there is an insertion anomaly in the sequencing sequence, and extra bases are inserted; the processing method is to increment read_pos by 1 while keeping wb_ref_pos unchanged, and at the same time increment md_idx by 1;
[0192] 37) If the letter of a certain component of the CIGAR string of the sequencing sequence to be compressed is D, it indicates that there is a deletion anomaly in the sequencing sequence; the processing method is to keep read_pos unchanged while incrementing wb_ref_pos by 1, and at the same time increment md_idx by 1;
[0193] 38) If the letter of a certain component of the CIGAR string of the sequencing sequence to be compressed is S, it indicates that a soft clip has occurred;
[0194] Since the clip can only occur at the beginning or end of the sequence, if read_pos = 0, it indicates that a soft clip has occurred at the beginning of the sequencing sequence to be compressed, and let the value of head_s be equal to length; otherwise, it indicates that a soft clip has occurred at the end of the sequencing sequence to be compressed, and let the value of tail_s be equal to length;
[0195] Finally, increment read_pos by num;
[0196] 39) If the letter of a certain component of the CIGAR string of the sequencing sequence to be compressed is H, it indicates that a hard clip has occurred;
[0197] Since the clip can only occur at the beginning or end of the sequence, if read_pos = 0, it indicates that a hard clip has occurred at the beginning of the sequencing sequence to be compressed, and let the value of head_s be equal to length; otherwise, it indicates that a hard clip has occurred at the end of the sequencing sequence to be compressed, and let the value of tail_s be equal to length;
[0198] Finally, increment read_pos by num.
[0199] Other steps and parameters are the same as those in the first to sixth specific embodiments.
[0200] Specific Implementation Method Eight: This implementation method differs from Specific Implementation Methods One to Seven in that: in step four three three, the haplotype number hap_id and haplotype offset hap_offset corresponding to the sequence are finally determined based on the matching block list and the bidirectional expansion algorithm; finally, the window number, haplotype number, haplotype offset, unmatched sequences at the head and tail, the current sequence name of the correct sequencing sequence to be compressed, and the quality score string are stored in a single compressed block;
[0201] The specific process is as follows:
[0202] 1) Since the window number is known in step 432, query the total number of haplotypes contained in each window in the haplotype list hap_list.size, and the variation of each haplotype;
[0203] The mutation details include: the location of each mutation, the sequence before each mutation, and the sequence after each mutation;
[0204] 2) Create an array hap_tag with a length equal to hap_list.size to mark the haplotypes that have been processed or excluded. The initial values of the array hap_tag are all set to 0 (unmarked).
[0205] 3) Sort all matching blocks in the matching block list in descending order according to the matching length num, and process the matching blocks with longer matching lengths first;
[0206] 4) Target the first matching block with the longest matching length;
[0207] Let wb_ref_start_pos be equal to the reference genome position wb_ref_pos where the currently selected matching block is saved, read_start_pos be equal to the sequence position read_pos where the currently selected matching block is saved, and match_length be equal to the matching length num where the currently selected matching block is saved;
[0208] wb_ref_start_pos is the reference genome position;
[0209] read_start_pos is the sequencing sequence to be compressed;
[0210] match_length is the length of the match;
[0211] The default setting selects the last haplotype in the window corresponding to the sequencing sequence to be compressed;
[0212] Set the maximum match length (max_match_length) to be equal to the match length of the first match block;
[0213] Set the left position of the reference genome, left_pos, to equal wb_ref_start_pos;
[0214] Let the right position of the reference genome, right_pos, be equal to left_pos + match_length;
[0215] Set the leftmost position of the sequence, read_left_most, to equal read_start_pos;
[0216] Set the single offset hap_offset to equal left_pos;
[0217] The specific process is as follows:
[0218] 41) Iterate through each haplotype in the window block corresponding to the sequencing sequence to be compressed. If the haplotype has been marked (indicating that it has been processed or excluded), skip the corresponding haplotype; otherwise, mark and select the haplotype, set the haplotype's hap_tag = 1, and execute 42).
[0219] 42) Obtain information from the mutation list based on all mutations of the selected haplotype. The information includes: the sequence ref before the mutation, the sequence alt after the mutation, and the position pos where the mutation occurred; then execute 43).
[0220] 43) For each mutation, judge the information. If the mutation position pos is outside the closed interval [wb_ref_start_pos, wb_ref_start_pos + match_length], it means that the mutation is available under the corresponding matching block; otherwise, the mutation is not available under the corresponding matching block.
[0221] For all available variants, the reference genome sequence under the window is copied out and stored in the variable hap_string_buff. Then, according to the location of all available variants, the sequence in hap_string_buff is mutated, that is, the reference genome sequence is replaced with the variant sequence. Finally, the variant sequence is stored in hap_string_buff.
[0222] 44) Since all available variants are outside the original matching interval, the mutated reference genome may make the matching length between the sequence to be compressed and the reference genome longer, which is beneficial for compression. The matching length we calculated earlier was a comparison between the sequence to be compressed and the unmutated reference genome. Therefore, we use the biextend bidirectional expansion function to tentatively expand the matching length (the matching length num in step 41) to try to make the maximum matching length max_match_length larger.
[0223] The specific process is as follows:
[0224] 441) The inputs to the biextend bidirectional expansion function are: the variant sequence hap_string_buff, the base sequence seq of the sequencing sequence to be compressed, wb_ref_start_pos, match_length, and read_start_pos;
[0225] 442) The biextend function first attempts to expand to the left. Since the corresponding positions of the sequence to be compressed within the interval [start_read_pos, start_read_pos + match_length] match the modified reference genome sequence (starting from wb_ref_start_pos), i.e., seq[start_read_pos] = hap_string_buff[wb_ref_start_pos], seq[start_read_pos + 1] = hap_string_buff[wb_ref_start_pos + 1], ..., seq[start_read_pos + match_length] = hap_string_buff[wb_ref_start_pos + match_length], it attempts to expand to the left, comparing seq[start_read_pos – 1] with hap_string_buff[wb_ref_start_pos – 1]. If they are the same, match_length is increased by 1, and the matching continues to the left, i.e., comparing seq[start_read_pos – 1] with hap_string_buff[wb_ref_start_pos – 1]. If 2] is the same as hap_string_buff[wb_ref_start_pos – 2], then match_length is incremented by 1 and the matching comparison continues to the left, and so on; if any difference is found, the leftward expansion step is terminated immediately, and the leftmost matching position ref_left_extend of the mutated sequence hap_string_buff at the time of termination is recorded.
[0226] seq[start_read_pos] represents the base at the position start_read_pos;
[0227] hap_string_buff[wb_ref_start_pos] is the mutated sequence at the position wb_ref_start_pos;
[0228] 443) The biextend function attempts to extend to the right, that is, it compares seq[start_read_pos + match_length + 1] with hap_string_buff[wb_ref_start_pos + match_length + 1]. If they are the same, it continues to match and compare to the right, and increments match_length by 1. If they are different, it immediately terminates the right extension step and records the leftmost matching position ref_red_extend of the mutated sequence hap_string_buff at the time of termination.
[0229] After the rightward expansion step is completed, match_length either remains unchanged or increases;
[0230] 45) Compare max_match_length with the expanded match_length:
[0231] If the extended match_length > max_match_length, then the value of max_match_length will be modified to the extended match_length, and the selected haplotype number will be changed to the currently assumed haplotype number. The haplotype offset hap_offset will also be assigned a value using ref_left_extend.
[0232] 5) For the second longest matching block;
[0233] Let wb_ref_start_pos be equal to the reference genome position wb_ref_pos where the currently selected matching block is saved, read_start_pos be equal to the sequence position read_pos where the currently selected matching block is saved, and match_length be equal to the matching length num where the currently selected matching block is saved;
[0234] wb_ref_start_pos is the reference genome position;
[0235] read_start_pos is the sequencing sequence to be compressed;
[0236] match_length is the length of the match;
[0237] The maximum match length (max_match_length) is equal to the match length of the first match block, the left position of the reference genome (left_pos) is equal to wb_ref_start_pos, the right position of the reference genome (right_pos) is equal to left_pos + match_length, the left position of the sequence (read_left_most) is equal to read_start_pos, and the haplotype offset (hap_offset) is equal to left_pos; the sequence is updated using the previous match block (374).
[0238] The specific process is the same as 41) to 45);
[0239] Continue until all matching blocks have been traversed and the best matching haplotype number (hap_id) is found.
[0240] After executing steps 6), 35), and 36), the lengths of the cut head and tail sequences are obtained, which are head_s and tail_s, respectively.
[0241] Based on the length of the head sequence head_s and the length of the tail sequence tail_s;
[0242] Based on head_s and tail_s, obtain the corresponding unmatched head and tail sequences hs and ts from the base sequence of the sequencing sequence to be compressed;
[0243] Add "\0" to the end of any unmatched sequences at the beginning and end of the acquired sequence;
[0244] 7) Store the data window number, the best matching haplotype selection number, the offset corresponding to the best matching haplotype selection number, the unmatched sequences at the beginning and end after adding "\0", the current sequence name, and the quality score string into a single compressed block (compress_b). That is, the above information obtained for each sequence corresponds to a compressed block; this completes the data compression and storage.
[0245] The other steps and parameters are the same as those in specific implementation methods one through seven.
[0246] Specific Implementation Method Nine: This implementation method differs from Specific Implementation Methods One through Eight in that: in step five, the compressed block information of two sequences with the same name is bound and stored; the specific process is as follows:
[0247] First, the window number and haplotype number (hap_id) information are calculated and converted into the actual haplotype numbers hapid1 and hapid2;
[0248] Take the absolute value of the difference between hapid1 and hapid2;
[0249] The addition / subtraction flag cbs.add_flag is used to determine the size relationship between hapid1 and hapid2;
[0250] Save the absolute value of the difference between hapid1, hapid1 and hapid2, hap_offset1, and hap_offset2;
[0251] hap_offset1 is the single offset of the first sequence;
[0252] hap_offset2 is the single offset of the first sequence;
[0253] Convert hapid1, the absolute difference between hapid1 and hapid2, hap_offset1, hap_offset2, the addition / subtraction flags cbs.add_flag, hs1, ts1, hs2, and ts2 into base sequences according to the base conversion rules;
[0254] hs1 is the unmatched head sequence of the first sequence;
[0255] ts1 is the unmatched sequence at the end of the first sequence;
[0256] hs2 is the unmatched head sequence of the second sequence;
[0257] ts2 is the unmatched sequence at the end of the second sequence;
[0258] The base sequence is converted into a binary sequence to compress the positional information;
[0259] The specific process is as follows:
[0260] Step 51: Store all compressed blocks into the file block blockFiles according to the following rules; the specific process is as follows:
[0261] Each compressed block contains a window number. The file number corresponding to a certain compressed block, compress_b_id, is obtained by rounding down from the formula compress_b_id = window_id / 10000.
[0262] Where compress_b_id represents the file block number corresponding to a certain compressed block, and window_id represents the window number stored inside a certain compressed block;
[0263] Finally, a specific compressed block is placed into the file block blockFiles[compress_b_id], and all compressed blocks are placed into their corresponding file blocks according to the above calculation rules;
[0264] One compressed block corresponds to one file block, and one file block can store many compressed blocks;
[0265] Each file block is internally sorted to ensure that subsequent processing is carried out in order. The sorting is based on the window_id of all compressed blocks in each file block in ascending order. If the window_id is the same, it is sorted according to the hap_id of the compressed blocks in ascending order. This completes the sorting of all file blocks.
[0266] Step 5.2: Combining the haplotype offset table hap_id_list of the window IDs obtained in Step 2.4 and the haplotype information in the compressed blocks of each file block, calculate the actual haplotype IDs of the first and second sequences in a pair of sequences. The specific process is as follows:
[0267] Let window_id1 be the window number and haplotype number hap_id1 be the haplotype number of the first sequence in a pair of sequences; and window_id2 be the window number and haplotype number hap_id2 be the haplotype number of the second sequence. Then the actual haplotype hapid1 of the first sequence is equal to hap_id_list[window_id1] + hap_id1, and the actual haplotype hapid2 of the second sequence is equal to hap_id_list[window_id2] + hap_id2.
[0268] If hapid1 > hapid2, then the difference in actual haplotype numbers between the first and second sequences is read_pair_hap_dev = hapid1 – hapid2, and the recovery flag cbs.add_flag = 0;
[0269] Otherwise, the difference in actual haplotype numbers between the first and second sequences is read_pair_hap_dev = hapid2 – hapid1, and the recovery flag cbs.add_flag = 1;
[0270] Record the actual haplotype number hapid1 of the first sequence, the difference between the actual haplotype numbers of the first and second sequences read_pair_hap_dev, the window offset hap_offset1 of the first sequence, and the window offset hap_offset2 of the second sequence, a total of four decimal numbers;
[0271] Step 53: Convert the decimal number to binary. According to the base-to-binary mapping rule (A:00, C:01, G:10 T:11), convert the binary string into a base sequence composed of ACGT base characters.
[0272] The base-to-binary mapping rule is as follows: A corresponds to 00, C corresponds to 01, G corresponds to 10, and T corresponds to 11.
[0273] After inserting the haplotype string into the base sequence consisting of ACGT base characters in the order hs1, ts1, hs2 and ts1, ts2 (obtained in step 4.3.4.6) that did not match the reference genome, the haplotype string is inserted into the base sequence consisting of ACGT base characters in the order hs1, ts1, hs2, ts2.
[0274] Determine whether cbs.add_flag in step 52 is 0 or 1; if it is 0, convert 0 to base A, and if it is 1, convert 1 to base C; insert A or C after the base sequence corresponding to ts2;
[0275] Using $ to separate the nine parts (ACGT$A$CC$G$AA$C$G$TTTTT$A) completes the base sequence transformation process for the positional information of a pair of identical sequences;
[0276] The nine parts are as follows: the binary string is converted into a base sequence composed of ACGT base characters, which occupies 4 bits; the prefix strings hs1 and hs2, and the suffix strings ts1 and ts2 each occupy 4 bits; cbs.add_flag occupies 1 bit;
[0277] For example: the four decimal digits are 1, 2, 3, and 4;
[0278] Convert the decimal number to binary. 1 corresponds to the binary number 01, and the corresponding base is C; 2 corresponds to the binary number 10, and the corresponding base is G; 3 corresponds to the binary number 11, and the corresponding base is T; 4 corresponds to the binary number 0100, and the corresponding base is CA (100 is not 4 bits, so 0100, 01 corresponds to A, and 00 corresponds to C).
[0279] The bases corresponding to the prefix string hs1, which does not match the reference genome, are AA; the bases corresponding to the prefix string hs2, which does not match the reference genome, are CC.
[0280] The base corresponding to the suffix string ts1, which does not match the reference genome, is GG; the base corresponding to the suffix string ts2, which does not match the reference genome, is TT.
[0281] cbs.add_flag is 0, which corresponds to the base A;
[0282] Use $ to separate the nine parts (C$G$T$CA$AA$CC$GG$TT$A);
[0283] Step 54: Based on Step 53, count the number of each character A, C, G, T, and $ in all base sequences of a file block. Construct a Huffman tree based on the count of each character A, C, G, T, and $. Reconstruct the encoding format based on the Huffman tree (since the $ symbol has been added, the encoding format will inevitably be different from the encoding format mentioned in Step 53). Use the reconstructed encoding format to convert the final sequence obtained in Step 53 into the corresponding binary sequence to obtain the compressed binary file (one file block is compressed into a binary file).
[0284] Store the Huffman coding table corresponding to a file block (because the processing involves counting all characters of all base sequences in a file block and constructing a Huffman tree, so one file block corresponds to one Huffman coding table) for subsequent decoding and recovery.
[0285] After all the operations in step five, the storage of the sequence's position information was finally achieved.
[0286] The other steps and parameters are the same as those in specific implementation methods one through eight.
[0287] Specific Implementation Method 10: This implementation method differs from Specific Implementation Methods 1 to 9 in that: in step 6, the fourth-order quality score sequence with a sequence length of 150 stored in each compressed block of each file block is read, the fourth-order quality score sequence with a sequence length of 150 is processed to generate a WebP image, and finally the quality score compression process is completed. One file block corresponds to several WebP images.
[0288] Step six involves compressing the quality score information corresponding to each sequence in the file to be compressed;
[0289] Steps three, four, and five involve compressing the location information;
[0290] The specific process is as follows:
[0291] Each character in the quality score sequence is mapped using a 2-bit 01 encoding ('F', "00"; ':', "01"; '#', "10"; ',', "11"), resulting in a 300-bit 01 string. Then, every 8 bits are converted into a uint8 number from beginning to end, with zeros added if the number is less than 8 bits. This results in a 38-bit uint8 string, meaning that the original quality score sequence stored in each compressed block within a file block corresponds to a 38-bit uint8 string.
[0292] Since the maximum size of each WebP image is 16384×16384 and the value of each pixel is exactly a uint8 number, each line stores 431 uint8 number strings (431×38=16378), for a total length of 16378. Each uint8 number string of length 38 in a file block is filled into a matrix with a width of 16378 and a length of 16384. After filling 431 number strings, a newline is started. This process is repeated until all number strings in a file block are filled. Then, the WebP image conversion function in libwebp is called to convert the number matrix filled with number strings into an image, thereby generating the WebP image. Finally, the quality score compression process is completed, and one file block corresponds to several WebP images.
[0293] The original quality score sequence file was compressed using five commonly used compression algorithms: bz2, gzip, lz4, xz, and zstd. The size of the compressed file was compared with the sum of the memory occupied by all WebP images compressed using the WebP compression method, and the compression ratio was calculated.
[0294] The other steps and parameters are the same as those in specific implementation methods one through nine.
[0295]
[0296]
[0297]
[0298] This invention may have other embodiments. Without departing from the spirit and essence of this invention, those skilled in the art can make various corresponding changes and modifications according to this invention, but these corresponding changes and modifications should all fall within the protection scope of the appended claims.
Claims
1. A compression and decompression method based on pan-genome representation, characterized in that: The method specifically comprises the following steps: Compressed part: Step 1: obtaining a to-be-compressed sequencing sequence data file, wherein the quality score in the to-be-compressed sequencing sequence data file is four orders; the same-named read in the to-be-compressed sequencing sequence data file is two; Obtaining a reference genome sequence; obtaining a thousand human genome variation sample; Step 2: constructing a pan-genome data structure according to the reference genome sequence and the thousand human genome variation sample; According to the information in the pan-genome data structure, obtaining a haplotype list and a variation list corresponding to each window block, and a haplotype offset table hap_id_list; The haplotype list information comprises: the window block number corresponding to the haplotype list, the chromosome number where the window block corresponding to the haplotype list is located, the starting position of the window block corresponding to the haplotype list on the chromosome, the total number of haplotypes in the haplotype list, the base sequence length corresponding to each haplotype in the window block, and the variation number of each haplotype; The variation list information comprises: the window block number corresponding to the variation list, the total number of variations in the variation list, the position of each variation, the sequence before each variation, the sequence after each variation, and the variation number; Step 3: checking the error of the to-be-compressed sequence file; deleting the error sequence and retaining the correct to-be-compressed sequencing sequence; Step 4: obtaining the window number and window offset through the position coordinates of the retained correct to-be-compressed sequencing sequence; According to the CIGAR and MD information of the retained correct to-be-compressed sequencing sequence, obtaining the matching block list of the sequence, the head unmatched sequence hs and the tail unmatched sequence ts, and finally determining the haplotype number hap_id and the haplotype offset hap_offset corresponding to the sequence according to the matching block list and the bidirectional expansion algorithm; Finally, the window number, the haplotype number, the haplotype offset, the head and tail unmatched sequences, the current sequence name of the retained correct to-be-compressed sequencing sequence, and the quality score string are stored in a single compressed block; Step 5: binding and storing the compressed block information of the two sequences with the same name; the specific process is as follows: Firstly, the window number and the haplotype number information are calculated and converted into the actual haplotype numbers hapid1 and hapid2; Taking the absolute value of the difference between hapid1 and hapid2; Using the addition and subtraction flag cbs.add_flag to judge the size relationship between hapid1 and hapid2; Saving hapid1, the absolute value of the difference between hapid1 and hapid2, hap_offset1 and hap_offset2; Hap_offset1 is the haplotype offset of the first sequence; Hap_offset2 is the haplotype offset of the first sequence; Converting hapid1, the absolute value of the difference between hapid1 and hapid2, hap_offset1, hap_offset2, the addition and subtraction flag cbs.add_flag, hs1, ts1, hs2 and ts2 into base sequences according to the base conversion rule; Hs1 is the head unmatched sequence of the first sequence; ts1 is the tail unmatched sequence of the first sequence; hs2 is the head unmatched sequence of the second sequence; ts2 is the tail unmatched sequence of the second sequence; the base sequence is converted into a binary sequence to complete the compression of the position information; Decompression part: Based on the results of step six of the compression part, perform step six in reverse, step five in reverse, and step four in reverse to obtain each sequencing sequence to be compressed.
2. The compression and decompression method based on pan-genome representation according to claim 1, characterized in that: In step two, the pan-genome data structure is constructed according to the reference genome sequence and the thousand-genome variant sample; According to the information in the pan-genome data structure, obtain the haplotype list and the variant list corresponding to each window block, and the haplotype offset table hap_id_list; The haplotype list information includes: the window block number corresponding to the haplotype list, the chromosome number where the window block corresponding to the haplotype list is located, the starting position of the window block corresponding to the haplotype list on the chromosome, the total number of haplotypes in the haplotype list, the base sequence length of each haplotype in the corresponding window block, and the variant number of each haplotype; The variant list information includes: the window block number corresponding to the variant list, the total number of variants in the variant list, the position of each variant, the sequence before each variant, the sequence after each variant, and the variant number; The specific process is: Step 211, divide each chromosome sequence of the reference genome into window blocks according to a fixed length; The specific process is: The length of each window block is not less than twice the length of the sequencing sequence data to be compressed; There is an overlap of length L between adjacent window blocks, where L is the length of the sequencing sequence to be compressed; Step 221, starting from the first chromosome of the reference genome, determine the starting position of the window block of each chromosome and obtain the starting window block number list chr_bg_wb_ID of each chromosome. The specific process is: First, the window block number starts from 0, so the starting window block number of the first chromosome is 0, and chr_bg_wb_ID[1] = 0; The first window block on the first chromosome corresponds to the interval [1, 300] of the first chromosome, the second window block corresponds to the interval [151, 450], and so on, until the last window block is divided; The first window block on the second chromosome corresponds to the interval [1, 300] of the second chromosome, the second window block corresponds to the interval [151, 450], and so on, until the last window block is divided; Finally, the starting positions of the window blocks on the 22 autosomes are determined; Assuming that the first chromosome is finally divided into a window blocks, i.e. the number from 0 to (a-1); Then the first window block number of the second chromosome is a; Next determine the start window block number list of each chromosome chr_bg_wb_ID, when dividing and numbering the first window block of each chromosome, the start window block number of each chromosome is determined; if the first window block number of the i-th chromosome is k, then chr_bg_wb_ID[i] = k; when the window block of all chromosomes is divided and numbered, the start window block number list of each chromosome chr_bg_wb_ID is also determined; Step two three: construct a pan-genome data structure; the specific process is as follows: Traverse the thousand human genome variant samples to determine the haplotype sequence in the corresponding thousand human genome variant sample under each window block of the reference genome; Then, in the same window block, the haplotype sequence in the completely consistent variant sample is de-duplicated, and the sequence completely identical with the reference genome is deleted, and the remaining sequence is a local haplotype sequence different from each other, and each remaining sequence contains at least one variation, thus constructing a pan-genome data structure; Step two four, according to the information in the pan-genome data structure, obtain the haplotype list and the variation list corresponding to each window block, and the haplotype offset table hap_id_list; The specific process is as follows: The haplotype list information includes: the window block number corresponding to the haplotype list, the chromosome number where the window block corresponding to the haplotype list is located, the starting position of the window block corresponding to the haplotype list in the chromosome, the total number of haplotypes in the haplotype list, the length of the base sequence corresponding to each haplotype in the window block, and the variation number of each haplotype; The variation list information includes: the window block number corresponding to the variation list, the total number of variation positions in the variation list, the position of each variation, the sequence before each variation, the sequence after each variation, and the variation number; Obtain the haplotype offset table hap_id_list; the specific process is as follows: Traverse the haplotype list, which records the total number of haplotypes corresponding to each window, that is, hap_size[i] represents the total number of haplotypes in the i-th window. Use hapid_sum to represent the total number of haplotypes accumulated so far, which is initially 0. And let hap_id_list[0] = 0, which means that there are 0 haplotypes before the 0th window, then add hap_size[0] to hapid_sum, which is the total number of haplotypes in the 0th window, and assign the value to hap_id_list[1], which means that there are hap_size[0] haplotypes before the 1st window. Then add hap_size[1] to hapid_sum, which is the total number of haplotypes in the 1st window, and assign the value to hap_id_list[2], which means that there are hap_size[0]+hap_size[1] haplotypes before the 2nd window, and so on; finally, the haplotype offset table hap_id_list is obtained.
3. The compression and decompression method based on pan-genome representation according to claim 2, characterized in that: In step three, the error of the to-be-compressed sequence file is checked; the incorrect sequence is deleted, and the correct to-be-compressed sequencing sequence is retained; The specific process is as follows: Step three one, check if the same name sequence in the sequencing sequence to be compressed is two, if not, delete the sequence, if yes, keep the sequencing sequence to be compressed, step three two; Step three two, check if the chromosome ID of the sequencing sequence to be compressed is greater than 22, if greater than 22, discard the sequencing sequence to be compressed, otherwise keep the sequencing sequence to be compressed, step three three; Step three three, if the length of the CIGAR string of the sequencing sequence to be compressed and the reference genome sequence is equal to zero, discard the sequencing sequence to be compressed, otherwise keep the sequencing sequence to be compressed, step three four; Step three four, if the insert size is equal to zero, it means that the double-end read is mapped to different chromosomes, discard the sequencing sequence to be compressed, otherwise keep the sequencing sequence to be compressed, step three five; Step three five, Parse the CIGAR of the sequencing sequence to be compressed and the reference genome sequence; Parse the MD of the sequencing sequence to be compressed and the reference genome sequence; Check the consistency of the insert ($) and delete (^) marks, if found inconsistent, discard the sequencing sequence to be compressed, otherwise keep the sequencing sequence to be compressed, step three six; Step three six, detect if the read length of the sequencing sequence to be compressed is 150bp, if not, discard the sequencing sequence to be compressed, otherwise keep the sequencing sequence to be compressed, step three seven; Step three seven, discard the sequencing sequence to be compressed which can not be processed by CIGAR type, otherwise keep the sequencing sequence to be compressed.
4. The compression and decompression method based on pan-genome representation according to claim 3, characterized in that: The window number and window offset are obtained by the position coordinates of each correct sequencing sequence to be compressed retained in the step four; According to the CIGAR and MD information of the correct sequencing sequence to be compressed retained, the matching block list, the head unmatched sequence hs and the tail unmatched sequence ts of the sequence are obtained, and finally the haplotype number hap_id and the haplotype offset hap_offset corresponding to the sequence are determined according to the matching block list and the bidirectional expansion algorithm; finally, the window number, haplotype number, haplotype offset, head and tail unmatched sequence, current sequence name, quality score string of the correct sequencing sequence to be compressed retained are stored in a single compression block; The specific process is: Step four one, obtain the basic information of each sequencing sequence read to be compressed: Obtain the chromosome number corresponding to each sequencing sequence read to be compressed, obtain the first base coordinate of each sequencing sequence read to be compressed on the corresponding chromosome, obtain the CIGAR string of each sequencing sequence read to be compressed and the reference genome sequence, obtain the MD tag of each sequencing sequence read to be compressed and the reference genome sequence, and obtain the base string of the sequencing sequence to be compressed; Step four two, obtain the window number and window offset of each sequencing sequence to be compressed; Adjust the window number and window offset of each sequencing sequence to be compressed to obtain the final window number and window offset of each sequencing sequence to be compressed; Step four three, obtaining the matching block list, head unmatched sequence hs, tail unmatched sequence ts of the sequence according to the CIGAR and MD information of the reserved correct sequencing sequence to be compressed, and finally determining the haplotype number hap_id and haplotype offset hap_offset corresponding to the sequence according to the matching block list and the bidirectional expansion algorithm; finally, the window number, haplotype number, haplotype offset, head and tail unmatched sequence, current sequence name of the reserved correct sequencing sequence to be compressed, and quality score string are stored in a single compression block.
5. The compression and decompression method based on pan-genome representation according to claim 4, characterized in that: The window number and window offset of each sequencing sequence to be compressed are obtained in step four two; Adjust the window number and window offset of each sequencing sequence to be compressed to obtain the final window number and window offset of each sequencing sequence to be compressed; The specific process is as follows: Step four two one, obtaining the window number and window offset of each sequencing sequence to be compressed based on the position coordinates of the reserved correct sequencing sequence to be compressed; the specific process is as follows: The chromosome number and the first base coordinate on the chromosome corresponding to the reserved correct sequencing sequence to be compressed are known; The first base coordinate on the chromosome corresponding to each sequencing sequence to be compressed is pos; If pos=0, the window number is the first window number of the chromosome corresponding to each sequencing sequence to be compressed; Otherwise, divide the value of pos by 150 and take the integer part, and add the first window number of the corresponding chromosome to obtain the window number of each sequencing sequence to be compressed; According to the window start position corresponding to the window number in the haplotype list, subtract the window start position from pos to obtain the window offset of each sequencing sequence to be compressed; Step four two two, adjusting the window number and window offset of each sequencing sequence to be compressed to obtain the final window number and window offset of each sequencing sequence to be compressed; the specific process is as follows: If the window offset of each sequencing sequence to be compressed is greater than or equal to 150, subtract 150 from the window offset and add 1 to the window number, which completes the adjustment of the window number and window offset; Otherwise, the values of the window number and window offset of each sequencing sequence to be compressed remain unchanged.
6. The compression and decompression method based on pan-genome representation according to claim 5, characterized in that: The specific process is as follows: Step four three one, creating an empty matching block list; Step four three two, obtaining the matching position information, head unmatched sequence hs, and tail unmatched sequence ts according to the CIGAR and MD information of the reserved correct sequencing sequence to be compressed; Then the matched position information is put into the matching block list; The matched position information includes: the sequencing position to be compressed read_pos, the reference genome position wb_ref_pos, and the matching length num; Step four three, the haplotype number hap_id and the haplotype offset hap_offset corresponding to the sequence are finally determined according to the matching block list and the bidirectional expansion algorithm; finally, the window number, the haplotype number, the haplotype offset, the head and tail unmatched sequences, the current sequence name, the quality score string of the reserved correct sequencing sequence to be compressed are stored in a single compression block.
7. The compression and decompression method based on pan-genome representation according to claim 6, characterized in that: In step four three, the matched position information, the head unmatched sequence hs, and the tail unmatched sequence ts are obtained according to the CIGAR and MD information of the reserved correct sequencing sequence to be compressed; Then the matched position information is put into the matching block list; The matched position information includes: the sequencing position to be compressed read_pos, the reference genome position wb_ref_pos, and the matching length num; The specific process is as follows: 1) initialize the pointer to the sequencing sequence position read_pos = 0; Initialize the pointer to the reference genome position wb_ref_pos = local_offset; Initialize the pointer to the MD string position md_idx = 0; Initialize the sequence front end cutting part length head_s = 0; Initialize the sequence back end cutting part length tail_s = 0; 2) traverse the CIGAR string of the sequencing sequence to be compressed, and obtain each component of the CIGAR string; 3) each component of the CIGAR string of the sequencing sequence to be compressed is processed as follows: 31) set the number part of the CIGAR string of the sequencing sequence to be compressed as length, and accumulate k = 0: 32) if the letter of a component of the CIGAR string of the sequencing sequence to be compressed is M, it means that the sequencing sequence is aligned with the reference genome in the interval [read_pos, read_pos + length – 1]; 33) then traverse the information of the interval [read_pos, read_pos + length – 1] in the MD string of the sequencing sequence to be compressed; 34) when k < length, first get the number part num of the interval [read_pos, read_pos + length – 1] corresponding to the MD string, then k increases num, md_idx moves to the letter position after num, and the matched position information is put into the matching block list; The matched position information includes: the sequencing position to be compressed read_pos, the reference genome position wb_ref_pos, and the matching length num; Then read_pos increases num, wb_ref_pos increases num, the letter after num is obtained, k increases 1, read_pos increases 1, wb_ref_pos increases 1, and md_idx moves to the position of the next number after the letter; 35) judge whether k < length, if yes, repeat 34) until k ≥ length; that is, the processing of the M part in the CIGAR component is completed; 36) if the letter of a component of the CIGAR string of the sequencing sequence to be compressed is I, it indicates that the sequencing sequence has an insertion anomaly and extra bases are inserted; the processing method is to increase read_pos by 1 while keeping wb_ref_pos unchanged, and increase md_idx by 1; 37) if the letter of a component of the CIGAR string of the sequencing sequence to be compressed is D, it indicates that the sequencing sequence has a deletion anomaly; the processing method is to keep read_pos unchanged while increasing wb_ref_pos by 1, and increase md_idx by 1; 38) if the letter of a component of the CIGAR string of the sequencing sequence to be compressed is S, it indicates that soft clipping occurs; If read_pos = 0, it indicates that soft clipping occurs at the beginning of the sequencing sequence to be compressed, and the value of head_s is equal to length; otherwise, it indicates that soft clipping occurs at the end of the sequencing sequence to be compressed, and the value of tail_s is equal to length; Finally, let read_pos increase num; 39) if the letter of a component of the CIGAR string of the sequencing sequence to be compressed is H, it indicates that hard clipping occurs; If read_pos = 0, it indicates that hard clipping occurs at the beginning of the sequencing sequence to be compressed, and the value of head_s is equal to length; otherwise, it indicates that hard clipping occurs at the end of the sequencing sequence to be compressed, and the value of tail_s is equal to length; Finally, let read_pos increase num.
8. The compression and decompression method based on pan-genome representation according to claim 7, characterized in that: In step 433, the hap_id and hap_offset of the sequence are finally determined according to the match block list and the bidirectional extension algorithm; finally, the window number, hap_id, hap_offset, head and tail unmatched sequences, the current sequence name of the correct sequencing sequence to be compressed, and the quality score string are stored in a single compression block; The specific process is as follows: 1) query the total number of haplotypes contained in each window hap_list.size and the variation corresponding to each haplotype in the haplotype list; The variation includes: the position of each variation, the sequence before each variation, and the sequence after each variation; 2) create an array hap_tag with a length equal to hap_list.size, and the initial value of the array hap_tag is 0; 3) sort all match blocks in the match block list in descending order according to the match length num, and preferentially process match blocks with longer match lengths; 4) for the first matching block with the longest length of match; Let wb_ref_start_pos be equal to the reference genome position wb_ref_pos saved by the current selected matching block, read_start_pos be equal to the sequence position read_pos saved by the current selected matching block, and match_length be equal to the length of match num saved by the current selected matching block; wb_ref_start_pos is the reference genome position; read_start_pos is the sequencing sequence to be compressed; match_length is the length of match; By default, mark and select the last haplotype in the window corresponding to the sequencing sequence to be compressed; Let the maximum length of match max_match_length be equal to the length of match of the first matching block; Let the left position of the reference genome left_pos be equal to wb_ref_start_pos; Let the right position of the reference genome right_pos be equal to left_pos + match_length; Let the left position of the sequence read_left_most be equal to read_start_pos; Let the haplotype offset hap_offset be equal to left_pos; The specific process is as follows: 41) Traverse each haplotype under the window block corresponding to the sequencing sequence to be compressed. If the haplotype has been marked, skip the corresponding haplotype; otherwise, mark and select the haplotype, set hap_tag of the haplotype = 1, and execute 42); 42) Obtain information based on all the variations of the selected haplotype in the variation list, including: the sequence ref before the variation occurs, the sequence alt after the variation occurs, and the position pos where the variation occurs; execute 43); 43) Judge the information of each variation. If the position pos where the variation occurs is located outside the closed interval [wb_ref_start_pos, wb_ref_start_pos + match_length], it means that the variation is available under the corresponding matching block, otherwise the variation is not available under the corresponding matching block; For all available variations, copy the reference genome sequence under the window, store it in the variable hap_string_buff, and then make the sequence in hap_string_buff vary according to the positions where all the available variations occur, that is, replace the reference genome sequence with the variation sequence; 44) Use the biextend bidirectional extension function to attempt to extend the length of match; The specific process is as follows: 441) The input of the biextend bidirectional extension function is: the variation sequence hap_string_buff, the base sequence seq of the sequencing sequence to be compressed, wb_ref_start_pos, match_length, and read_start_pos; 442), biextend bi-directional extension function first tries to extend to the left, compares seq[start_read_pos - 1] and hap_string_buff[wb_ref_start_pos - 1] whether same, if same, match_length increases 1, and continue to match to the left, that is, compare seq[start_read_pos - 2] and hap_string_buff[wb_ref_start_pos - 2] whether same, if also same, match_length increases 1, continue to match to the left, and so on. As long as the same situation occurs, immediately terminate the left extension step, and record the leftmost matching position of the variant sequence hap_string_buff ref_left_extend when terminating; seq[start_read_pos] is the base at start_read_pos position; hap_string_buff[wb_ref_start_pos] is the variant sequence at wb_ref_start_pos position; 443), biextend bi-directional extension function extends to the right, that is, compares seq[start_read_pos + match_length + 1] and hap_string_buff[wb_ref_start_pos + match_length + 1] whether same, if same, continue to match to the right, and let match_length increase 1. As long as the same situation occurs, immediately terminate the right extension step, and record the leftmost matching position of the variant sequence hap_string_buff ref_red_extend when terminating; 45), compare max_match_length and the extended match_length: If the extended match_length > max_match_length, modify the value of max_match_length to the extended match_length, and change the selected haplotype number to the currently assumed haplotype number, and the haplotype offset hap_offset is also assigned with ref_left_extend; 5), for the second matching block with the second longest match_length; Let wb_ref_start_pos equal the reference genome position wb_ref_pos saved by the currently selected matching block, read_start_pos equal the sequence position read_pos saved by the currently selected matching block, and match_length equal the match_length num saved by the currently selected matching block; wb_ref_start_pos is the reference genome position; read_start_pos is the sequencing sequence to be compressed; match_length is the matching length; Until all matching blocks are traversed, the best matching haplotype number is found; 6) Based on the length of the head sequence head_s and the length of the tail sequence tail_s; Based on head_s and tail_s, the corresponding head and tail unmatched sequences hs and ts are obtained from the base sequence of the sequencing sequence to be compressed; "\0" is added to the tail of the obtained head and tail unmatched sequences; 7) The data window number, the best matching haplotype selection number, the offset corresponding to the best matching haplotype selection number, the head and tail unmatched sequences after adding "\0", the current sequence name, and the quality score string are stored in a single compression block.
9. The compression and decompression method based on pan-genome representation according to claim 8, characterized in that: In step five, the compression block information stored for two sequences with the same name is stored by binding; the specific process is: First, the window number and haplotype number information are calculated and converted into actual haplotype numbers hapid1 and hapid2; Take the absolute value of the difference between hapid1 and hapid2; Use the plus-minus flag cbs.add_flag to determine the size relationship between hapid1 and hapid2; Save hapid1, the absolute value of the difference between hapid1 and hapid2, hap_offset1, and hap_offset2; hap_offset1 is the haplotype offset of the first sequence; hap_offset2 is the haplotype offset of the first sequence; Convert hapid1, the absolute value of the difference between hapid1 and hapid2, hap_offset1, hap_offset2, the plus-minus flag cbs.add_flag, hs1, ts1, hs2, and ts2 into base sequences according to the base conversion rule; hs1 is the head unmatched sequence of the first sequence; ts1 is the tail unmatched sequence of the first sequence; hs2 is the head unmatched sequence of the second sequence; ts2 is the tail unmatched sequence of the second sequence; Convert the base sequence into a binary sequence to complete the compression of the position information; The specific process is: Step five, store all compression blocks in the file block blockFiles according to the following rules; the specific process is: Each compression block contains a window number, and the file number compress_b_id corresponding to a compression block is obtained by rounding down compress_b_id = window_id / 10000; Where compress_b_id represents the file block number corresponding to a compression block, and window_id represents the window number stored in a compression block; Finally, a compression block is placed in the file block blockFiles[compress_b_id], and all compression blocks are placed in the corresponding file block according to the above calculation rule; Sort each file block internally, and the sorting basis is to arrange all the compressed blocks in each file block according to the window_id from small to large, and if the window_id is the same, arrange the compressed blocks according to the hap_id from small to large, that is, the sorting work of all file blocks is completed; Step five two, combine the hap_id_list of the window ID obtained in step two four and the haplotype information in the compressed blocks in each file block to calculate the actual haplotype ID of each of the first sequence and the second sequence in the pair of sequences, and the specific process is: Suppose that the window number corresponding to the first sequence in the pair of sequences is window_id1, and the haplotype number is hap_id1; the window number corresponding to the second sequence is window_id2, and the haplotype number is hap_id2, then the actual haplotype hapid1 of the first sequence is equal to hap_id_list[window_id1] + hap_id1, and the actual haplotype hapid2 of the second sequence is equal to hap_id_list[window_id2] + hap_id2; If hapid1> hapid2, then the actual haplotype number difference read_pair_hap_dev between the first sequence and the second sequence is hapid1 – hapid2, and the recovery flag cbs.add_flag is set to 0; Otherwise, the actual haplotype number difference read_pair_hap_dev between the first sequence and the second sequence is hapid2 – hapid1, and the recovery flag cbs.add_flag is set to 1; Record the actual haplotype number hapid1 of the first sequence, the actual haplotype number difference read_pair_hap_dev between the first sequence and the second sequence, the window offset hap_offset1 of the first sequence, and the window offset hap_offset2 of the second sequence, a total of four decimal numbers; Step five three, convert the decimal numbers into binary, and convert the binary string into a base sequence composed of ACGT base characters according to the base-binary mapping rule; The base-binary mapping rule is that A corresponds to 00, C corresponds to 01, G corresponds to 10, and T corresponds to 11; Insert the prefix strings hs1, hs2 and the suffix strings ts1, ts2 that are not matched on the reference genome into the base sequence composed of ACGT base characters in the order of hs1, ts1, hs2, ts2; Determine whether cbs.add_flag in step five two is 0 or 1; if it is 0, convert 0 to base A, and if it is 1, convert 1 to base C; insert A or C into the base sequence corresponding to ts2; Use $ to separate the nine parts respectively, that is, the base sequence conversion process for the position information of a pair of homonymous sequences is completed. Step five four, based on step five three of a file block of all base sequence statistics A, C, G, T, $ the number of each character, based on A, C, G, T, $ each character number of Huffman tree is constructed, based on the Huffman tree is reconstructed encoding format, using the reconstructed encoding format will step five three get the final sequence into the corresponding binary sequence, obtain the compressed binary file; Store a file block corresponding to the Huffman encoding table.
10. The compression and decompression method based on pan-genome representation according to claim 9, characterized in that: The step six reads the sequence length of 150 four order quality score sequence stored in each compressed block in each file block, and the sequence length of 150 four order quality score sequence is as follows: The specific process is: Each character of the quality score sequence is mapped to 2-bit 01 coding, generating a 01 string with a length of 300, and then converting each 8-bit from head to tail into a uint8 number, and filling 0 if less than 8 bits. Finally, a uint8 number string with a length of 38 is obtained. Each length of 38 uint8 number string in a file block is filled into a matrix with a width of 16378 and a length of 16384 one by one, and a line is changed every 431 number strings, which is repeated until all the number strings in a file block are filled. Then, the webp image conversion function in libwebp is called to convert the number matrix filled with number strings into an image, realize the generation of webp image, and finally complete the compression processing of quality score. A file block corresponds to several webp images.
Citation Information
Cited By
Sequence-to-graph comparison method, system and device based on haplotype perception and medium
CN121938462A