A deep learning-based gene sequencing error correction analysis method

CN122531487APending Publication Date: 2026-08-07SHENZHEN BODY CODE GENE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN BODY CODE GENE TECH CO LTD
Filing Date
2026-06-11
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0003]测序读段中碱基错误、插入错误和缺失错误交织分布,碱基质量值在不同测序位置存在显著波动,传统基于固定评分体系的校正方法难以准确反映误差分布特征,导致误差状态判定不稳定以及局部区域校正结果偏差较大;测序读段与参考序列之间的比对过程受复杂结构变异和重复序列影响显著,现有比对方法在插入态和缺失态连续出现时容易产生路径偏移,导致误差状态链断裂或错误扩展,影响后续路径选择的准确性;针对长读长数据中非线性误差累积问题,传统基于动态规划的路径递推方法在状态转移过程中缺乏对连续插入和连续缺失历程的有效约束,容易出现误差扩散现象,降低最优路径的稳定性;在上下文建模方面,现有方法对碱基序列的局部关联关系刻画不足,难以在误差密集区段中维持碱基位置之间的连续结构信息,导致校正结果在区段边界处出现不连续或不一致情况,从而影响整体测序误差校正结果的准确性和可靠性

Benefits of technology

[0068](1)本发明通过在候选区段内识别插入区段和缺失区段并计算插入跨度和缺失跨度,结合匹配连续关系构建转移路径图,针对连续插入态和连续缺失态引起的路径偏移问题,实现状态转移关系的结构化约束,提升转移路径图对复杂误差结构的表达能力;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122531487A_ABST
    Figure CN122531487A_ABST
Patent Text Reader

Abstract

The application discloses a kind of gene sequencing error correction analysis methods based on deep learning, comprising the following steps: S1, obtain sequencing reads and reference sequence, extract base quality value;S2, construct initial error state chain structure, generate error state chain;S3, construct transition path diagram;S4, error state chain is input into improved Mistral model, introduce base context guide stabilization mechanism, generate state energy field;S5, state path recursion is executed using Viterbi algorithm introducing insertion and deletion process suppression mechanism, generate optimal state path;S6, execute base correction, generate correction reads;S7, correction reads are mapped to reference sequence, generate sequencing error correction result.The application realizes the stable determination and path consistency constraint of matching state, insertion state and deletion state in sequencing reads, improves sequencing error correction precision and result reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of bioinformatics and gene sequencing data processing technology, and in particular to a gene sequencing error correction analysis method based on deep learning. Background Technology

[0002] With the rapid development of high-throughput sequencing technology, the demand for fine-grained analysis and variant identification of genomic data is constantly increasing, and key technologies surrounding sequencing read error correction and sequence consistency analysis have received widespread attention. Existing gene sequencing error correction methods mainly rely on alignment-based heuristic strategies or simple statistical models to correct sequencing reads, but they generally suffer from the following problems in practical applications:

[0003] In sequencing reads, base errors, insertion errors, and deletion errors are intertwined, and base quality values ​​fluctuate significantly at different sequencing positions. Traditional correction methods based on fixed scoring systems struggle to accurately reflect the error distribution characteristics, leading to unstable error state determination and large deviations in local region correction results. The alignment process between sequencing reads and reference sequences is significantly affected by complex structural variations and repetitive sequences. Existing alignment methods are prone to path shifts when insertion and deletion states occur consecutively, resulting in broken error state chains or error propagation, affecting the accuracy of subsequent path selection. For the nonlinear error accumulation problem in long-read data, traditional path recursion methods based on dynamic programming lack effective constraints on consecutive insertion and deletion processes during state transitions, easily leading to error diffusion and reducing the stability of the optimal path. In terms of context modeling, existing methods are insufficient in characterizing the local correlations of base sequences, making it difficult to maintain continuous structural information between base positions in error-dense regions. This results in discontinuities or inconsistencies in correction results at region boundaries, thus affecting the accuracy and reliability of overall sequencing error correction results.

[0004] Therefore, how to provide a deep learning-based gene sequencing error correction analysis method is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] One objective of this invention is to propose a deep learning-based gene sequencing error correction analysis method. This invention utilizes an error state chain construction method, a transition path graph construction method, an improved Mistral model, and the Viterbi algorithm with an insertion / deletion process suppression mechanism to jointly model the base sequence and base quality value in the sequencing read. Combined with the reference sequence, it completes candidate segment determination, error state labeling, state energy field generation, and optimal state path solution. It realizes insertion state deletion processing, missing state completion processing, and matching state retention processing of the base sequence, generates corrected reads, and completes sequence alignment with the reference sequence. It has the advantages of high stability of error state determination, strong consistency of path recursion, and high sequencing error correction accuracy.

[0006] A gene sequencing error correction analysis method based on deep learning according to an embodiment of the present invention includes the following steps:

[0007] S1. Obtain sequencing reads and reference sequences, and extract base sequences and corresponding base quality values ​​from the sequencing reads;

[0008] S2. Based on the base sequence, base quality value, and reference sequence, candidate segments are determined, an initial error state chain structure is constructed, and the base positions are calibrated according to the base quality value and the matching continuity of adjacent bases in the reference sequence to generate the error state chain; the error state chain includes matching state, insertion state, and deletion state;

[0009] S3. Based on the error state chain, identify continuous unmatched base segments and reference missing segments within the candidate segments, determine the insertion span and the missing span respectively, and generate a transfer cost map based on the matching continuity relationship, insertion span and missing span to obtain a transfer path map;

[0010] S4. Input the error state chain into the improved Mistral model, introduce a base convolution stabilization mechanism in the attention calculation module, perform context modeling on the continuous base segments in the error state chain composed of continuous positions of the same error state, and generate a state energy field.

[0011] S5. Based on the state energy field and transition path graph, the Viterbi algorithm with a missing insertion process suppression mechanism is used to perform state path recursion, record the continuous process length of the inserted and missing states, perform recursion correction, and generate the optimal state path.

[0012] S6. Perform base correction on the base sequence according to the optimal state path. The matching state retains the original bases, the insertion state is deleted, and the missing state is filled in to generate a corrected read segment.

[0013] S7. Map the corrected read to the reference sequence to generate sequencing error correction results.

[0014] Optionally, S1 specifically includes:

[0015] Obtain sequencing reads and reference sequences; parse read identifiers, base characters, and quality characters from sequencing reads;

[0016] Arrange the base characters according to their position order to obtain the base sequence, and convert the quality characters according to the one-to-one correspondence with the base positions to obtain the base quality value;

[0017] By associating the base sequence, base quality value, and reference sequence, the base sequence and base quality value corresponding to the sequencing read are obtained.

[0018] Optionally, the step of determining candidate segments based on base sequence, base quality value, and reference sequence, and constructing an initial error state chain structure, specifically involves:

[0019] The base sequence is sequentially compared with the reference sequence to determine the alignment start and alignment end positions of the base sequence in the reference sequence;

[0020] Candidate segments are obtained by truncating the corresponding intervals in the reference sequence based on the alignment start and alignment end positions;

[0021] Within the candidate region, the base sequence is compared position by position with the corresponding bases in the reference sequence, and the matching and non-matching relationships are recorded.

[0022] The positions of bases in the sequence that are present but do not have a matching base in the reference sequence are denoted as insertion states; the positions of bases in the reference sequence that are present but do not have a matching base in the sequence are denoted as deletion states; and the positions of bases in the sequence that are matched with the corresponding positions in the reference sequence are denoted as matching states.

[0023] Connect the matched, inserted, and deleted states according to their base positions to generate the initial error state chain structure.

[0024] Optionally, the step of performing state calibration on the base position based on the base quality value and the matching continuity of adjacent bases in the reference sequence to generate an error state chain specifically involves:

[0025] Read the base quality value corresponding to each base position in the initial error state chain structure, and the matching position of adjacent base positions in the reference sequence;

[0026] By comparing the differences in matching positions of adjacent bases in the reference sequence, the continuity of the matching can be determined.

[0027] Base positions whose base quality values ​​meet predetermined quality conditions and whose matching positions continuously increase are labeled as matched states; base positions that are consecutive in the base sequence but do not form corresponding matching positions in the reference sequence are labeled as inserted states; and base positions that are consecutive in the reference sequence but do not form corresponding matching positions are labeled as deleted states.

[0028] Write the calibrated matched, inserted, and missing states in order of base position to generate an error state chain.

[0029] Optionally, the step of constructing a transition path graph based on the error state chain, identifying consecutive unmatched base segments and reference missing segments within the candidate segment, and determining the insertion span and missing span respectively, specifically involves:

[0030] Scan the matched, inserted, and deleted states sequentially along the base positions of the error state chain;

[0031] During the scanning process, base positions in the base position sequence that are both marked as insertion states are grouped into insertion segments, and the start and end base positions of the insertion segments are recorded. The base position difference is calculated based on the start and end base positions of the insertion segments to obtain the insertion span.

[0032] During the scanning process, reference sequence positions in the base position sequence where adjacent positions are all marked as deletion states are grouped into deletion segments, and the start and end reference positions of the deletion segments are recorded; the reference position difference is calculated based on the start and end reference positions of the deletion segments to obtain the deletion span;

[0033] The inserted segment, missing segment, insertion span, and missing span are written into the base position markers corresponding to the error state chain.

[0034] Optionally, the step of generating a transition cost graph based on the matching continuity, insertion span, and missing span to obtain a transition path graph specifically involves:

[0035] Read the state category, matching continuity, insertion span, and deletion span corresponding to adjacent base positions in the error state chain;

[0036] Establish state transition relationships between state changes of adjacent positions in the base position sequence;

[0037] In a base position sequence, when all adjacent positions are marked as matching, the transfer cost corresponding to the matching continuity is written; when at least one of the adjacent positions is marked as insertion, the transfer cost corresponding to the insertion span is written; when at least one of the adjacent positions is marked as deletion, the transfer cost corresponding to the deletion span is written.

[0038] The state transition relationships written into the transfer cost are connected in order of base position to form a transfer cost graph;

[0039] By associating the transfer cost map with the corresponding base positions in the error state chain, a transfer path map is generated.

[0040] Optionally, the improved Mistral model specifically includes a state encoding module, a position injection module, an attention calculation module, and an energy output module;

[0041] The state encoding module arranges the matched, inserted, and missing states in the error state chain in order of base position, and writes the base characters, base quality values, and state categories in the error state chain into the same base position to form a state representation.

[0042] The position injection module sequentially writes the start reference position, end reference position and base position in the candidate segment into the corresponding base position in the state representation. At each base position in the state representation, a combination of base character, base quality value, state category and position identifier is formed to obtain the position representation.

[0043] The attention calculation module constructs query vectors, bond vectors, and value vectors from the base positions in the position representation, and arranges the base positions in the position representation according to a sliding window.

[0044] A base network stabilization mechanism is introduced in the attention calculation module. This mechanism groups base positions with the same state category and adjacent base position differences of 1 in the error state chain into continuous base segments, and records the start position, end position, and segment length of the continuous base segments. The base positions within the continuous base segments are written into the adjacent position association sequence according to the base position order, and the order relationship of the base positions within the segment is written into the adjacent position association sequence. The start position of the continuous base segment is connected to the base position preceding the start position, and the end position of the continuous base segment is connected to the base position following the end position, and the cross-segment connection relationship is written into the adjacent position association sequence. The association relationship of the base positions within the segment is written into the corresponding position of the query vector and the key vector, and the cross-segment connection relationship is written into the boundary position of the query vector and the key vector.

[0045] The attention calculation module performs positional expansion on the contextual relationship of corresponding base positions in the value vector based on the association between the query vector and the key vector, thereby obtaining a contextual representation;

[0046] The energy output module maps the context representation to the corresponding state positions of the matched, inserted, and deleted states in order of base position, generating a state energy field.

[0047] Optionally, S5 specifically includes:

[0048] Arrange the state positions corresponding to the matched, inserted, and missing states in the state energy field according to the base position order, and write the state transition relationship between adjacent base positions in the transition path diagram between adjacent base positions accordingly.

[0049] Write the matching, insertion, and deletion states at the starting base position into the initial path value;

[0050] Following the order of base positions, the path value in the previous base position, the state energy value corresponding to the next base position, and the transfer cost value between the previous base position and the next base position are combined item by item and written into the candidate path values ​​corresponding to the matching state, insertion state and deletion state in the next base position.

[0051] When introducing the insertion suppression mechanism, for state transition relationships where both the preceding and following base positions correspond to insertion states, the insertion state process length is written into the following base position, and the insertion span is written into the candidate path value; for state transition relationships where both the preceding and following base positions correspond to deletion states, the deletion state process length is written into the following base position, and the deletion span is written into the candidate path value.

[0052] For the state transition relationship between the matching state corresponding to the previous base position and the insertion state corresponding to the next base position, write the initial value of the insertion state process length in the next base position; for the state transition relationship between the matching state corresponding to the previous base position and the deletion state corresponding to the next base position, write the initial value of the deletion state process length in the next base position.

[0053] For the state transition relationship of the matching state corresponding to the next base position, the insertion state process length and deletion state process length are written as 0 in the next base position;

[0054] The matching, insertion, and deletion states at the next base position are compared with the candidate path values. The candidate path value with the best value is retained, and the corresponding predecessor state is written into the next base position.

[0055] The candidate path value writing, process length writing, and predecessor state writing are repeated sequentially along the base position until the terminating base position is reached.

[0056] The path values ​​of the matching, insertion, and deletion states at the terminating base position are compared to determine the terminating state. Then, starting from the terminating base position, the path is backtracked along the predecessor state to generate the optimal state path.

[0057] Optionally, S6 specifically includes:

[0058] Map the matching, insertion, and deletion states in the optimal state path to the base positions in the base sequence in order of base position;

[0059] The system checks the state categories in the optimal state path according to the base position order. For the base position corresponding to the matching state in the optimal state path, the original bases in the base sequence are retained, and the original bases are written into the correction position according to their base position order. For the base position corresponding to the insertion state in the optimal state path, the original bases at the corresponding base positions in the base sequence are deleted, and the corresponding base positions are skipped in the correction position. For the base position corresponding to the deletion state in the optimal state path, the reference bases corresponding to the deletion state in the reference sequence are written into the correction position.

[0060] For adjacent base positions in the optimal state path, corresponding to the matching state, insertion state, and deletion state, respectively, the original bases after preservation and the reference bases after writing are connected in the order of base positions.

[0061] After completing the process of retaining the original bases corresponding to the matching state, deleting the original bases corresponding to the insertion state, and writing the reference bases corresponding to the missing state in sequence along the base positions, the bases in the correction position are connected in sequence according to the base positions to generate the correction read segment.

[0062] Optionally, S7 specifically includes:

[0063] The corrected read was aligned with the reference sequence according to the base position.

[0064] Record the base positions in the corrected read and their corresponding positions in the reference sequence to obtain the matching base positions, unmatched base positions, insertion positions, and deletion positions; write the matching base positions, unmatched base positions, insertion positions, and deletion positions in the corrected read into the alignment results in the order of the reference positions;

[0065] By comparing the base positions in the results, the number of matching bases, the number of unmatched bases, the number of inserted bases, and the number of missing bases are obtained, and the corresponding alignment positions are written into the correction read segment.

[0066] The corrected reads, reference sequences, and alignment results are correlated to generate sequencing error correction results.

[0067] The beneficial effects of this invention are:

[0068] (1) This invention identifies inserted and missing segments within candidate segments and calculates the insertion span and the missing span. It constructs a transition path graph by matching continuous relationships. This addresses the path offset problem caused by continuous insertion and continuous missing states, realizes structured constraints on state transition relationships, and improves the ability of the transition path graph to express complex error structures.

[0069] (2) By improving the Mistral model and introducing a base continuum stabilization mechanism in the attention calculation module, context modeling is performed on continuous base segments. In response to the unstable context association problem in error-dense segments, the state energy field is kept in a consistent distribution within the continuous base segments and maintains a smooth transition at the segment boundary, thereby improving the stability of the state energy field.

[0070] (3) By introducing a missing insertion process suppression mechanism in the Viterbi algorithm, the length of the insertion and missing states is recorded during the state path recursion process, and the recursion correction is performed in combination with the insertion span and the missing span. This addresses the error propagation problem caused by continuous insertion and continuous missing states, and achieves a stable solution for the optimal state path, thereby improving the accuracy and consistency of sequencing error correction results. Attached Figure Description

[0071] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0072] Figure 1 This is a flowchart of a gene sequencing error correction analysis method based on deep learning proposed in this invention;

[0073] Figure 2 This is a schematic diagram of the improved Mistral model proposed in this invention;

[0074] Figure 3 This is a data flow diagram of a gene sequencing error correction analysis method based on deep learning proposed in this invention. Detailed Implementation

[0075] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0076] refer to Figures 1-3 A deep learning-based gene sequencing error correction analysis method includes the following steps:

[0077] S1. Obtain sequencing reads and reference sequences, and extract base sequences and corresponding base quality values ​​from sequencing reads;

[0078] S2. Based on the base sequence, base quality value, and reference sequence, candidate segments are determined, an initial error state chain structure is constructed, and the base positions are calibrated according to the base quality value and the matching continuity of adjacent bases in the reference sequence to generate the error state chain; the error state chain includes matching state, insertion state, and deletion state;

[0079] S3. Based on the error state chain, identify continuous unmatched base segments and reference missing segments within the candidate segment, determine the insertion span and the missing span respectively, and generate a transfer cost map based on the matching continuity relationship, insertion span and missing span to obtain the transfer path map;

[0080] S4. Input the error state chain into the improved Mistral model, introduce a base continuum stabilization mechanism in the attention calculation module, perform context modeling on the continuous base segments in the error state chain composed of continuous positions of the same error state, and generate a state energy field.

[0081] S5. Based on the state energy field and transition path graph, the Viterbi algorithm with a missing insertion process suppression mechanism is used to perform state path recursion, record the continuous process length of the inserted and missing states, perform recursion correction, and generate the optimal state path.

[0082] S6. Perform base correction on the base sequence according to the optimal state path. The matching state retains the original bases, the insertion state is deleted, and the missing state is filled in to generate the corrected read segment.

[0083] S7. Map the corrected reads to the reference sequence to generate sequencing error correction results.

[0084] In this embodiment, S1 specifically refers to:

[0085] Obtain the sequencing reads and reference sequences corresponding to the sample to be calibrated. The sequencing reads adopt a sequence record format that includes read identifiers, base characters, and quality characters, and the reference sequences adopt a sequence record format that includes reference base arrangement information.

[0086] Unfold each record in the sequencing read in the order of sequence record, write the read identifier into the header of the corresponding record, write the base characters into the base position sequence in the order of character appearance, and write the quality characters into the quality position sequence in the order of character appearance.

[0087] The first character in the base position sequence is taken as the first base position, and the subsequent characters are assigned consecutively increasing base position numbers to form a one-to-one correspondence between base characters and base positions;

[0088] The characters in the mass position sequence are matched one by one with the base positions according to the same numbering order as the base positions, forming an arrangement result in a one-to-one correspondence between mass characters and base positions;

[0089] The quality characters are converted into base quality values. The conversion process is completed by subtracting the sequencing quality coding base value from the character encoding value. The character encoding value is the encoding value corresponding to the quality character, and the sequencing quality coding base value is the quality coding start value corresponding to the sequencing read record format. After conversion, the base quality values ​​corresponding to each base position are obtained.

[0090] The correspondence between base characters and quality characters is checked position by position. The number of characters in the base position sequence is compared with the number of characters in the quality position sequence, and the sequencing read records with the same number of characters are retained.

[0091] The base characters in the sequencing reads with the same number of characters are connected in order of base position to obtain the base sequence. The base quality values ​​at the corresponding positions are arranged in order of base position to obtain the base quality values.

[0092] The reference bases in the reference sequence are expanded in order of reference position to form the reference position arrangement corresponding to the reference sequence.

[0093] The read identifier, base sequence, base quality value, and reference sequence are written into the same sample record to form the base sequence and base quality value corresponding to the sequencing read.

[0094] In this embodiment, candidate regions are determined based on the base sequence, base quality value, and reference sequence, and an initial error state chain structure is constructed, specifically as follows:

[0095] The base sequence is expanded into a read base arrangement according to the base position order, and the reference sequence is expanded into a reference base arrangement according to the reference position order.

[0096] Starting from the first base position in the base sequence, the bases in the read base arrangement are matched with the bases in the reference base arrangement in order of position, and a base consistency mark or a base inconsistency mark is written for each pair of corresponding bases.

[0097] When a range of consecutive bases with consistent markings appears in the base sequence, the range of consecutive bases with consistent markings is taken as a candidate for alignment interval, and the start and end base positions of the candidate alignment interval are recorded.

[0098] For each candidate alignment interval, the sum of the number of identical base markers, the number of inconsistent base markers, and the corresponding base quality value is calculated. The candidate alignment interval with the largest number of identical base markers and the largest sum of base quality values ​​is written as the target alignment interval.

[0099] Write the starting base position corresponding to the target alignment interval as the alignment start position, and write the ending base position corresponding to the target alignment interval as the alignment end position;

[0100] Extract the reference position interval corresponding to the alignment start position and alignment end position from the reference base arrangement, and write the extracted reference position interval as the candidate segment;

[0101] The base positions in the base sequence are matched with the reference positions in the candidate segment one by one. The base characters in each pair of corresponding positions are compared to see if they are consistent, and the comparison results are written to the corresponding positions.

[0102] A position where a base character exists in the base sequence but there is no matching base in the corresponding reference position of the candidate segment is written as an insertion state; a position where a reference base exists in the candidate segment but there is no matching base in the corresponding base position of the base sequence is written as a deletion state; a position where the base character in the base sequence is the same as the base character in the corresponding position of the candidate segment is written as a matching state.

[0103] The matched, inserted, and missing states are arranged sequentially according to their base positions. The state category corresponding to the previous base position is then connected sequentially with the state category corresponding to the next base position to generate the initial error state chain structure.

[0104] In this embodiment, the base position is calibrated based on the base quality value and the matching continuity of adjacent bases in the reference sequence, generating an error state chain, specifically as follows:

[0105] The reference positions in the candidate segments are mapped one by one to the base positions in the base sequence, and the base quality value corresponding to each base position is written into the corresponding base position.

[0106] In the base position sequence, select the previous base position and the next base position, and compare the position difference between the reference position corresponding to the previous base position and the reference position corresponding to the next base position.

[0107] When the position difference is 1, the position of the preceding base and the position of the following base are written as a matching continuous relationship; when the position difference is not 1, the position of the preceding base and the position of the following base are written as a non-continuous relationship.

[0108] Summing the base mass values ​​corresponding to all base positions within the candidate segment, and dividing the sum by the total number of base positions, yields the average base mass value corresponding to the candidate segment.

[0109] Compare the base mass value corresponding to each base position with the average base mass value. If the base mass value is not less than the average base mass value, there is a matching relationship between the reference position corresponding to the base position, and there is a matching continuity relationship between the base position and the adjacent base position, the corresponding base position is written as the matching state.

[0110] When a base character exists in the base sequence, no matching base exists in the reference position corresponding to the candidate segment, and the state categories corresponding to adjacent base positions are consistent, the corresponding base position is written as the insertion state;

[0111] When a reference base exists in the candidate segment, there is no matching base at the corresponding base position in the base sequence, and the state categories corresponding to adjacent reference positions are consistent, the corresponding reference position is written as the missing state;

[0112] For base positions with a base quality value less than the average base quality value and corresponding non-continuous relationships, the base characters in the base sequence are re-compared with the reference bases in the candidate segment. Positions that form a matching relationship after re-matching are written as the matching state, positions that are still retained by one side of the base sequence after re-matching are written as the insertion state, and positions that are still retained by one side of the reference sequence after re-matching are written as the deletion state.

[0113] Write the matching, insertion, and deletion states corresponding to all base positions into the state position one by one in the order of base positions; connect the matching, insertion, and deletion states in the state position according to the order of base positions to generate an error state chain.

[0114] In this embodiment, based on the error state chain, consecutive unmatched base segments and reference missing segments are identified within the candidate segment, and the insertion span and deletion span are determined respectively, specifically as follows:

[0115] Expand the state positions in the error state chain in order of base position, and write the matching state, insertion state and deletion state corresponding to each base position into the corresponding base position;

[0116] Select the preceding and following base positions in the base position sequence, and compare the state category corresponding to the preceding base position with the state category corresponding to the following base position.

[0117] When both the preceding and following base positions correspond to an insertion state, the preceding and following base positions are written into the same insertion segment, and the preceding base position is written as the starting base position of the insertion segment, and the following base position is written as the ending base position of the insertion segment.

[0118] When the next base position continues to correspond to the insertion state, the next base position is written to the same insertion segment, and the ending base position of the insertion segment is updated to the current base position;

[0119] When the previous base position corresponds to an insertion state but the next base position does not correspond to an insertion state, the previous insertion segment is retained as a complete insertion segment, and the start and end base positions in the insertion segment are written into the corresponding base position markers.

[0120] Subtract the starting base position of the insertion segment from the ending base position of the insertion segment, and then add 1 to obtain the insertion span corresponding to the insertion segment.

[0121] In the base position sequence, a reference position corresponding to the deletion state is selected, and the state categories corresponding to adjacent reference positions are compared sequentially.

[0122] When both the previous and next reference positions correspond to a missing state, the previous and next reference positions are written into the same missing segment, and the previous reference position is written as the starting reference position of the missing segment, and the next reference position is written as the ending reference position of the missing segment; when the next reference position continues to correspond to a missing state, the next reference position continues to be written into the same missing segment, and the ending reference position of the missing segment is updated to the current reference position.

[0123] When the previous reference position corresponds to a missing state and the next reference position does not correspond to a missing state, the previous missing segment is retained as a complete missing segment, and the start and end reference positions in the missing segment are written into the corresponding reference position markers.

[0124] Subtract the starting reference position of the missing segment from the ending reference position of the missing segment, and then add 1 to obtain the missing span corresponding to the missing segment.

[0125] The inserted segment, missing segment, insertion span, and missing span are written into the base position marker and reference position marker in the error state chain, respectively. The base position markers written into the inserted segment, missing segment, insertion span, and missing span are arranged in order of base position to form the position basis corresponding to the transfer path diagram.

[0126] In this embodiment, a transition cost graph is generated based on the matching continuity, insertion span, and missing span to obtain a transition path graph, specifically as follows:

[0127] Expand the base position markers, reference position markers, matching states, insertion states, deletion states, matching continuity, insertion spans, and deletion spans in the error state chain according to the base position order; select the previous base position and the next base position in the base position order, and write the state category corresponding to the previous base position and the state category corresponding to the next base position as a set of state changes.

[0128] In a set of state changes, when both the preceding and following base positions correspond to a matching state, the position difference between the reference position corresponding to the preceding base position and the reference position corresponding to the following base position is compared. When the position difference is 1, the matching continuous relationship is written as a continuous relationship; when the position difference is not 1, the matching continuous relationship is written as a discontinuous relationship.

[0129] When a matching continuous relation is written as a continuous relation, the transfer cost is written as 0. When a matching continuous relation is written as a non-continuous relation, the transfer cost is written as the difference between the reference positions of the preceding and following base positions minus one.

[0130] In a set of state changes, if there is an insertion state at the preceding base position and no deletion state at the following base position, the insertion span in the corresponding base position marker is written as the transfer value; if there is a deletion state at the preceding base position and no insertion state at the following base position, the deletion span in the corresponding reference position marker is written as the transfer value; if the preceding base position corresponds to an insertion state and the following base position corresponds to a deletion state, the insertion span in the corresponding base position marker and the deletion span in the corresponding reference position marker are added together and written as the transfer value; if the preceding base position corresponds to a deletion state and the following base position corresponds to an insertion state, the deletion span in the corresponding reference position marker and the insertion span in the corresponding base position marker are added together and written as the transfer value.

[0131] Write the previous base position, the next base position, the state change, and the transfer cost into the same state transition relationship; connect all the state transition relationships in the base position sequence to form a transfer cost diagram; map the previous base position and the next base position in the transfer cost diagram to the base positions in the error state chain, and write the transfer cost between the corresponding base positions to obtain the transfer path diagram.

[0132] In this embodiment, the improved Mistral model specifically includes a state encoding module, a position injection module, an attention calculation module, and an energy output module;

[0133] The state coding module expands the matched state, inserted state and missing state in the error state chain according to the base position order, and writes the base character, base quality value and state category label in the base sequence into the same base position one by one, forming a state representation composed of base character, base quality value and state category label at each base position;

[0134] The position injection module writes the start reference position, end reference position and reference position order in the candidate segment into the base position in the state representation bit by bit, and writes the base position order and reference position order into the same base position. At each base position, a position representation is formed consisting of base character, base quality value, state category label, base position order and reference position order.

[0135] The attention calculus module maps each base position in the position representation to a query vector, a key vector, and a value vector, respectively. It then divides the sliding window according to base position order. Within each sliding window, base positions with the same state category and an adjacent base position difference of 1 are grouped into continuous base segments. The start position, end position, and segment length of each continuous base segment are written into the continuous base segment label. The base positions within each continuous base segment are written sequentially into the adjacent position association sequence, and the preceding and following base positions are written as sequential associations. Finally, the start position of each continuous base segment is written as an edge with the base position preceding it. Boundary connection relationships are defined by writing the termination position of a continuous base segment and the position of the base after the termination position as another set of boundary connection relationships. Sequential association relationships are written into the segment internal positions in the query vector and the key vector, and boundary connection relationships are written into the segment boundary positions in the query vector and the key vector. The correlation between each base position in the query vector and the corresponding base position in the key vector is compared position by position. The correlation results corresponding to the sequential association are written into the segment internal positions, and the correlation results corresponding to the boundary connection relationships are written into the segment boundary positions. The correlation results in the same sliding window are matched position by position with the corresponding base positions in the value vector to obtain the context representation.

[0136] The energy output module arranges the context representations obtained from each sliding window in order of base position, and writes the arranged context representations into the corresponding state positions of the matched state, insertion state, and deletion state, respectively. The context representations in the corresponding state positions of the matched state, insertion state, and deletion state are expanded in order of base position to generate a state energy field.

[0137] In this embodiment, both the improved Mistral model and the Mistral model employ a sequence position-based attention calculus structure. Both include the construction of state representation, position representation, query vector, key vector, and value vector, as well as a context representation generation process based on relevance results. Both model the input sequence according to base position order. During the improvement process, the matched, inserted, and missing states in the error state chain are aligned and written with the base characters and base quality values ​​at the same base position, forming a joint state representation at each base position. Furthermore, the reference position order in the candidate segment is written together with the base position order into the same base position shape. Positional representation is used to introduce a collaborative representation of error states and reference positions at the input layer. During attention computation, base positions with the same state category and an adjacent base position difference of 1 are grouped into continuous base segments. The start position, end position, and segment length of these continuous base segments are explicitly recorded. The sequential association between base positions within a continuous base segment is written into the segment's internal position in the query vector and key vector. The connection between the boundary position of a continuous base segment and its adjacent base positions is written into the segment's boundary position in the query vector and key vector. This introduces both internal and boundary associations within the attention structure. The system employs a dual constraint: during correlation calculation, the correlation results corresponding to sequential associations and those corresponding to boundary connections are written to different base positions, ensuring consistent changes in base positions within continuous base segments and maintaining connectivity between segment boundaries and adjacent base positions, thereby reducing the diffusion of insertion and deletion states at segment boundaries; during context representation generation, the correlation results within the sliding window are mapped bit-by-bit to the value vector and expanded sequentially according to base positions, ensuring stable changes in the context representation within continuous base segments and maintaining structural continuity at segment boundaries; and in energy output... During the process, the context representation is written into the corresponding state positions of the matching, insertion, and deletion states in order of base position, so that the state energy field forms a consistent distribution within the continuous base segment and a smooth transition at the segment boundary. By introducing explicit representation of continuous base segments and segment boundary connection relationships into the state representation, position representation, and attention association structure, the distribution of the state energy field in the error state chain is made more stable, and the energy changes of the insertion and deletion states are consistent with the continuity of base positions. This improves the stability of error state determination and the consistency of path recursion results, reduces error propagation, and improves the accuracy of sequencing error correction.

[0138] In this embodiment, S5 specifically refers to:

[0139] The matched, inserted, and missing states in the state energy field are expanded in order of base position, and the state energy value corresponding to each base position is written into the corresponding state position.

[0140] Expand the previous base position, the next base position, the state change and the transfer cost in the transfer path diagram in order of base position, and write the state transfer relationship between the previous base position and the next base position between adjacent base positions one by one.

[0141] At the starting base position, the state energy values ​​corresponding to the matching state, insertion state, and deletion state are written as the initial path value of the matching state, the initial path value of the insertion state, and the initial path value of the deletion state, respectively, and the process length of the insertion state and the process length of the deletion state are written as 0;

[0142] In the base position sequence, select the preceding base position and the following base position. Add the matching state path value, insertion state path value and deletion state path value in the preceding base position to the state energy value of the corresponding state position in the following base position one by one. Add the following to the transfer cost value of the corresponding state change between the preceding base position and the following base position one by one. Write the summation results into the matching state candidate path value, insertion state candidate path value and deletion state candidate path value in the following base position, respectively.

[0143] In the state change where both the preceding and following base positions correspond to insertion states, the insertion state process length at the preceding base position is incremented by 1 and written into the insertion state process length at the following base position, and the insertion span corresponding to the following base position is added to the insertion state candidate path value.

[0144] In the state change where both the preceding and following base positions correspond to deletion states, the length of the deletion state process at the preceding base position is incremented by 1 and written into the length of the deletion state process at the following base position, and the deletion span corresponding to the following base position is added to the deletion state candidate path value.

[0145] In the state transition from a matching state at the preceding base position to an insertion state at the following base position, the length of the insertion state at the following base position is written as 1; in the state transition from a matching state at the preceding base position to a deletion state at the following base position, the length of the deletion state at the following base position is written as 1; in the state transition from a matching state at the following base position, the lengths of both the insertion and deletion states at the following base position are written as 0.

[0146] The candidate path values ​​for the matching state at the next base position are compared one by one. The candidate path value with the best numerical value is written as the matching state path value, and the state category of the corresponding previous base position is written as the predecessor state of the matching state. The candidate path values ​​for the insertion state at the next base position are compared one by one. The candidate path value with the best numerical value is written as the insertion state path value, and the state category of the corresponding previous base position is written as the predecessor state of the insertion state. The candidate path values ​​for the deletion state at the next base position are compared one by one. The candidate path value with the best numerical value is written as the deletion state path value, and the state category of the corresponding previous base position is written as the predecessor state of the deletion state. The matching state path value, insertion state path value, deletion state path value, insertion state process length, deletion state process length, and predecessor state at the next base position are written to the corresponding base positions respectively. The path value writing, process length writing, and predecessor state writing are repeated in the order of base positions until the terminating base position is reached.

[0147] Compare the matching, insertion, and deletion path values ​​at the terminating base position one by one, and write the state category with the best value as the terminating state.

[0148] Starting from the terminating base position, the state category in the previous base position is written back bit by bit according to the predecessor state corresponding to the terminating state. The state categories after writing back are arranged in reverse order according to the base position and then adjusted to be arranged in forward order to generate the optimal state path.

[0149] In this embodiment, S6 specifically refers to:

[0150] Expand the matching, insertion, and deletion states in the optimal state path in base position order, and write the state category corresponding to each base position bit by bit into the corresponding base position; expand the base characters in the base sequence in base position order, and expand the reference bases in the reference sequence corresponding to the candidate segment in reference position order; map the base positions to the state categories in the optimal state path bit by bit, and map the base positions to the reference positions in the candidate segment bit by bit; when the base position corresponds to the matching state, write the original base at the corresponding base position in the base sequence into the correction position, and map the correction position to the current base position; when the base position corresponds to the insertion state, remove the original base at the corresponding base position in the base sequence from the base position order, and retain the current position vacancy in the correction position; when the base position corresponds to the deletion state, write the reference base at the reference position corresponding to the current deletion state in the candidate segment into the correction position, and map the written reference base to the position of the current deletion state;

[0151] When the preceding base position corresponds to a matched state and the following base position corresponds to an insertion state, the original base corresponding to the preceding base position is retained in the correction position, and the original base corresponding to the following base position is removed from the correction position; when the preceding base position corresponds to a matched state and the following base position corresponds to a deletion state, the original base corresponding to the preceding base position is retained in the correction position, and the reference base corresponding to the following deletion state is written into the correction position after the preceding base position; when the preceding base position corresponds to an insertion state and the following base position corresponds to a matched state, the original base corresponding to the preceding base position is removed, and the original base corresponding to the following base position is written into the correction position corresponding to the following base position; when the preceding base position corresponds to a deletion state and the following base position corresponds to a matching state, the original base corresponding to the preceding base position is removed, and the original base corresponding to the following base position is written into the correction position corresponding to the following base position; when the preceding base position corresponds to a deletion state and the following base position corresponds to a matching state, the original base corresponding to the preceding base position is retained in the correction position, and the reference base corresponding to the following deletion state ... deletion state; when the preceding base position corresponds to a matching state and the following base position corresponds to a matching state, the original base corresponding to the preceding base position is retained in the correction position, and the reference base corresponding to the following deletion state is written into the correction position corresponding to the following deletion state. In the matching state, the reference base corresponding to the previous deletion state is retained in the correction position, and the original base corresponding to the next base position is written into the correction position corresponding to the next base position. When both the previous and next base positions correspond to deletion states, the reference bases corresponding to the previous and next deletion states are written into adjacent correction positions in the order of their reference positions. When both the previous and next base positions correspond to insertion states, the original bases corresponding to the previous and next base positions are removed from the correction positions in the order of their original positions. The original bases retained and the written reference bases in all correction positions are arranged in the order of their correction positions, and the base characters in adjacent correction positions are concatenated bit by bit to generate a correction read segment.

[0152] In this embodiment, S7 specifically refers to:

[0153] Expand the base characters in the correction read in order of base position, and expand the reference bases in the reference sequence corresponding to the candidate segment in order of reference position; match the first base position in the correction read with the first reference position in the reference sequence, and match the subsequent base positions with the subsequent reference positions one by one along the base position order; when the base characters in the correction read match the reference base characters in the reference sequence, write the corresponding position as the matching base position;

[0154] If the base character in the correction read is inconsistent with the reference base character in the reference sequence, and the base character exists at the corresponding position in both the correction read and the reference sequence, the corresponding position will be written as the unmatched base position; if the base character exists in the correction read but does not exist at the corresponding reference position in the reference sequence, the corresponding position will be written as the insertion position; if the reference sequence contains a reference base but does not exist at the corresponding base position in the correction read, the corresponding position will be written as the missing position.

[0155] The matching base positions, unmatched base positions, insertion positions, and missing positions are written into the corresponding positions in the alignment results in the order of the reference positions; the number of matching base positions, unmatched base positions, insertion positions, and missing positions in the alignment results are counted along the order of the reference positions, and the counted numbers are written into the corresponding reference position segments in the alignment results.

[0156] The base positions in the corrected read, the reference positions in the reference sequence, and the corresponding positions in the alignment results are associated one by one. The matching base positions, unmatched base positions, insertion positions, deletion positions, the number of matching base positions, the number of unmatched base positions, the number of insertion positions, and the number of deletion positions are all written into the same correction record. All correction records are arranged in order of reference position to generate sequencing error correction results.

[0157] Example 1: To verify the feasibility of this invention in practice, it was applied to the quality control and error correction process of human exome sequencing data at a gene testing center. The sequencing platform used common short-read high-throughput sequencing equipment, with 48 samples per run. Each sample contained approximately 42 million raw sequencing reads, each 150 bp in length, with raw base quality values ​​concentrated between Q26 and Q37. During actual testing, local mismatches, short insertions, and short deletions were commonly observed in the sequencing reads, especially in regions with high GC content, repetitive sequence regions, and boundary switching regions. These issues often resulted in unstable error states, state transition path deviations, and the expansion of consecutive insertion and deletion states, leading to an increase in false positive sites, a decrease in effective alignment rates, and insufficient consistency of corrected reads in subsequent variant detection.

[0158] To address the aforementioned issues, the following approach is adopted: First, the base sequence and base quality value are extracted from the sequencing reads, and then a correspondence is established with the reference sequence to determine candidate regions. Next, an initial error state chain structure is constructed within the candidate regions, labeling each base position as a matched, inserted, or deleted state. For continuous error regions, inserted and deleted regions are further identified, obtaining the insertion and deletion spans, and a transition path graph is generated by combining the matching continuity relationship. Subsequently, the error state chain is input into an improved Mistral model, introducing a base context stabilization mechanism in the attention calculus module. This allows the correlations within continuous base regions and the connectivity of region boundaries to simultaneously participate in context modeling, outputting a state energy field. Finally, the state energy field and the transition path graph are jointly input into the Viterbi algorithm, which incorporates a missing / insertion process suppression mechanism, to recursively correct the continuous process lengths of the inserted and deleted states, obtaining the optimal state path. Finally, based on the optimal state path, deletion is performed on inserted states in the base sequence, completion is performed on missing states, and the original bases are retained on matched states to generate correction reads. The sequence is then re-aligned with the reference sequence, and the sequencing error correction results are output.

[0159] To demonstrate the improved performance of this invention in error state determination and path solving, the method of this invention is compared with the original comparison and correction method, the ordinary deep learning correction method, and the conventional dynamic programming correction method. The indicators of different methods in error state identification and comparison quality are statistically analyzed, and the results are shown in Table 1.

[0160] Table 1. Comparison of different methods in terms of error state identification and alignment quality.

[0161]

[0162] As shown in Table 1, the method of this invention significantly outperforms the comparative methods in terms of accuracy in identifying matched, inserted, and missing states, especially in the identification of inserted and missing states, where the improvement is more significant, increasing by 13.2 and 14.0 percentage points respectively compared to the original alignment and correction methods. This indicates that the error state chain and transition path diagram can more accurately represent complex error regions. The effective alignment rate after correction reaches 98.3%, which is 1.7 percentage points higher than ordinary deep learning correction methods. The mismatch rate after correction decreases to 0.72%, and the insertion / deletion residual rate decreases to 0.46%. This shows that the state energy field generated by the improved Mistral model can stably characterize the contextual relationship of continuous base segments, and the Viterbi algorithm, which introduces a defect / insertion process suppression mechanism, can effectively suppress path offsets caused by continuous insertion and deletion states, thus making the correction results more stable.

[0163] Four real samples from the same batch were further selected, and their performance in variation detection and read consistency before and after correction was statistically analyzed. The results are shown in Table 2.

[0164] Table 2. Comparison of sequencing quality and variant detection indicators for typical samples before and after correction.

[0165]

[0166] As shown in Table 2, the method of this invention consistently improves the performance of actual samples. The average Q-score of all four samples improved by approximately 3 points or more after correction, and the effective alignment rate steadily increased to over 98.0%, indicating a more accurate correspondence between the corrected reads and the reference sequence. The number of false positives for SNPs decreased from 38-45 to 16-20, and the number of false positives for Indels decreased from 16-21 to 6-8, indicating that insertion and deletion states were more stably constrained during the state path recursion stage. Read consistency improved from 95.9%-96.5% to 98.1%-98.7%, and the target region coverage improved by approximately 3.3-3.9 percentage points, demonstrating a significant improvement in the continuity and integrity of the corrected reads in complex regions, directly supporting subsequent variant detection and clinical analysis.

[0167] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A gene sequencing error correction analysis method based on deep learning, characterized in that, Includes the following steps: S1. Obtain sequencing reads and reference sequences, and extract base sequences and corresponding base quality values ​​from the sequencing reads; S2. Based on the base sequence, base quality value and reference sequence, candidate segments are determined, an initial error state chain structure is constructed, and the base position is calibrated according to the base quality value and the matching continuity relationship of adjacent bases in the reference sequence to generate the error state chain. The error state chain includes matched states, inserted states, and missing states; S3. Based on the error state chain, identify continuous unmatched base segments and reference missing segments within the candidate segments, determine the insertion span and the missing span respectively, and generate a transfer cost map based on the matching continuity relationship, insertion span and missing span to obtain a transfer path map; S4. Input the error state chain into the improved Mistral model, introduce a base convolution stabilization mechanism in the attention calculation module, perform context modeling on the continuous base segments in the error state chain composed of continuous positions of the same error state, and generate a state energy field. S5. Based on the state energy field and transition path graph, the Viterbi algorithm with a missing insertion process suppression mechanism is used to perform state path recursion, record the continuous process length of the inserted and missing states, perform recursion correction, and generate the optimal state path. S6. Perform base correction on the base sequence according to the optimal state path. The matching state retains the original bases, the insertion state is deleted, and the missing state is filled in to generate a corrected read segment. S7. Map the corrected read to the reference sequence to generate sequencing error correction results.

2. The gene sequencing error correction analysis method based on deep learning according to claim 1, characterized in that, Specifically, S1 is: Obtain sequencing reads and reference sequences; parse read identifiers, base characters, and quality characters from sequencing reads; Arrange the base characters according to their position order to obtain the base sequence, and convert the quality characters according to the one-to-one correspondence with the base positions to obtain the base quality value; By associating the base sequence, base quality value, and reference sequence, the base sequence and base quality value corresponding to the sequencing read are obtained.

3. The gene sequencing error correction analysis method based on deep learning according to claim 1, characterized in that, The process of determining candidate regions based on base sequences, base quality values, and reference sequences, and constructing an initial error state chain structure, specifically involves: The base sequence is sequentially compared with the reference sequence to determine the alignment start and alignment end positions of the base sequence in the reference sequence; Candidate segments are obtained by truncating the corresponding intervals in the reference sequence based on the alignment start and alignment end positions; Within the candidate region, the base sequence is compared position by position with the corresponding bases in the reference sequence, and the matching and non-matching relationships are recorded. The position of a base in the base sequence that exists but does not have a matching base at the corresponding position in the reference sequence is denoted as the insertion state; Positions in the reference sequence that exist but do not have matching bases at their corresponding positions are denoted as deleted states; positions in the reference sequence that have matching relationships with their corresponding positions are denoted as matched states. Connect the matched, inserted, and deleted states according to their base positions to generate the initial error state chain structure.

4. The gene sequencing error correction analysis method based on deep learning according to claim 1, characterized in that, The step of performing state calibration on the base position based on the base quality value and the matching continuity of adjacent bases in the reference sequence, and generating an error state chain, specifically involves: Read the base quality value corresponding to each base position in the initial error state chain structure, and the matching position of adjacent base positions in the reference sequence; By comparing the differences in matching positions of adjacent bases in the reference sequence, the continuity of the matching can be determined. Base positions whose base quality values ​​meet predetermined quality conditions and whose matching positions continuously increase are labeled as matched states; base positions that are consecutive in the base sequence but do not form corresponding matching positions in the reference sequence are labeled as inserted states; and base positions that are consecutive in the reference sequence but do not form corresponding matching positions are labeled as deleted states. Write the calibrated matched, inserted, and missing states in order of base position to generate an error state chain.

5. The gene sequencing error correction analysis method based on deep learning according to claim 1, characterized in that, The process of constructing a transition path graph based on the error state chain, identifying consecutive unmatched base segments and reference missing segments within the candidate segments, and determining the insertion span and missing span respectively, specifically involves: Scan the matched, inserted, and deleted states sequentially along the base positions of the error state chain; During the scanning process, base positions in the base position sequence that are both marked as insertion states are grouped into insertion segments, and the start and end base positions of the insertion segments are recorded. The base position difference is calculated based on the start and end base positions of the insertion segments to obtain the insertion span. During the scanning process, reference sequence positions in the base position sequence where adjacent positions are all marked as deletion states are grouped into deletion segments, and the start and end reference positions of the deletion segments are recorded; the reference position difference is calculated based on the start and end reference positions of the deletion segments to obtain the deletion span; The inserted segment, missing segment, insertion span, and missing span are written into the base position markers corresponding to the error state chain.

6. The gene sequencing error correction analysis method based on deep learning according to claim 1, characterized in that, The process of generating a transition cost graph based on matching continuity, insertion span, and missing span, resulting in a transition path graph, is as follows: Read the state category, matching continuity, insertion span, and deletion span corresponding to adjacent base positions in the error state chain; Establish state transition relationships between state changes of adjacent positions in the base position sequence; In a base position sequence, when all adjacent positions are marked as matching, the transfer cost corresponding to the matching continuity is written; when at least one of the adjacent positions is marked as insertion, the transfer cost corresponding to the insertion span is written; when at least one of the adjacent positions is marked as deletion, the transfer cost corresponding to the deletion span is written. The state transition relationships written into the transfer cost are connected in order of base position to form a transfer cost graph; By associating the transfer cost map with the corresponding base positions in the error state chain, a transfer path map is generated.

7. The gene sequencing error correction analysis method based on deep learning according to claim 1, characterized in that, The improved Mistral model specifically includes a state encoding module, a position injection module, an attention calculation module, and an energy output module; The state encoding module arranges the matched, inserted, and missing states in the error state chain in order of base position, and writes the base characters, base quality values, and state categories in the error state chain into the same base position to form a state representation. The position injection module sequentially writes the start reference position, end reference position and base position in the candidate segment into the corresponding base position in the state representation. At each base position in the state representation, a combination of base character, base quality value, state category and position identifier is formed to obtain the position representation. The attention calculation module constructs query vectors, bond vectors, and value vectors from the base positions in the position representation, and arranges the base positions in the position representation according to a sliding window. A base network stabilization mechanism is introduced in the attention calculation module. This mechanism groups base positions with the same state category and adjacent base position differences of 1 in the error state chain into continuous base segments, and records the start position, end position, and segment length of the continuous base segments. The base positions within the continuous base segments are written into the adjacent position association sequence according to the base position order, and the order relationship of the base positions within the segment is written into the adjacent position association sequence. The start position of the continuous base segment is connected to the base position preceding the start position, and the end position of the continuous base segment is connected to the base position following the end position, and the cross-segment connection relationship is written into the adjacent position association sequence. The association relationship of the base positions within the segment is written into the corresponding position of the query vector and the key vector, and the cross-segment connection relationship is written into the boundary position of the query vector and the key vector. The attention calculation module performs positional expansion on the contextual relationship of corresponding base positions in the value vector based on the association between the query vector and the key vector, thereby obtaining a contextual representation; The energy output module maps the context representation to the corresponding state positions of the matched, inserted, and deleted states in order of base position, generating a state energy field.

8. The gene sequencing error correction analysis method based on deep learning according to claim 1, characterized in that, Specifically, S5 is: Arrange the state positions corresponding to the matched, inserted, and missing states in the state energy field according to the base position order, and write the state transition relationship between adjacent base positions in the transition path diagram between adjacent base positions accordingly. Write the matching, insertion, and deletion states at the starting base position into the initial path value; Following the order of base positions, the path value in the previous base position, the state energy value corresponding to the next base position, and the transfer cost value between the previous base position and the next base position are combined item by item and written into the candidate path values ​​corresponding to the matching state, insertion state and deletion state in the next base position. When introducing the insertion suppression mechanism, for state transition relationships where both the preceding and following base positions correspond to insertion states, the insertion state process length is written into the following base position, and the insertion span is written into the candidate path value; for state transition relationships where both the preceding and following base positions correspond to deletion states, the deletion state process length is written into the following base position, and the deletion span is written into the candidate path value. For the state transition relationship between the matching state corresponding to the previous base position and the insertion state corresponding to the next base position, write the initial value of the insertion state process length in the next base position; for the state transition relationship between the matching state corresponding to the previous base position and the deletion state corresponding to the next base position, write the initial value of the deletion state process length in the next base position. For the state transition relationship of the matching state corresponding to the next base position, the insertion state process length and deletion state process length are written as 0 in the next base position; The matching, insertion, and deletion states at the next base position are compared with the candidate path values. The candidate path value with the best value is retained, and the corresponding predecessor state is written into the next base position. The candidate path value writing, process length writing, and predecessor state writing are repeated sequentially along the base position until the terminating base position is reached. The path values ​​of the matching, insertion, and deletion states at the terminating base position are compared to determine the terminating state. Then, starting from the terminating base position, the path is backtracked along the predecessor state to generate the optimal state path.

9. The gene sequencing error correction analysis method based on deep learning according to claim 1, characterized in that, Specifically, S6 is: Map the matching, insertion, and deletion states in the optimal state path to the base positions in the base sequence in order of base position; The system checks the state categories in the optimal state path according to the base position order. For the base position corresponding to the matching state in the optimal state path, the original bases in the base sequence are retained, and the original bases are written into the correction position according to their base position order. For the base position corresponding to the insertion state in the optimal state path, the original bases at the corresponding base positions in the base sequence are deleted, and the corresponding base positions are skipped in the correction position. For the base position corresponding to the deletion state in the optimal state path, the reference bases corresponding to the deletion state in the reference sequence are written into the correction position. For adjacent base positions in the optimal state path, corresponding to the matching state, insertion state, and deletion state, respectively, the original bases after preservation and the reference bases after writing are connected in the order of base positions. After completing the process of retaining the original bases corresponding to the matching state, deleting the original bases corresponding to the insertion state, and writing the reference bases corresponding to the missing state in sequence along the base positions, the bases in the correction position are connected in sequence according to the base positions to generate the correction read segment.

10. The gene sequencing error correction analysis method based on deep learning according to claim 1, characterized in that, Specifically, S7 is: The corrected read was aligned with the reference sequence according to the base position. Record the base positions in the corrected read and their corresponding positions in the reference sequence to obtain the matching base positions, unmatched base positions, insertion positions, and deletion positions; write the matching base positions, unmatched base positions, insertion positions, and deletion positions in the corrected read into the alignment results in the order of the reference positions; By comparing the base positions in the results, the number of matching bases, the number of unmatched bases, the number of inserted bases, and the number of missing bases are obtained, and the corresponding alignment positions are written into the correction read segment. The corrected reads, reference sequences, and alignment results are correlated to generate sequencing error correction results.