A genotype filling calculation method for low-depth whole-genome sequencing data

By optimizing the forward-backward algorithm of the Hidden Markov model, combined with EM algorithm and symmetry considerations, the performance bottleneck problem of low-deep whole genome sequencing data filling algorithm is solved, and rapid and accurate genotype filling and computational performance improvement is achieved.

CN119091961BActive Publication Date: 2025-03-18WENS FOODSTUFF GROUP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411012439.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2025-03-18
Estimated Expiration
2044-07-26

AI Technical Summary

Technical Problem

In the prior art, genotype filling algorithms for low-deep whole genome sequencing data have performance bottlenecks, especially in the high time and space complexity of forward-backward algorithms. In addition, chromosomal symmetry in diploid species is not fully considered, and continuous product operations in forward algorithms are prone to overflow of floating point numbers.

Method used

The forward-backward algorithm of the hidden Markov model is adopted, combined with the EM algorithm, and the forward-backward algorithm of the Markov chain is optimized to reduce the computational volume and memory space requirements. Considering the chromosomal symmetry of diploid species, only the lower triangle part of the matrix is ​​stored and calculated, and the exponential part of the floating point number is normalized through bit operations and integer operations.

Benefits of technology

It realizes fast and accurate filling of low-deep whole genome sequencing data, reduces the computing volume and memory space requirements, avoids floating-point overflow, and improves the computational performance of genotype filling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119091961B_ABST
    Figure CN119091961B_ABST
Patent Text Reader

Abstract

The present application discloses a method for calculating genotype filling of low-depth whole genome sequencing data, by obtaining a diploid low-depth sequencing sample to be filled; according to the preset number of ancestral haploids and the number of grids, a hidden Markov model is established by using the forward-backward algorithm of the hidden Markov model; according to the hidden Markov model, the sequencing sample to be filled is filled, that is, the genotype at the missing site in the sample to be filled is inferred. In the embodiment of the present application, the Markov chain forward-backward algorithm in the diploid low-depth population genotype filling algorithm is optimized, so as to quickly and accurately fill the sequencing gene sequence to be filled, so as to reduce the amount of calculation and the demand for running memory space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of gene sequencing technology, and in particular relates to a genotype filling calculation method for low-depth whole genome sequencing data. Background Art

[0002] Large-scale population low-depth whole-genome sequencing data is a common data type in population genetics research and has accumulated a huge amount of data. Therefore, it is of great significance for this type of analysis and mining.

[0003] The drawback of low-depth sequencing samples is that many sites are not covered by the sequencing samples; these uncovered sites are called missing sites of the sample, and their base values ​​are unknown, so the genotypes of these sites cannot be directly determined. Based on a large number of low-depth sequencing samples and based on statistical principles, it is an important task to infer the genotypes of the missing sites in the sample, which is called genotype filling.

[0004] In 2017, Robert W. Davies et al. proposed the STITCH algorithm for the task of filling genotypes in diploid species. It is a classic algorithm for performing population genotype filling tasks. This method establishes a hidden Markov model and then implements genotype filling based on the hidden Markov model.

[0005] The algorithm presets the number of ancestral haploids K and the number of grids T; the chromosome of the sequencing sample and the gene loci of the sequencing sample to be filled are divided into continuous segments, each of which is called a grid. The grid is used as the step of the hidden Markov model, and T is the length of the Markov chain; K 2 As the number of states in each step of the hidden Markov model. For each sequencing in this paper, according to the central site of the sequencing, it is assigned to a grid as the observation result of the hidden Markov model in this step. The algorithm iteratively updates the internal parameters of the hidden Markov model such as the transfer matrix, emission matrix and initial probability matrix through the EM algorithm, and uses its stable value as the established Markov model.

[0006] The E step of the EM algorithm is where the main computational load is located. This step is implemented using the forward-backward algorithm of the hidden Markov model. The forward algorithm is expressed as The backward algorithm is Here α t , β t are the forward auxiliary variables and the backward auxiliary variables, A t is the transfer matrix, A t T Yes A t The transpose of t It is a diagonal matrix calculated from the emission matrix and the observation results.

[0007] The time complexity of the forward-backward algorithm is TK 2 ; Forward auxiliary variable α t and backward auxiliary variable β t All need to be cached, so the space complexity is also TK 2 The forward-backward algorithm is the performance bottleneck of the overall algorithm in terms of both time and space.

[0008] Another patent CN113742070A proposes an improved implementation scheme of the forward-backward algorithm which reduces the space complexity in exchange for more computation.

[0009] Note that diploid species have two sets of chromosomes, one from the father and one from the mother, which cannot be distinguished during sequencing. This symmetry should be reflected in the hidden Markov model; currently there is no algorithm improvement that takes this symmetry into account. On the other hand, there are continuous product operations in the forward algorithm, which can easily lead to floating point overflow when the number of grids T is large. Summary of the invention

[0010] The present invention aims to provide a method and device for calculating genotype filling of low-depth whole genome sequencing data to solve the deficiencies in the prior art. The technical problem to be solved by the present invention is achieved through the following technical solutions.

[0011] In a first aspect, an embodiment of the present invention provides a method for calculating genotype filling of low-depth whole genome sequencing data, the method comprising:

[0012] Obtain a batch of sequencing samples to be filled;

[0013] According to the preset ancestral haploid number and grid number, the forward-backward algorithm of the hidden Markov model is used to establish the hidden Markov model;

[0014] The sequencing samples to be filled are filled according to the hidden Markov model, and the genotypes at the sample missing sites in the sequencing samples to be filled are determined.

[0015] Optionally, the method of establishing a hidden Markov model by using a forward-backward algorithm of a hidden Markov model according to the preset number of ancestral haploids and the number of grids includes:

[0016] According to the number of grids, the sequencing sample to be filled is split, and the chromosomes of the sequencing sample are divided into grids;

[0017] The step of using the grid as a hidden Markov model;

[0018] Assign storage variables to the transfer matrix, emission matrix and initial probability of the Markov model, and set initial values;

[0019] Using the EM algorithm, the iterative stable values ​​of the transfer matrix, the emission matrix and the initial probability are calculated;

[0020] According to the number of states of the hidden Markov model, the forward-backward algorithm of the hidden Markov model is adopted to implement the E step of the EM algorithm.

[0021] Optionally, the step E of the EM algorithm is implemented by using a forward-backward algorithm of the hidden Markov model according to the number of states of the hidden Markov model, including:

[0022] Sort the elements on the diagonal of each matrix, store the main diagonal elements first, then store the secondary diagonal elements, and create an index for each row and column of each matrix to obtain a row and column index name and a storage location, wherein the storage location includes at least a row index and a column index;

[0023] According to the row index and the column index, a grid state probability matrix, a forward probability matrix and a backward probability matrix are obtained.

[0024] Optionally, the method further comprises:

[0025] Summing the elements on the diagonal of the grid state probability matrix, the forward probability matrix, and the backward probability matrix to obtain the first element sum;

[0026] Summing other elements of the grid state probability matrix, the forward probability matrix, and the backward probability matrix to obtain a second element sum;

[0027] According to the first element sum and the second element sum, a third element sum is obtained.

[0028] Optionally, the method further comprises:

[0029] When calculating the forward probability matrix, bit operations and integer operations are used to normalize the exponential part of the floating point number.

[0030] In a second aspect, an embodiment of the present invention provides a genotype filling calculation device for low-depth whole genome sequencing data, the device comprising:

[0031] An acquisition module, used to acquire diploid low-depth sequencing samples to be filled;

[0032] A calculation module is used to establish a hidden Markov model using a forward-backward algorithm of the hidden Markov model according to a preset number of ancestral haploids and a number of grids;

[0033] The filling module is used to fill the sequencing samples to be filled according to the hidden Markov model, and determine the genotypes at the sample missing sites in the sequencing samples to be filled.

[0034] Optionally, the calculation module is used to:

[0035] According to the number of grids, the sequencing sample to be filled is split, and the chromosomes of the sequencing sample are divided into grids;

[0036] The step of using the grid as a hidden Markov model;

[0037] Assign storage variables to the transfer matrix, emission matrix and initial probability of the Markov model, and set initial values;

[0038] Using the EM algorithm, the iterative stable values ​​of the transfer matrix, the emission matrix and the initial probability are calculated;

[0039] According to the number of states of the hidden Markov model, the forward-backward algorithm of the hidden Markov model is adopted to implement the E step of the EM algorithm.

[0040] Optionally, the computing module is used to:

[0041] Sort the elements on the diagonal of each matrix, store the main diagonal elements first, then store the secondary diagonal elements, and create an index for each row and column of each matrix to obtain a row and column index name and a storage location, wherein the storage location includes at least a row index and a column index;

[0042] According to the row index and the column index, a grid state probability matrix, a forward probability matrix and a backward probability matrix are obtained.

[0043] Optionally, the calculation module is used to:

[0044] Summing the elements on the diagonal of the grid state probability matrix, the forward probability matrix, and the backward probability matrix to obtain the first element sum;

[0045] Summing other elements of the grid state probability matrix, the forward probability matrix, and the backward probability matrix to obtain a second element sum;

[0046] According to the first element sum and the second element sum, a third element sum is obtained.

[0047] Optionally, the calculation module is used to:

[0048] When calculating the forward probability matrix, bit operations and integer operations are used to normalize the exponential part of the floating point number.

[0049] In a third aspect, an embodiment of the present invention provides a terminal device, including: at least one processor and a memory;

[0050] The memory stores a computer program; the at least one processor executes the computer program stored in the memory to implement the genotype filling calculation method for low-depth whole genome sequencing data provided in the first aspect.

[0051] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored therein, which, when executed, implements the genotype filling calculation method for low-depth whole genome sequencing data provided in the first aspect.

[0052] The embodiments of the present invention include the following advantages:

[0053] The genotype filling calculation method, device, terminal device and medium of low-depth whole genome sequencing data provided by the embodiment of the present invention obtains a diploid low-depth sequencing sample to be filled; according to the preset number of ancestral haploids and the number of grids, a hidden Markov model is established by using the forward-backward algorithm of the hidden Markov model; according to the hidden Markov model, the sequencing sample to be filled is filled, and the genotype at the sample missing site in the sequencing sample to be filled is determined, that is, the genotype at the missing site in the sample to be filled is inferred. In the embodiment of the present application, the Markov chain forward-backward algorithm in the diploid low-depth population genotype filling algorithm is optimized, so as to quickly and accurately fill the sequencing gene sequence to be filled, so as to reduce the amount of calculation and the demand for running memory space. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the embodiments of the present application or the existing technical solutions, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0055] Figure 1 A flowchart of a method for calculating genotype filling of low-depth whole genome sequencing data provided in an embodiment of the present application;

[0056] Figure 2 A flowchart of another method for calculating genotype filling of low-depth whole genome sequencing data provided in an embodiment of the present application;

[0057] Figure 3 A schematic diagram of the storage order of the lower triangular matrix elements provided in an embodiment of the present application;

[0058] Figure 4A schematic diagram of an index from column elements to a serialized storage order provided in an embodiment of the present application;

[0059] Figure 5 A schematic diagram of row and column indexes of serialized ordinals provided in an embodiment of the present application;

[0060] Figure 6 A schematic diagram of the IEEE floating point format provided for an embodiment of the present application;

[0061] Figure 7 A structural block diagram of an embodiment of a genotype filling calculation device for low-depth whole genome sequencing data provided in an embodiment of the present application;

[0062] Figure 8 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0064] An embodiment of the present invention provides a genotype filling calculation method for low-depth whole genome sequencing data, which is used to fill the sequenced gene sequence. The execution subject of this embodiment is a genotype filling calculation device for low-depth whole genome sequencing data, which is set on a terminal device, for example, the terminal device at least includes a computer terminal, etc.

[0065] Reference Figure 1 , shows a flowchart of a method for calculating genotype filling of low-depth whole genome sequencing data according to an embodiment of the present invention, which method may specifically include the following steps:

[0066] S101, obtaining a diploid low-depth sequencing sample to be filled;

[0067] The terminal device obtains a batch of diploid low-depth sequencing samples to be filled from the population, each sample containing many sequencing sequences from individuals of the species.

[0068] S102, establishing a hidden Markov model using a forward-backward algorithm of the hidden Markov model according to the preset ancestor haploid number K and the grid number T;

[0069] S103. Filling the sequencing samples to be filled according to the hidden Markov model, that is, inferring the genotypes at the sample missing sites in the sequencing samples to be filled.

[0070] Specifically, Figure 2 As shown, the terminal device obtains the diploid low-depth sequencing sample to be filled, that is, reads the SNP site file input and the sample file input, and extracts the sample SNP information.

[0071] The EM algorithm Markov model parameters were calculated based on preset parameters such as the number of ancestral haploids and the number of grids.

[0072] In the E step of the EM algorithm, the forward-backward algorithm of the hidden Markov model is applied.

[0073] The genotype of the sample is calculated based on the hidden Markov model parameters, and the filled target sequencing gene sequence is obtained by outputting the vcf file.

[0074] The genotype filling calculation method of low-depth whole genome sequencing data provided by the embodiment of the present invention is to obtain a diploid low-depth sequencing sample to be filled; according to the preset number of ancestral haploids and the number of grids, a hidden Markov model is established by using the forward-backward algorithm of the hidden Markov model; according to the hidden Markov model, the sequencing sample to be filled is filled, and the genotype at the sample missing site in the sequencing sample to be filled is determined, that is, the genotype at the missing site in the sample to be filled is inferred. In the embodiment of the present application, the Markov chain forward-backward algorithm in the diploid low-depth population genotype filling algorithm is optimized, so as to quickly and accurately fill the sequencing gene sequence to be filled, so as to reduce the amount of calculation and the running memory space requirements.

[0075] Another embodiment of the present invention further supplements the genotype filling calculation method for low-depth whole genome sequencing data provided in the above embodiment.

[0076] Optionally, according to the preset ancestor haploid number and grid number, a forward-backward algorithm of a hidden Markov model is used to establish a hidden Markov model, including:

[0077] According to the number of grids, the sequencing sample to be filled is split, and the chromosomes of the sequencing sample are divided into grids;

[0078] The step of using the grid as a hidden Markov model;

[0079] Assign storage variables to the transfer matrix, emission matrix and initial probability of the Markov model, and set initial values;

[0080] Using the EM algorithm, the iterative stable values ​​of the transfer matrix, the emission matrix and the initial probability are calculated;

[0081] According to the number of states of the hidden Markov model, the forward-backward algorithm of the hidden Markov model is adopted to implement the E step of the EM algorithm.

[0082] Specifically, according to the number of grids, the gene loci of the sequencing sample to be filled are divided into continuous segments, each continuous segment is called a grid;

[0083] The grid is regarded as the steps of the hidden Markov model, T is the length of the Markov chain; K 2 As the number of states at each step of the hidden Markov model;

[0084] Allocate storage space for the transfer matrix, emission matrix and initial probability matrix of the hidden Markov model, and set initial values;

[0085] Using the EM algorithm, the iterative stable values ​​of the transfer matrix, the emission matrix and the initial probability matrix are calculated as the established hidden Markov model;

[0086] According to the hidden Markov model, the forward-backward algorithm of the hidden Markov model is adopted to implement the E step of the EM algorithm.

[0087] Specifically, the terminal device divides the chromosome sequence into grids, each grid is a step in the hidden Markov model, and the total number of grids is the length of the Markov model. A state value is assigned to each chromosome at each grid; the number of state values ​​is recorded as K, which is a constant in each model; each state is called an ancestral haplotype. Since the diploid contains two sets of chromosomes, the number of states for each step in the hidden Markov model is K 2 . Take the middle point of each sequencing in the sample, and the middle point of the sequencing must belong to a certain grid, so the sequencing is associated with the grid. For a grid, take all the sequencing associated with it to form the observation result of the grid; the observation results of all grids constitute the observation sequence of the hidden Markov model.

[0088] The Markov model is t ,B t ,π>, where A t , B t and π are the transition probability, emission probability and initial probability respectively; the subscript t indicates the step of the Markov chain. Let the forward probability vector α t ; Grid state probability vector z t ρ t is the observed quantity o t By transmitting the matrix B t In the grid state z t The projection on . Then the forward algorithm is expressed as The backward algorithm is where π is a column matrix, A​t is a matrix, A t T Yes A t The transposed matrix, ρ t is a diagonal matrix.

[0089] For diploid samples, in the forward-backward algorithm, the state value y at each step can be written as an integer pair<i,j> , where y = iK + j;<i,j> Indicates that the base sequences of the two chromosomes in the sample near the grid corresponding to this step come from the ancestral haploids i and j respectively; thus the grid state probability vector z t can be rearranged into a K×K matrix, A t Rearrange into a K×K×K×K matrix, v t The diagonal elements of are also rearranged into a K×K matrix.

[0090] In the embodiment of the present application, A is set t is sparse, A t By the value σ and the vector R t Description, σ represents the probability that the grid state remains unchanged relative to the previous step. The vector R t The length of is K, which means that when the grid state changes, the probability of the grid state changing to each state, this probability is only related to the state after the change, and has nothing to do with the state before the change. In this way, the component formula of the transfer matrix acting on the vector is written as:

[0091] A t [i,j,i′,j′]=

[0092] σ 2 δ(ii′)δ(jj′)+σ(1-σ)T[i]δ(jj′)+σ(1-σ)T[j]δ(ii′)

[0093] +(1-σ) 2 T[i]T[j]

[0094] y=A t (x)→y[i,j]=σ 2 x[i,j]+σ(1-σ)(d[i]+d[j])+(1-σ) 2 T[i]T[j]

[0095] y=A t T (x)→y[i,j]=σ 2 x[i,j]+σ(1-σ)(c[i]+c[j])+(1-σ) 2 e

[0096] Among them: d[i]=T[i]∑k x[i,k],d[j]=T[j]∑ k x[k,j],c[i]=∑ k T[k]x[i,k],c[j]=∑ k T[k]x[k,j],e=∑ kl T[l]T[k]x[l,k].

[0097] The forward-backward algorithm is the part that consumes the most memory and computation in the entire operation process. Optimizing the forward-backward algorithm can effectively improve the performance of the genotype filling operation.

[0098] The present application embodiment notes that the state of the state Markov model<i,j> and<i,j> Symmetrical; this symmetry is biologically significant, that is, during sequencing, it is impossible to distinguish whether the sequence comes from the father or the mother, that is, it is impossible to distinguish the state through observation<i,j> and<i,j> . In this way, the whole system is about<i,j> Symmetric; that is, the matrix representations of a series of quantities such as state vector, observation projection, transfer matrix, forward probability, backward probability, etc., all have the symmetry of index exchange;

[0099] That is, the grid state probability vector z t [i,j]=z t [j,i], observation projection vector ρ t [i,j]=ρ t [j,i], probability transfer matrix A t [i,j,i′,j′]=A t [j,i,j′,i′], forward auxiliary variable α t [i,j]=α t [j,i], backward auxiliary variable β t [i,j]=β t [j,i].

[0100] Thus, in the embodiment of the present application, the cache forward probability α t Only its independent elements are stored, that is, only the lower triangular part of the matrix is ​​stored. The embodiment of the present application arranges TK(K+1) / 2 floating point memory spaces to cache all forward probabilities α t ,When K is relatively large, it saves nearly half of the memory space compared to the existing technology.

[0101] Optionally, the forward-backward algorithm of the hidden Markov model is used according to the number of states of the hidden Markov model to implement the E step of the EM algorithm, including: storing the lower triangular part of the matrix according to the diagonal order, that is, first storing the main diagonal elements, and then storing the secondary diagonal elements ( Figure 3 );Remember α *It is used to cache all forward probabilities α t Auxiliary matrix, storage method described as α * [t,p]=α t [i,j] where p=(2n-(ij)+1)(ij) / 2+j, i∈[0,K), j∈[0,i].

[0102] The advantage of sorting by diagonal is that it is easier to calculate the sum of matrix elements. When calculating the sum of matrices, the diagonal elements<i,i> Calculated once, and the other elements<i,j> Calculate twice. When sorting by diagonal, all diagonal elements are arranged together, so they can be calculated separately.

[0103] When storing the independent elements of a symmetric matrix in serial form, the continuity of the rows and columns of the matrix will be destroyed, that is, the elements in the same column will no longer be stored continuously, and the elements in the same row will no longer be indexed by an arithmetic progression. In order to minimize the resulting CPU efficiency loss,

[0104] Create a matrix of size K 2 The index matrix P, where P[i,j] = (2n-(ij)+1)(ij) / 2+j( Figure 4 ). Create index matrices X and Y of size K(K+1) / 2, where X[P[i,j]]=i, Y[P[i,j]]=j; this facilitates access to elements by row or column in the compressed storage space through instruction-level parallel instructions ( Figure 5 ).

[0105] Use indexes and 8 built-in instruction-level parallel statements provided by INTEL for its CPU:

[0106] _mm256_i 32gather_pd,

[0107] _mm256_i 32scatter_pd,

[0108] _mm256_mask_i 32gather_pd,

[0109] _mm256_mask_i 32scatter_pd,

[0110] _mm512_i 32gather_pd,

[0111] _mm512_i 32scatter_pd,

[0112] _mm512_mask_i 32gather_pd,

[0113] _mm512_mask_i 32scatter_pd

[0114] Matrix can be accessed efficiently row and column by row.

[0115] Optionally, the method further comprises:

[0116] Note that when the Markov model has more steps, The value of may overflow. Depending on the floating point format of the computer, such as Figure 6 shown.

[0117] In the case of calculating the forward probability matrix, bit operations and integer operations are used to normalize the exponential part of the floating point number.

[0118] When implementing the E step of the EM algorithm using the forward-backward algorithm of the hidden Markov model, since multiple steps of continuous operation may cause floating-point overflow, the floating-point numbers need to be normalized, including:

[0119] Let V be the vector to be normalized, and the element v in V is a non-negative floating point number;

[0120] According to the floating point format, extract the exponent part of v and find the largest exponent m;

[0121] Determine and record the offset. For double-precision floating point numbers, the offset is w = x-1024. For single-precision floating point numbers, the offset is w = x-128.

[0122] For each element v in V, if the exponent of v is greater than the offset w, then subtract the offset; if the exponent of v is less than w, then set it to 0, thus obtaining the normalized value v * ;

[0123] When the original vector element v is needed, (2^w)v * calculate.

[0124] The embodiment of the present application is a program with a command line interface that executes the task of filling genotypes of a diploid low-depth sequencing population.

[0125] Test environment:

[0126] hardware: CPU E5-2678v3@2.50GHz

[0127] Software: CentOS Linux release 7.6.1810 / g++ (Red Hat 4.8.5-44).

[0128] The normalization strategy adopted in the embodiment of the present application is: only the exponent part of the floating point number is normalized.

[0129] 1) Extract the exponent of the floating point number through bit operation

[0130] 2) Find the exponent x with the largest exponent

[0131] 3) Subtract the offset w=x-1024 from all exponents and store the offset w.

[0132] 4) If the exponent is less than 0 after the subtraction, the entire floating-point number is set to 0; otherwise, the new exponent replaces the original exponent.

[0133] 5) In this way, record the normalized α t for but

[0134] The embodiment of the present application uses bit operations and integer operations instead of floating-point operations, thereby improving operation efficiency and avoiding rounding errors.

[0135] In the embodiment of the present application, according to the symmetry of the Markov model, only the lower triangular part of the matrix is ​​stored and calculated to save space and calculation; the serialized lower triangular matrix is ​​indexed, and the matrix elements are accessed in combination with the instruction set parallel computing primitives provided by the CPU to reduce the adverse effects of discontinuous element storage on operating efficiency. In the case of normalization to avoid overflow of floating-point vectors, a method of normalizing only the exponential part is adopted to improve the operation efficiency and avoid rounding errors, reduce 35% of memory usage, and increase the running speed by 15%.

[0136] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0137] The genotype filling calculation method of low-depth whole genome sequencing data provided by the embodiment of the present invention is to obtain a diploid low-depth sequencing sample to be filled; according to the preset number of ancestral haploids and the number of grids, a hidden Markov model is established by using the forward-backward algorithm of the hidden Markov model; according to the hidden Markov model, the sequencing sample to be filled is filled, and the genotype at the sample missing site in the sequencing sample to be filled is determined, that is, the genotype at the missing site in the sample to be filled is inferred. In the embodiment of the present application, the Markov chain forward-backward algorithm in the diploid low-depth population genotype filling algorithm is optimized, so as to quickly and accurately fill the sequencing gene sequence to be filled, so as to reduce the amount of calculation and the running memory space requirements.

[0138] Another embodiment of the present invention provides a genotype filling calculation device for low-depth whole genome sequencing data, which is used to execute the genotype filling calculation method for low-depth whole genome sequencing data provided by the above embodiment.

[0139] Reference Figure 7 , shows a structural block diagram of an embodiment of a genotype filling calculation device for low-depth whole genome sequencing data of the present invention, the device may specifically include the following modules: an acquisition module 701, a calculation module 702 and a filling module 703, wherein:

[0140] The acquisition module 701 is used to obtain diploid low-depth sequencing samples to be filled;

[0141] The calculation module 702 is used to establish a hidden Markov model using a forward-backward algorithm of the hidden Markov model according to the preset number of ancestral haploids and the number of grids;

[0142] The filling module 703 is used to fill the sequencing samples to be filled according to the hidden Markov model, and determine the genotypes at the sample missing sites in the sequencing samples to be filled.

[0143] The genotype filling calculation device for low-depth whole genome sequencing data provided by the embodiment of the present invention obtains a diploid low-depth sequencing sample to be filled; according to the preset number of ancestral haploids and the number of grids, a hidden Markov model is established by using the forward-backward algorithm of the hidden Markov model; according to the hidden Markov model, the sequencing sample to be filled is filled, and the genotype at the sample missing site in the sequencing sample to be filled is determined, that is, the genotype at the missing site in the sample to be filled is inferred. In the embodiment of the present application, the Markov chain forward-backward algorithm in the diploid low-depth population genotype filling algorithm is optimized, so as to quickly and accurately fill the sequencing gene sequence to be filled, so as to reduce the amount of calculation and the running memory space requirements.

[0144] Yet another embodiment of the present invention further supplements the genotype filling calculation device for low-depth whole genome sequencing data provided in the above embodiment.

[0145] Optionally, the computing module is used to:

[0146] According to the number of grids, the sequencing sample to be filled is split, and the chromosomes of the sequencing sample are divided into grids;

[0147] The step of using the grid as a hidden Markov model;

[0148] Assign storage variables to the transfer matrix, emission matrix and initial probability of the Markov model, and set initial values;

[0149] Using the EM algorithm, the iterative stable values ​​of the transfer matrix, the emission matrix and the initial probability are calculated;

[0150] According to the number of states of the hidden Markov model, the forward-backward algorithm of the hidden Markov model is adopted to implement the E step of the EM algorithm.

[0151] Optionally, the computing module is used to:

[0152] Sort the elements on the diagonal of each matrix, store the main diagonal elements first, then store the secondary diagonal elements, and create an index for each row and column of each matrix to obtain a row and column index name and a storage location, wherein the storage location includes at least a row index and a column index;

[0153] According to the row index and the column index, a grid state probability matrix, a forward probability matrix and a backward probability matrix are obtained.

[0154] Optionally, the computing module is used to:

[0155] Summing the elements on the diagonal of the grid state probability matrix, the forward probability matrix, and the backward probability matrix to obtain the first element sum;

[0156] Summing other elements of the grid state probability matrix, the forward probability matrix, and the backward probability matrix to obtain a second element sum;

[0157] According to the first element sum and the second element sum, a third element sum is obtained.

[0158] Optionally, the computing module is used to:

[0159] In the case of calculating the forward probability matrix, bit operations and integer operations are used to normalize the exponential part of the floating point number.

[0160] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0161] The genotype filling calculation device for low-depth whole genome sequencing data provided by the embodiment of the present invention obtains a diploid low-depth sequencing sample to be filled; according to the preset number of ancestral haploids and the number of grids, a hidden Markov model is established by using the forward-backward algorithm of the hidden Markov model; according to the hidden Markov model, the sequencing sample to be filled is filled, and the genotype at the sample missing site in the sequencing sample to be filled is determined, that is, the genotype at the missing site in the sample to be filled is inferred. In the embodiment of the present application, the Markov chain forward-backward algorithm in the diploid low-depth population genotype filling algorithm is optimized, so as to quickly and accurately fill the sequencing gene sequence to be filled, so as to reduce the amount of calculation and the running memory space requirements.

[0162] Yet another embodiment of the present invention provides a terminal device for executing the genotype filling calculation method for low-depth whole genome sequencing data provided in the above embodiment.

[0163] Figure 8 is a schematic diagram of the structure of a terminal device of the present invention, such as Figure 8 As shown, the terminal device includes: at least one processor 801 and a memory 802;

[0164] The memory stores a computer program; and at least one processor executes the computer program stored in the memory to implement the genotype filling calculation method for low-depth whole genome sequencing data provided in the above-mentioned embodiment.

[0165] The terminal device provided in this embodiment obtains a diploid low-depth sequencing sample to be filled; according to the preset number of distant ancestral haploids and the number of grids, a hidden Markov model is established by using the forward-backward algorithm of the hidden Markov model; according to the hidden Markov model, the sequencing sample to be filled is filled, and the genotype at the sample missing site in the sequencing sample to be filled is determined, that is, the genotype at the missing site in the sample to be filled is inferred. In the embodiment of the present application, the Markov chain forward-backward algorithm in the diploid low-depth population genotype filling algorithm is optimized, so as to quickly and accurately fill the sequencing gene sequence to be filled, so as to reduce the amount of calculation and the running memory space requirements.

[0166] Yet another embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed, the genotype filling calculation method for low-depth whole genome sequencing data provided in any of the above embodiments is implemented.

[0167] According to the computer-readable storage medium of the present embodiment, by obtaining a diploid low-depth sequencing sample to be filled; according to the preset number of ancestral haploids and the number of grids, a hidden Markov model is established by using the forward-backward algorithm of the hidden Markov model; according to the hidden Markov model, the sequencing sample to be filled is filled, and the genotype at the sample missing site in the sequencing sample to be filled is determined, that is, the genotype at the missing site in the sample to be filled is inferred. In the embodiment of the present application, the Markov chain forward-backward algorithm in the diploid low-depth population genotype filling algorithm is optimized, so as to quickly and accurately fill the sequencing gene sequence to be filled, so as to reduce the amount of calculation and the running memory space requirements.

[0168] It should be noted that the above detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the art to which the present application belongs.

[0169] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should also be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0170] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.

[0171] In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or inherent to these processes, methods, products, or apparatuses.

[0172] For ease of description, spatially relative terms, such as "above", "above", "on the upper surface of", "above", etc., may be used herein to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" may include both "above" and "below". The device may also be positioned in other different ways, such as rotated 90 degrees or in other orientations, and the spatially relative descriptions used herein are interpreted accordingly.

[0173] In the above detailed description, reference is made to the accompanying drawings, which form a part of this document. In the accompanying drawings, similar symbols typically identify similar components unless the context indicates otherwise. The illustrated embodiments described in the detailed description, drawings, and claims are not meant to be limiting. Other embodiments may be used, and other changes may be made, without departing from the spirit or scope of the subject matter presented herein.

[0174] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for calculating genotype filling of low-depth whole genome sequencing data, characterized in that: The method comprises: Obtain diploid low-depth sequencing samples to be filled; According to the preset ancestral haploid number and grid number, the forward-backward algorithm of the hidden Markov model is used to establish the hidden Markov model; Filling the sequencing sample to be filled according to the hidden Markov model, and determining the genotype at the sample missing site in the sequencing sample to be filled; According to the preset number of ancestral haploids and grid numbers, the forward-backward algorithm of the hidden Markov model is used to establish a hidden Markov model, including: According to the number of grids, the sequencing sample to be filled is split, and the chromosomes of the sequencing sample are divided into grids; The step of using the grid as a hidden Markov model; Assign storage variables to the transfer matrix, emission matrix and initial probability of the Markov model, and set initial values; Using the EM algorithm, the iterative stable values ​​of the transfer matrix, the emission matrix and the initial probability are calculated; According to the number of states of the hidden Markov model, a forward-backward algorithm of the hidden Markov model is used to implement the E step of the EM algorithm; According to the hidden Markov model, the forward-backward algorithm of the hidden Markov model is adopted to implement the E step of the EM algorithm, including: Sort the elements on the diagonal of each matrix, store the main diagonal elements first, then store the secondary diagonal elements, and create an index for each row and column of each matrix to obtain a row and column index name and a storage location, wherein the storage location includes at least a row index and a column index; According to the row index and the column index, a grid state probability matrix, a forward probability matrix and a backward probability matrix are obtained; Summing the elements on the diagonal of the grid state probability matrix, the forward probability matrix, and the backward probability matrix to obtain the first element sum; Summing other elements of the grid state probability matrix, the forward probability matrix, and the backward probability matrix to obtain a second element sum; According to the first element sum and the second element sum, a third element sum is obtained.

2. The method according to claim 1, characterized in that: The method further comprises: When calculating the forward probability matrix, bit operations and integer operations are used to normalize the exponential part of the floating point number.

3. A genotype filling calculation device for low-depth whole genome sequencing data, characterized in that: The device comprises: An acquisition module, used to acquire diploid low-depth sequencing samples to be filled; A calculation module is used to establish a hidden Markov model using a forward-backward algorithm of the hidden Markov model according to a preset number of ancestral haploids and a number of grids; A filling module, used to fill the sequencing sample to be filled according to the hidden Markov model, and determine the genotype at the sample missing site in the sequencing sample to be filled; The calculation module is used for: According to the number of grids, the sequencing sample to be filled is split, and the chromosomes of the sequencing sample are divided into grids; The step of using the grid as a hidden Markov model; Assign storage variables to the transfer matrix, emission matrix and initial probability of the Markov model, and set initial values; Using the EM algorithm, the iterative stable values ​​of the transfer matrix, the emission matrix and the initial probability are calculated; According to the number of states of the hidden Markov model, a forward-backward algorithm of the hidden Markov model is used to implement the E step of the EM algorithm; The computing module is used for: Sort the elements on the diagonal of each matrix, store the main diagonal elements first, then store the secondary diagonal elements, and create an index for each row and column of each matrix to obtain a row and column index name and a storage location, wherein the storage location includes at least a row index and a column index; According to the row index and the column index, a grid state probability matrix, a forward probability matrix and a backward probability matrix are obtained; Summing the elements on the diagonal of the grid state probability matrix, the forward probability matrix, and the backward probability matrix to obtain the first element sum; Summing other elements of the grid state probability matrix, the forward probability matrix, and the backward probability matrix to obtain a second element sum; According to the first element sum and the second element sum, a third element sum is obtained.

4. A terminal device, characterized in that: include: at least one processor and memory; The memory stores a computer program; The at least one processor executes the computer program stored in the memory to implement the genotype filling calculation method for low-depth whole genome sequencing data according to any one of claims 1-2.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed, implements the genotype filling calculation method for low-depth whole genome sequencing data according to any one of claims 1-2.

Citation Information

Patent Citations

  • Low-depth sequencing population genotype filling calculation memory optimization method

    CN113742070A

  • Genotype filling method for yak genome sequencing data

    CN114300043A