STR detection method and system based on context awareness motif identification
By adopting a motif recognition strategy based on the frequency of alternative motifs and the idea of Markov chains, combined with a segmented global sequence alignment algorithm, the problem of insufficient detection reliability in existing STR detection methods is solved, and efficient and accurate STR detection is achieved.
Patent Information
- Application Number
- CN202510271809.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-10-28
AI Technical Summary
Existing STR detection methods rely on high requirements for parameter selection and training datasets, resulting in insufficient detection reliability and high computational complexity, making it difficult to efficiently identify representative motifs.
A motif recognition strategy based on the frequency of candidate motifs (N-Gram model) and the idea of Markov chains is adopted. By obtaining candidate motifs in fuzzy repeating intervals, representative motifs are selected, and non-serialized repeating intervals are filtered out using representative motifs. Combined with a segmented global sequence alignment algorithm, the detection efficiency and accuracy are improved.
Recognizing representative motifs within linear time complexity improves the accuracy and efficiency of STR detection, reduces alignment time complexity, and significantly enhances the reliability and efficiency of STR detection.
Smart Images

Figure CN120853684A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of STR detection technology, specifically relating to a method and system for STR detection based on context-aware motif recognition. Background Technology
[0002] Short tandem repeats (STRs), also known as microsatellites, are tandem repeat sequences with repeat units (motifs) of 1-6 base pairs, comprising approximately 3% of the human genome. STRs exhibit high polymorphism, characterized by significant differences in length, sequence composition, and copy number, with mutation rates 10 to 100,000 times higher than other genomic regions. This inherent instability makes STRs a valuable tool in forensic medicine, paternity testing, population genetics, and the diagnosis of genetic diseases. Studies have shown that approximately 60 STR loci are associated with various Mendelian diseases, including ataxia, amyotrophic lateral sclerosis (ALS), Huntington's disease, Fragile X syndrome, and various neurological disorders. Furthermore, STR amplification is associated with at least seven types of cancer, including lung and kidney cancer, and specific subtypes of these cancers.
[0003] Existing methods for detecting STRs fall into two categories: database-based methods and de novo detection methods. The former typically only identifies STRs that are significantly similar to known sequences and cannot detect unannotated STRs. De novo detection methods do not require pre-existing repetitive sequences and can be further divided into:
[0004] 1) Dictionary-based methods. These methods determine the boundaries and motif composition of STRs based on the distribution and relative positions of seeds, such as TRF, T-REKS, ExpansionHunter Denovo (EHdn), and TRASH. However, these methods heavily rely on the similarity between motifs, are suitable for STR recognition tasks with low local variation, and employ a seed-based exhaustive search strategy, resulting in extremely high computational time complexity.
[0005] 2) K-mer counting methods. These methods directly determine motif composition and STR structure using sliding windows and heuristic k-mer searches, such as mreps, STRling, and HipSTR. However, these methods are highly parameter-dependent; increasing sensitivity often increases runtime and false positive rate. Furthermore, some tools cannot identify STRs containing insertions or deletions, limiting their application scenarios.
[0006] 3) Machine learning or deep learning-based methods. These methods involve training a recognition model based on learned STR structural features to predict and identify new STRs. Examples include REXPRT, DeepRepeat, and DeepTRs. However, these methods have extremely high requirements for the quality and quantity of the training dataset, and they consume a lot of computational resources and are time-consuming to run.
[0007] Furthermore, existing technologies for motif recognition are either overly idealistic, relying solely on concatenated repeating structures to obtain representative motifs. This method often involves too much randomness, and the obtained motifs have local optima, failing to fully represent the overall sequence. Alternatively, they employ multi-round recognition strategies and complex graphing strategies, which, while yielding more accurate representative motifs, have excessively high time complexity, hindering efficient recognition of representative motifs. This, in turn, impacts the efficiency and accuracy of STR recognition.
[0008] In conclusion, existing STR detection methods still have many technical shortcomings, and there is a need to further improve the overall effectiveness of STR detection methods. Summary of the Invention
[0009] This invention addresses the limitations of existing STR detection methods due to their reliance on parameter selection and extremely high requirements for training datasets, which hinder the improvement of STR detection reliability. It provides a context-aware motif recognition-based STR detection method. Specifically, the motif recognition strategy proposed in this invention, based on the frequency of candidate motifs (N-Gram model) and the Markov chain concept, can identify representative motifs that can represent the entire STR within linear time complexity. The algorithm boasts fast execution time and high motif recognition accuracy, thus improving both the efficiency and precision of STR detection.
[0010] Therefore, the following technical solution is provided:
[0011] On the one hand, the present invention provides an STR detection method based on context-aware motif recognition, comprising the following steps:
[0012] S1: For the gene sequence fragment to be detected, obtain the fuzzy repeat intervals corresponding to different motif lengths;
[0013] S2: Filter the fuzzy repeating intervals and identify the STR positions / boundaries of the fuzzy repeating intervals to obtain the STR sequence;
[0014] The filtering and boundary identification process in step S2 includes at least the following:
[0015] Seed distribution and sampling are introduced to obtain candidate motifs on fuzzy repeating intervals. Then, based on the frequency of candidate motifs and a motif identification strategy based on Markov chain, representative motifs are selected from the candidate motifs. The confused repeating intervals are divided into simple repeating intervals containing a single STR and confused repeating intervals containing multiple STRs. For ordinary repeating intervals, non-serialized repeating intervals are filtered using representative motifs. For confused repeating intervals, the initial screening boundaries of STRs are identified using representative motifs, thereby obtaining several simple repeating intervals.
[0016] S3: Obtain the number of inserted / deleted bases (Indel) and the number of matched bases (Match) of the identified STR sequence to characterize the STR identification quality.
[0017] Preferably, the motif recognition strategy based on the frequency of candidate motifs and the Markov chain concept is as follows:
[0018] First, calculate the frequency of each candidate motif in the fuzzy repetition interval;
[0019] Secondly, if the motif length is less than 4, the candidate motif with the highest frequency is selected as the representative motif of the fuzzy repeating interval; if the motif length is greater than or equal to 4, the candidate motifs with the highest frequency are selected as the representative motifs of the initial screening, and a second screening is performed.
[0020] The second screening is as follows:
[0021] Based on the idea of Markov chains, a base transfer matrix of fuzzy repeating intervals is generated, and then the two bases with the highest frequency in the base transfer matrix of the fuzzy repeating intervals are obtained.
[0022] The estimated copy number of the fuzzy repeat interval is estimated based on the frequency of the two bases.
[0023] Based on the Markov chain concept, the base transfer matrix of the representative motif initially screened in the fuzzy repeating interval is generated.
[0024] Based on the base transfer matrix of the representative motifs in the initial screening and the base transfer matrix of the fuzzy repeating intervals, a copy vector of the representative motifs in the initial screening is generated. Based on the variance of the elements of the copy vectors with the estimated copy number, the representative motif of the initial screening with the smallest variance is selected as the representative motif for the second screening.
[0025] exist;
[0026]
[0027] In the formula, copy_vector is the copy vector, Cij This represents the copy number of base i transferred to base j in the motif. The values of i and j are 1-4, corresponding to base types A, G, T, and C. The frequency of base i transitioning to base j in the base transfer matrix of the representative motif from the initial screening is shown. Let be the frequency at which base i is transferred to base j in the base transfer matrix of the fuzzy repeating interval.
[0028] The process of selecting representative motifs for secondary screening based on the base transfer matrix of the representative motifs from the initial screening, and determining whether the copy number of base transfers on the representative motifs from the initial screening is balanced and close to the estimated copy number of the fuzzy repeat interval, is as follows:
[0029] Given the possible copy number of the STR (by default, the estimated copy number of a fuzzy repeating interval, since we assume that a fuzzy repeating interval is equivalent to a STR) and the base transfer matrix of a candidate motif, maintain a copy number score and repeat the following operation for the length of the motif: In the i-th operation, take the i-th and (i+1)-th bases of the candidate motif, and obtain the frequency of the corresponding base transfers in the base transfer matrix of the candidate motif. If the frequency is greater than the possible copy number, add the possible copy number value of the STR to the current copy number score of the candidate motif, and update the base transfer matrix of the candidate motif so that the frequency of the base transfer is reduced by the possible copy number value; otherwise, do not add the copy number score. After repeating the operation, the candidate motif with the highest copy number score is the best motif.
[0030] Preferably, the process of estimating the predicted copy number of the fuzzy repeating interval based on the frequency of the two bases corresponds to the following formula:
[0031] copy f =α·copy t +(1-α)·copy e
[0032] In the formula, copy f For the estimated copy number of fuzzy repeating intervals, α is the weight of the nominal copy number. e For the greatest common divisor, copy t Let the nominal copy number satisfy:
[0033]
[0034] l STR =u m ·copy t
[0035] In the formula, b j b kThese are the frequencies of the two most frequent bases, gcd(b) j ,b k ) consists of two bases b j b k The greatest common factor of the frequencies, l STR Let u be the length of the STR, and let u be the length of the fuzzy repeating interval. m The length of the fuzzy repeating unit, i.e., the motif length.
[0036] Preferably, a Tri-Gram model is introduced to calculate the frequency of each candidate motif in the fuzzy repeat interval, as follows:
[0037]
[0038] In the formula, P(motif) represents the frequency of the candidate motif, and b i b i-1 b i-2 These are consecutive 3-mers from the candidate motifs, C(b) i-2 b i-1 b i ) represents b in the same fuzzy repeating interval i-2 b i-1 b i 3-mer frequency, C(b) i-2 b i-1 ) represents b in the same fuzzy repeating interval i-2 b i-1 2-mer frequency, l motif To determine the length of the candidate motif, P(b) i |b i-2 b i-1 ) is a known 2-mer of b i-2 b i-1 The next base is b. i The probability of;
[0039] Among them, the candidate motifs are selected by filtering out all candidate motifs in the fuzzy repeating interval, starting with 2-mer.
[0040] The N-Gram model originates from a statistical language model in NLP, used to determine the probability of a sentence's validity based on a corpus. Its widespread application demonstrates the feasibility and accuracy of the N-Gram model in calculating sentence probabilities. Similarly, the STR sequence is analogous to a corpus, and the candidate motifs are analogous to sentences; therefore, calculating the probability of candidate motifs based on the STR is reasonable and effective. Furthermore, since motifs appear frequently in the STR, the candidate motif with the highest calculated probability is used as the representative motif.
[0041] In N-gram models, the main types are binary (Bi-gram) and ternary (Tri-gram) models; models with more than three grams are relatively rare. Due to the high degree of randomness in gene sequences, binary models alone cannot effectively capture the relationships between sequences. Tri-gram models, on the other hand, can capture these relationships well without leading to excessive computational complexity. Furthermore, models with more than three grams require an excessive number of bases to capture sequence relationships, which may prevent them from reflecting the frequency differences between different representative motifs.
[0042] Preferably, for confusing repeating intervals, the process of identifying the initial screening boundaries of STRs using representative motifs, and then obtaining several simple repeating intervals, is as follows:
[0043] A regular expression motif_regex is constructed based on representative motifs. The regular expression motif_regex is the 4-mer or 5-mer with the highest frequency in the sequence of representative motifs.
[0044] Starting from the beginning of the confused repeating interval, obtain each consecutive C perfect The distance between each motif_regex is then used to calculate the average distance, variable C. perfect ≈75 / u m u m This refers to the set length of the fuzzy repeating unit, i.e., the motif length;
[0045] If the average distance is less than or equal to a preset threshold, the intervals containing the motif_regex are merged, and the traversal continues until a motif_regex is reached and the calculated average distance is greater than the preset threshold. The intervals containing the merged motif_regex are considered as one STR, and the current motif_regex being traversed is the boundary of the STR. This process is repeated to identify the initial screening boundary of each STR in the confusing repeating intervals, resulting in several simple repeating intervals.
[0046] Preferably, in step S3, based on the length of the STR sequence, a local sequence alignment method is selected, and segmented global sequence alignment is performed to determine the number of inserted / deleted bases (Indel) and the number of matched bases (Match);
[0047] The segmented global sequence alignment process is as follows:
[0048] First, a corresponding marker motif is constructed based on the representative motifs on the STR sequence. The marker motif is a motif sequence with a length of 3bp to 8bp. The purpose is to prevent the matching position from being too random due to the motif length being too short.
[0049] Secondly, the `compile` function from the regular expression library is used to find all positions that perfectly match `mark_motif`; these positions are the same as the real `STR`, with no mismatches or insertions / deletions, so no comparison is needed.
[0050] Furthermore, the sequence intervals between adjacent perfect matches mark_motif are marked as matching gap sequences, and then a standard STR of multiple motif length is constructed for the matching gap sequences;
[0051] Then, the standard STR is compared with the matching gap sequence, and the number of inserted or deleted bases N in the matching gap sequence is counted. indel and the number of matching bases N match N insert N delete These represent the number of bases inserted and the number of bases deleted, respectively.
[0052] The sequence in which the positions of multiple perfectly matching mark_motifs overlap is considered a chaotic sequence; chaotic sequences still need to be compared because the positions of these perfectly matching mark_motifs cannot be uniquely determined.
[0053] Merge the sequences containing these perfect match marks one by one until a non-overlapping perfect match mark is found. Then, use a global sequence algorithm to obtain the number of inserted and deleted bases N in the chaotic sequence. indel and the number of matching bases N match ;
[0054] Finally, N is obtained from all the comparisons. indel and N match The number of inserted / deleted bases (Indel) and the number of matched bases (Match) for the entire sequence are summed separately.
[0055] It should be understood that a high-quality STR contains a large number of error-free motifs, with mismatches, insertions, and deletions occurring only in a few locations. Therefore, the segmented global sequence alignment algorithm used in this invention leverages this idea. First, through perfect mark-motif matching, the positions of a large number of error-free motifs on a STR can be obtained. These positions do not need to be compared to find errors; instead, only the remaining gap sequences need to be compared. Thus, for an extremely long STR, the sequence that truly needs to be aligned is only a very small segment, significantly reducing the alignment length and time complexity, thereby saving considerable alignment time, even by orders of magnitude.
[0056] Secondly, the present invention provides an STR detection method based on the above method, comprising:
[0057] Step 1: Read the gene sequence file and segment the gene sequence to obtain gene sequence fragments of uniform length with overlapping ends of adjacent segments;
[0058] Step 2: Using the method described in claim 1, short tandem repeat sequences (STRs) on each gene sequence fragment are detected in parallel;
[0059] Step 3: Merge overlapping STRs on adjacent segments to obtain STR identification results for gene sequences, and determine whether to retain STRs for multiple overlapping STRs in the same interval based on the gain magnitude;
[0060] Specifically, if one of the overlapping STRs has a length ratio interval shorter than the minimum length threshold P_th_profit, while another STR has a length ratio interval exceeding 80%, the STR with a non-negative gain among the two STRs is retained; otherwise, it is discarded.
[0061] Since multiple different motifs, i.e., multiple different STRs, can be identified within the same interval, some intervals may contain multiple STRs that overlap at the same location. The technical solution of this invention addresses this by first calculating the minimum length threshold P_th_profit that a STR in the interval must retain based on the interval gain decision algorithm's selection strategy. Then, for these two STRs, their gain values need to be calculated according to the gain magnitude formula. Only STRs with non-negative gain magnitudes are retained; otherwise, they are discarded.
[0062] Since it's unknown which STRs ultimately have biological effects, they cannot be arbitrarily selected, and there are no uniform parameter requirements for selection; different tools employ different approaches. Therefore, this invention's technical solution removes STRs with obvious identification errors during the identification process, retaining as many potentially biologically active STRs as possible. Referring to decision-maker behavior, the decision to retain a STR is made by analyzing whether it's worth exploring within a given interval. Through analysis, the final influencing parameters all stem from the STR's length and quality. Lower alignment quality requires a longer STR to be retained; conversely, shorter STR length requires a higher alignment quality, conforming to the retention principle without requiring additional subjective parameters.
[0063] In three aspects, the STR detection system based on the above method provided by the present invention includes at least:
[0064] The fuzzy repeat interval construction module is used to obtain fuzzy repeat intervals corresponding to different motif lengths for the gene sequence fragment to be detected.
[0065] The filtering and identification module is used to filter the fuzzy repeating intervals and identify the STR positions / boundaries of the fuzzy repeating intervals to obtain STR sequences.
[0066] The filtering and boundary identification process in step S2 includes at least the following:
[0067] Seed distribution and sampling are introduced to obtain candidate motifs on fuzzy repeating intervals. Then, based on the frequency of candidate motifs and a motif identification strategy based on Markov chain, representative motifs are selected from the candidate motifs. The confused repeating intervals are divided into simple repeating intervals containing a single STR and confused repeating intervals containing multiple STRs. For ordinary repeating intervals, non-serialized repeating intervals are filtered using representative motifs. For confused repeating intervals, the initial screening boundaries of STRs are identified using representative motifs, thereby obtaining several simple repeating intervals.
[0068] The alignment module is used to obtain the number of inserted / deleted bases (Indel) and the number of matched bases (Match) of the identified STR sequence, in order to characterize the STR identification quality.
[0069] In four aspects, the present invention provides a computer device comprising: one or more processors and a memory storing one or more computer programs;
[0070] The processor invokes the computer program to implement the steps of a context-aware motif recognition-based STR detection method.
[0071] In five aspects, the present invention provides a computer-readable storage medium storing a computer program, which is called by a processor to implement the steps of a context-aware motif recognition-based STR detection method.
[0072] Beneficial effects
[0073] Compared with the existing method, the advantages of the present invention are:
[0074] The motif recognition strategy proposed in this invention, based on the frequency of alternative motifs (N-Gram model) and the idea of Markov chains, can identify representative motifs that can represent the entire STR within linear time complexity. The algorithm runs fast and the identified motifs are highly accurate. Thus, this invention uses representative motifs to accurately filter non-serialized repeating intervals and, for confused repeating intervals, obtains several simple repeating intervals more accurately, thereby improving the reliability and efficiency of STR detection results.
[0075] The segmented global sequence alignment algorithm employed in this invention first obtains a large number of error-free motif positions on a STR through perfect mark_motif matching. These positions do not require further alignment to find errors; only the remaining gap sequences need to be compared. Thus, for an extremely long STR, the actual sequence that needs to be aligned is only a very small segment, significantly reducing the alignment length and time complexity. Consequently, it can save considerable alignment time, even reducing it by orders of magnitude. Attached Figure Description
[0076] Figure 1 This is a flowchart provided in an embodiment of the present invention;
[0077] Figure 2 This is a diagram of the segmented global sequence alignment algorithm model, which is the core algorithm in FastSTR of this invention.
[0078] Figures 3-5 This invention relates to the distribution map of boundary errors in FastSTR, mreps, and treks for identifying STRs in experiments, wherein... Figure 3 This is a boundary error distribution map between FastSTR-identified STRs and the ground-truth. Figure 4 This is a boundary error distribution map of STRs and ground-truth identified by mreps. Figure 5 It is a t-reks identification map of the boundary error distribution between STRs and ground-truth. Detailed Implementation
[0079] This invention provides a context-aware motif-based STR detection method, offering a novel approach to optimize STR detection performance. The method involves constructing fuzzy repeat intervals corresponding to different motif lengths for each gene sequence fragment. Seed distribution and sampling techniques are then introduced to obtain candidate motifs within these fuzzy repeat intervals. Representative motifs are then selected from these candidate motifs based on their frequency and a Markov chain-based motif recognition strategy. These representative motifs are used to filter non-serialized repeat intervals. Furthermore, the representative motifs can be used to identify the initial screening boundaries of the STR, thereby dividing confusing repeat intervals into several simple repeat intervals. It should be understood that this approach can be integrated into existing STR detection technologies. The STR boundaries determined by this approach and the techniques for segmenting confusing repeat intervals can significantly improve STR detection performance. Alternatively, other improvements to this invention can be incorporated into the screening and boundary determination methods described in Example 1 below.
[0080] Based on the above ideas, the following embodiments use a gene sequence to be identified in a gene sequence file as an example for further explanation.
[0081] Example 1:
[0082] This invention provides a method for STR detection based on context-aware motif recognition, comprising the following steps:
[0083] Step 1: Read the gene sequence file and segment the gene sequence to obtain gene sequence fragments of uniform length with overlapping ends of adjacent segments. The segmentation is based on the input gene sequence fragment length and overlap length. The positions of the gene sequence fragments, represented by the formula, are as follows:
[0084] s i =i*(l r -o r )
[0085] e i =min(s) i +l r ,l seq )
[0086] In the formula, s i and e i The i-th segment refers to the start and end positions of the i-th segment. r and o r Refers to the length of gene sequence fragments and the length of overlap, l seq This refers to the length of the gene sequence to be segmented. It should be understood that in practical applications, l r and o r The value is set according to application requirements and precision, and this invention does not impose specific limitations on it.
[0087] Step 1 of this embodiment is implemented according to the following steps 1.1-1.2:
[0088] Step 1.1: Use the biopython library to read the FASTA file, convert all bases to uppercase, and store the sequence name and sequence in a dictionary.
[0089] Step 1.2: Divide each gene sequence into several fixed-length fragments with overlapping ends, and store the number of fragments for each gene sequence in a list (default value is fragment length 15000bp, overlap length 1000bp). For example, the fragment set obtained by segmenting the genome sequence of Drosophila melanogaster is shown in Table 1 below:
[0090] Table 1 Segmentation Set
[0091]
[0092]
[0093] Step 2: Parallel detection of short tandem repeat (STR) sequences on each gene sequence fragment. This embodiment preferably uses parallel execution of various sequence-based detections to progressively filter and select qualified STR sequences. The processing procedure for any gene sequence fragment in Step 2 of this embodiment is as follows:
[0094] Step 2.1: Define anchor points for gene sequence fragments and construct an anchor point set for each fragment. Anchor points are identical base pairs spaced n apart, where n is a predefined distance. This embodiment iterates through gene sequence fragments step by step, constructing corresponding anchor point sets based on motif lengths. For example, for the following 100bp gene sequence fragment, the anchor point set can be constructed as shown in the table below.
[0095] Table 2 Anchor set of gene sequence fragments
[0096]
[0097] Step 2.2: Determine the fuzzy repetition intervals corresponding to each motif length based on the anchor point set of each motif length. Fuzzy repetition refers to the existence of similar but not identical repetition patterns in a sequence. It should be understood that identifying fuzzy repetition intervals is already achievable with existing technology, and this invention does not specifically limit its implementation process. In this embodiment, it is preferred to cluster each anchor point set according to density clustering to obtain the fuzzy repetition intervals.
[0098] In this embodiment, when using density clustering, a radius of 14 and a minimum sample size of 14 are set to obtain fuzzy repeating intervals of each motif length. It should be understood that using density clustering to obtain fuzzy repeating intervals of each motif length is existing technology, and this invention does not provide a detailed description or limitation thereof; that is, the embodiments of this invention are not limited to using only density clustering techniques.
[0099] In some embodiments, it is also preferable to set filtering conditions based on the threshold set by the operating parameters and the length and number of anchor points of each fuzzy repeating interval, so as to initially filter out fuzzy repeating intervals that do not meet the conditions. The present invention does not impose specific limitations on the selected parameter values or setting conditions.
[0100] Step 2.3: Calculate the leading base density within each fuzzy repeat interval. Use the leading base density to filter out fuzzy repeat intervals with non-tandem repeat structures. Then, divide the remaining fuzzy repeat intervals into simple repeat intervals containing a single STR and confused repeat intervals containing multiple STRs. It should be understood that this step is a sub-step for filtering fuzzy repeat intervals.
[0101] The formula for the leading base density in this embodiment is as follows:
[0102]
[0103] Among them, l c The length of the inspection segment is set to l in this embodiment. c It is 25bp, N f_b This indicates the number of leading bases in the test segment. The test segment is the set window length; that is, it uses a sliding window approach, moving the window sequentially to obtain the number of leading bases N in the test segment at each position. f_b It should be understood that, in some embodiments, since an anchor point contains a leading base and a following base, the density of the following base or the combination of the leading base and the following base can be used to filter out undesirable fuzzy repetitive intervals.
[0104] In some embodiments, the window slides while also being based on the number of leader bases N at each position. f_b This is used to initially modify the true STR boundaries (i.e., modify the boundaries of fuzzy repeating intervals).
[0105] The rules for dividing simple repeating intervals and confusing repeating intervals in this embodiment are as follows:
[0106] The number of leading bases N is obtained every 5 bp. f_b (front_base_nums) forms the leading base vector (Q_support_domain_mod5) of the fuzzy interval. The variance among the elements in Q_support_domain_mod5 is calculated. Intervals with variances greater than a set value are considered normal repeat intervals, while those with variances less than a set value are considered confused repeat intervals. The set value is an empirical value, and this invention does not limit the specific value.
[0107] Step 2.4: Use the Tri-Gram model and Markov chain concept to obtain the representative motif for each fuzzy repeating interval, that is, obtain the representative motif for each ordinary repeating interval and the confused repeating interval. Specifically:
[0108] Traverse the fuzzy repeating intervals to count the frequencies of all 2-mer and 3-mer, and obtain the frequency sets bi_count and tri_count;
[0109] A 2-mer distribution set bi_pos is constructed based on the position of each 2-mer. Based on the 2-mer distribution set bi_pos, candidate motifs on the fuzzy repeating intervals are determined, resulting in a candidate motif set (alternative_motif). That is, starting with 2-mers, candidate motifs are selected based on their length.
[0110] In this embodiment, the frequency of all candidate motifs is calculated using the Tri-Gram model (formula below). If the motif length is less than 4, the candidate motif with the highest frequency is the representative motif of the fuzzy repetition interval. If the motif length is greater than or equal to 4, the candidate motifs with the highest frequency are selected as the representative motifs of the initial screening, and a second screening is required.
[0111] The formula for the frequency of candidate motifs is as follows:
[0112]
[0113] In the formula, P(motif) is the frequency of the candidate motif, and C(b i-2 b i-1 ) represents b in the fuzzy repeating interval i-2 b i-1 2-mer frequency, C(b) i-2 b i-1 b i ) represents b in the fuzzy repeating interval i-2 b i-1 b i 3-mer frequency, b i b i-1 b i-2 These are consecutive 3-mers from the candidate motifs, l motif Let P(b) be the length of the motif. i |b i-2 b i-1 ) is a known 2-mer of b i-2 b i-1 The next base is b. i The probability of.
[0114] For each fuzzy repeating interval, if its motif length is less than 4, the candidate motif with the highest frequency is selected as the representative motif of the fuzzy repeating interval; if the motif length is greater than or equal to 4, several candidate motifs with the highest frequency are selected as the representative motifs of the initial screening, and a second screening is performed.
[0115] The secondary screening process is as follows:
[0116] By introducing the Markov algorithm, a base transition matrix for fuzzy repeating intervals and a base transition matrix for representative motifs from the initial screening are constructed using the base composition before and after each 2-mer. It should be understood that the base transition matrix is the state transition matrix in the Markov algorithm. In this application, for the AGTC base type, the Markov algorithm is used to construct a 4x4 base transition matrix based on the transition probabilities from each base type to another. Since the Markov algorithm is existing technology, its implementation process will not be described in detail in this invention.
[0117] The two most frequent bases in the base transition matrix of the fuzzy repeating interval are obtained, and the estimated copy number of the fuzzy repeating interval is estimated based on the frequencies of these two bases. That is, the possible copy number of the fuzzy repeating interval is estimated using the Euclidean algorithm (formula below). f .
[0118]
[0119] l STR =u m ·copy t
[0120] copy f =α·copy t +(1-α)·copy e
[0121] In the formula, b j b k These are the frequencies of the two most frequent bases, gcd(b) j ,b k ) consists of two bases b j b k The greatest common factor of the frequencies, l STR Let u be the length of the STR, and let u be the length of the fuzzy repeating interval. m The length of the fuzzy repeating unit, i.e., the motif length.
[0122] In this embodiment, for each candidate motif, a copy vector of the representative motif of the initial screening is generated based on the base transfer matrix of the representative motif of the initial screening and the base transfer matrix of the fuzzy repeating interval. Based on the variance of the elements of the copy vector with respect to the estimated copy number, the representative motif of the initial screening with the smallest variance is selected as the representative motif of the secondary screening.
[0123] The copy vector (copy_vector) is calculated as follows:
[0124]
[0125] In the formula, copy_vector is the copy vector, C ij This represents the copy number of base i transferred to base j in the motif. The values of i and j are 1-4, corresponding to base types A, G, T, and C. The frequency of base i transitioning to base j in the base transfer matrix of the representative motif from the initial screening is shown. Let be the frequency at which base i is transferred to base j in the base transfer matrix of the fuzzy repeating interval.
[0126] C 11 C 12 ,…,C 1n C 21 C 22 ,…,C mn These are the copy numbers of the i-th base transferred to the j-th base in the candidate motif.
[0127] Step 2.5: For ordinary repeating intervals, filter non-serialized repeating intervals using representative motifs; for confused repeating intervals, divide them into simple repeating sub-intervals using representative motifs.
[0128] Ordinary repeating intervals: Representative motifs are mapped back to the original ordinary repeating intervals. Based on the sliding window concept, the window with the highest mapping score, max_score_windows, is obtained to filter non-serialized repeating intervals. Since this process is existing technology, it will not be described in detail.
[0129] Obfuscating repeated intervals: Construct a regular expression motif_regex based on representative motifs. This regular expression motif_regex is the 4-mer or 5-mer with the highest frequency in the sequence of representative motifs.
[0130] Starting from the beginning of the confused repeating interval, obtain each consecutive C perfect The distance between each motif_regex is used to calculate the average distance.
[0131] If the average distance is less than or equal to a preset threshold, the intervals containing the motif_regex are merged, and the traversal continues until a motif_regex is reached and the calculated average distance is greater than the preset threshold. The intervals containing the merged motif_regex are considered as one STR, and the current motif_regex being traversed is the boundary of the STR. This process is repeated to identify the initial screening boundary of each STR in the confusing repeating intervals, resulting in several simple repeating intervals.
[0132] Variable C perfect The formula is as follows:
[0133] C perfect ≈75 / u m
[0134] Among them, u m This refers to the set length of the fuzzy repeating unit, i.e., the motif length.
[0135] Step 2.6: Construct an alignment probe `align_probe` using the motif of each repeating interval, as follows:
[0136] align_probe = motif(25 / / l m )+motif[:25%l m ]
[0137] Among them, motif(25 / / l m ) and motif[:25%l m These are the motif lengths that are multiples of the original length and the remaining motif length, respectively. The alignment probe `align_probe` described above is a standard STR constructed based on the motif with a total length of 25bp.
[0138] Then, starting from both ends of the probe interval, a local sequence alignment algorithm is used to slide the alignment towards the middle of each repeating interval, that is, a 25bp sub-segment is acquired every 5bp and compared with align_probe. Whether to continue sliding is determined based on whether the alignment quality (match score match_score = 2, mismatch penalty mismatch_score = -3, gap penalty open_gap_score = -5) meets the set values. When sliding is no longer possible, the fuzzy boundary is determined, and the STR interval is further divided. It should be understood that the determination of whether to continue sliding is based on the alignment quality and the set values. The specific rules are set according to application requirements and accuracy requirements, and this invention does not impose specific limitations on this. Afterwards, adjacent STR intervals (preferably adjacent STRs with a spacing within the threshold range, the same motif, and a corresponding tandem repeating structure in the gap sequence) are merged and refined to finally obtain the approximate alignment boundary of each fuzzy repeating interval (STR).
[0139] Step 2.7: Based on the length of the STR sequence, select the appropriate local sequence alignment method and perform segmented global sequence alignment to determine the number of inserted / deleted bases (Indel) and the number of matched bases (Match). In this embodiment, for sequences to be aligned with repeat intervals shorter than 6000 bp, the Smith-Waterman local sequence alignment algorithm is used (using the PairwiseAligner() class from the biopython library). For very long repeat intervals exceeding 6000 bp, a segmented global sequence alignment algorithm is used.
[0140] It should be noted that step 2.6 in this embodiment is regarded as a sub-step of identifying the STR position / boundary of the fuzzy repeating interval to obtain the STR sequence, that is, identifying the boundary of the STR sequence.
[0141] It should be understood that the Smith-Waterman local sequence alignment algorithm is existing technology, and this invention does not specifically limit it. By comparing and determining the number of inserted / deleted bases (Indel) and the number of matched bases (Match), the detection quality of the STR can be calculated. For example, in this embodiment, the insertion / deletion percentage (P) is defined. Indel And matching percentage P Match The formula is as follows, and then based on the insertion / deletion percentage P. Indel And matching percentage P Match The present invention does not limit the specific evaluation criteria for describing the detection quality of STRs, and the following exist:
[0142]
[0143] Where, N mismatch The number of mismatched bases, N insert N represents the number of bases inserted. delete The number of bases deleted, l STR The length of the STR sequence.
[0144] The segmented global sequence alignment process is as follows:
[0145] First, a corresponding marker motif is constructed based on the representative motifs on the STR sequence. The marker motif is a motif sequence with a length of 3bp to 8bp.
[0146] Secondly, use the compile function from the regular expression library to find all positions that perfectly match mark_motif;
[0147] Furthermore, the sequence intervals between adjacent perfect matches mark_motif are marked as matching gap sequences, and then a standard STR of multiple motif length is constructed for the matching gap sequences;
[0148] Then, the standard STR is compared with the matching gap sequence, and the number of inserted or deleted bases N in the matching gap sequence is counted. indel and the number of matching bases N match N insert N delete These represent the number of bases inserted and the number of bases deleted, respectively.
[0149] The sequence in which the positions of multiple perfectly matching mark_motifs overlap is considered a chaotic sequence.
[0150] Merge the sequences containing these perfect match marks one by one until a non-overlapping perfect match mark is found. Then, use a global sequence algorithm to obtain the number of inserted and deleted bases N in the chaotic sequence. indel and the number of matching bases N match ;
[0151] Finally, N is obtained from all the comparisons. indel and N match The number of inserted / deleted bases (Indel) and the number of matched bases (Match) for the entire sequence are summed separately.
[0152] exist:
[0153] Indel=∑N indel
[0154] Match = ∑N match
[0155] like Figure 2 As shown, the motif of the STR to be aligned is AGA. First, perfect matching mark_motifs (dark gray area) are performed. Then, for gap sequences that do not perfectly match (white area), standard STR sequences with integer multiples of the corresponding motifs are constructed for global sequence alignment, ensuring that they form complete cascaded repeat sequences when connected with the preceding and following perfect matching mark_motifs. Sequences with overlapping perfect matching mark_motif positions are treated as chaotic sequences (light gray area), and standard STRs with integer multiples of the motifs are constructed for alignment. Finally, the alignment quality of the entire STR sequence is obtained by summing all the alignment results.
[0156] The formulas for calculating the alignment score and the number of inserted, deleted, and mismatched bases when aligning each gap sequence in the segmented global sequence alignment algorithm are as follows:
[0157] N match +N mismatch +N insert =l STR
[0158] N matc h·α+N mismatc h·β+(N insert +N delete )·γ=S align
[0159]
[0160] The matching score of the segmented global alignment algorithm is α, the mismatch penalty is β, and the empty space penalty is γ.STR S is the length of the gap sequence. align For gap sequence alignment scores, This is the length of the standard STR corresponding to this gap sequence after comparison.
[0161] Step 3: Summarize the detected STRs from multiple segments to obtain the final recognition result.
[0162] It should be understood that overlapping regions exist during gene segmentation in step 1. Therefore, when merging STRs of adjacent segments, overlapping STRs may occur. Considering that there are only four types of overlap: left overlap, right overlap, coincidence, and interpenetration, and that there are exactly two overlapping STRs, the two repetitive sequences are directly merged based on their relative positions during merging. Simultaneously, an array is constructed to store the extremely long STRs spanning multiple segments. Specific merging rules exist in the art, and this invention does not limit them.
[0163] For multiple overlapping STRs in the same interval, the minimum threshold P_th_profit that an interval must be retained is first calculated based on the selection strategy of the interval gain decision algorithm, and the formula is defined as follows.
[0164]
[0165] If one of the multiple overlapping STRs has a length that is less than P_th_profit in the range, while another STR has a length that is more than 80% in the range, then the gain values of the two STRs need to be calculated according to the gain formula. Only if the gain value is non-negative can the STR be retained; otherwise, it will be discarded.
[0166] An overlapping STRs selection strategy based on an interval gain decision algorithm is adopted. This strategy analyzes whether a STR is worth mining within an interval to determine whether it should be retained. The mining gain formula is defined as follows:
[0167]
[0168] in, To reduce costs, the number of edits required to transform the marked interval into a specific STR is determined. To extract revenue, i.e., the standard STR length corresponding to this STR. Combining the previous calculation formulas, we have:
[0169]
[0170] In the formula, λ is the proportion of the STR length to the interval length, and L markThis represents the length of the interval containing the overlapping STRs. It should be understood that in this embodiment, step 1 involves dividing the gene fragments; therefore, step 3 first performs merging and then selects the STRs to retain based on gain. In other feasible embodiments, if fragment division is not performed, step 3 is adjusted accordingly without affecting the selection of the STRs to retain based on gain.
[0171] To evaluate the experimental performance and recognition effect of the method described in this invention, the genome of *Drosophila melanogaster* was used as test data. TRF was used to identify *Drosophila melanogaster* STRs as a benchmark dataset, and the results were compared with those of mreps and T-Reks tools. We compared the recall, precision, percentage of interval boundaries less than 50 bp, and running time of each tool for identifying individual chromosomes and the entire genome. Specific results are shown in Tables 3-4 below. This invention was run using default parameters: fragment length 15000, overlap length 1000, sequence alignment parameters: match score 2, mismatch penalty -3, gap penalty -5, alignment score threshold 50, match percentage threshold 0.8, and insertion / deletion percentage threshold 0.15. Results were obtained by running on a 70-core CPU.
[0172] Table 3 Comparison of the recognition capabilities of various tools
[0173]
[0174]
[0175] Table 4 Comparison of runtime for each tool
[0176] Gene TRF mreps T-reks FastSTR Chr2L 0:0:36 0:1:14 3:00:02 0:0:18 Chr2R 0:0:41 0:1:22 3:14:54 0:0:18 Chr3L 0:0:46 0:1:22 3:33:47 0:0:21 Chr3R 0:3:04 0:1:38. 4:15:38 0:0:24 Chr4 0:0:03 0:0:03 0:10:01 0:0:02 ChrX 0:0:51 0:2:20 3:02:44 0:0:20 ChrY 0:0:06 0:0:0.06 0:26:15 0:0:03 All 0:7:36 0:08:11 19:27:36 0:1:47
[0177] Tables 3 and 4 detail the performance and runtime of each tool in identifying STRs. Recall, precision, and boundary error percentage are compared with the results of TRF identification as ground truth. It can be seen that the technical solution of this invention (referred to as the tool FastSTR) achieves a precision of over 99%, indicating that FastSTR has a very strong ability to identify real STRs and identifies very few false positive STRs. Simultaneously, FastSTR's recall reaches 90%, indicating that FastSTR can accurately and comprehensively detect the vast majority of real STRs. In contrast, although mreps achieves a recall of 98%, its precision is only about 14%, indicating that mreps sacrifices precision to ensure comprehensive detection of real STRs. T-Rkes, on the other hand, has very low recall and precision, resulting in even worse identification performance. On the other hand, FastSTR identifies over 99% of the true STRs with boundary differences within 50bp, corresponding to 98% for mreps and 95% for t-rkes, and the vast majority of the boundary differences of the STRs identified by FastSTR are concentrated around 0bp. Figures 3-5 This level of precision, unmatched by the other two tools, further illustrates the comprehensiveness and accuracy of FastSTR in identifying true STRs. Observing the runtime of each tool on different chromosomes and the entire genome reveals that FastSTR is significantly faster than other tools, including TRF. Furthermore, the runtime differences between TRF, mreps, and T-reks on different chromosomes are substantial, indicating that their runtime is strongly dependent on chromosome length and STR distribution. In contrast, FastSTR's runtime is similar across different chromosomes, suggesting that FastSTR's runtime does not significantly change with chromosome length and STR distribution. This is highly valuable for estimating the runtime of tasks involving the detection of STR distribution in new genomes.
[0178] In some embodiments, the present invention also provides an STR detection system based on the above-described STR detection method, comprising: a fuzzy repeating interval construction module, a screening and identification module, and a comparison module.
[0179] The fuzzy repeat interval construction module is used to obtain fuzzy repeat intervals corresponding to different motif lengths for the gene sequence fragment to be detected.
[0180] The filtering and identification module is used to filter the fuzzy repeating intervals and identify the STR positions / boundaries of the fuzzy repeating intervals to obtain STR sequences;
[0181] The filtering and boundary identification process in step S2 includes at least the following:
[0182] Seed distribution and sampling are introduced to obtain candidate motifs on fuzzy repeating intervals. Then, based on the frequency of candidate motifs and a motif identification strategy based on Markov chain, representative motifs are selected from the candidate motifs. The confused repeating intervals are divided into simple repeating intervals containing a single STR and confused repeating intervals containing multiple STRs. For ordinary repeating intervals, non-serialized repeating intervals are filtered using representative motifs. For confused repeating intervals, the initial screening boundaries of STRs are identified using representative motifs, thereby obtaining several simple repeating intervals.
[0183] The alignment module is used to obtain the number of inserted / deleted bases (Indel) and the number of matched bases (Match) of the identified STR sequence, in order to characterize the STR identification quality.
[0184] In some embodiments, the STR detection system further includes a segmentation module and a merging module. The segmentation module reads the gene sequence file and segments the gene sequence to obtain gene sequence fragments of uniform length with overlapping ends of adjacent segments. Then, it uses a fuzzy repeat interval construction module, a screening and identification module, and a comparison module to obtain the STR detection result for each gene fragment. The merging module merges the overlapping STRs on adjacent fragments to obtain the STR identification result of the gene sequence.
[0185] It should be understood that the specific implementation process of each module is described in the above method. This invention will not repeat the details here. The above division of functional modules is only for illustrative purposes. In some embodiments, some functional modules can be combined and some functional modules can be separated. Each functional module can be implemented in software, hardware, or a combination of software and hardware. The software and hardware devices include, but are not limited to, general-purpose computer equipment, programmable gate arrays, digital signal processors, microprocessors and their corresponding programming or burning software.
[0186] In some embodiments, the present invention also provides a computer device including one or more processors;
[0187] A memory that stores one or more computer programs;
[0188] The processor invokes the computer program to implement the following steps of a context-aware motif recognition-based STR detection method.
[0189] In some instances, the specific execution is as follows:
[0190] S1: For the gene sequence fragment to be detected, obtain the fuzzy repeat intervals corresponding to different motif lengths;
[0191] S2: Filter the fuzzy repeating intervals and identify the STR positions / boundaries of the fuzzy repeating intervals to obtain the STR sequence;
[0192] The filtering and boundary identification process in step S2 includes at least the following:
[0193] Seed distribution and sampling are introduced to obtain candidate motifs on fuzzy repeating intervals. Then, based on the frequency of candidate motifs and a motif identification strategy based on Markov chain, representative motifs are selected from the candidate motifs. The confused repeating intervals are divided into simple repeating intervals containing a single STR and confused repeating intervals containing multiple STRs. For ordinary repeating intervals, non-serialized repeating intervals are filtered using representative motifs. For confused repeating intervals, the initial screening boundaries of STRs are identified using representative motifs, thereby obtaining several simple repeating intervals.
[0194] S3: Obtain the number of inserted / deleted bases (Indel) and the number of matched bases (Match) of the identified STR sequence to characterize the STR identification quality.
[0195] In some instances, steps 1-3 of Embodiment 1 above are specifically executed.
[0196] For the specific implementation process of each step, please refer to the description of the above method.
[0197] It should be understood that, in the embodiments of the present invention, the processor may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. The memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also store device type information.
[0198] In some embodiments, the present invention also provides a computer-readable storage medium storing a computer program that is invoked by a processor to implement: a method for STR detection based on context-aware motif recognition.
[0199] In some instances, the specific execution is as follows:
[0200] S1: For the gene sequence fragment to be detected, obtain the fuzzy repeat intervals corresponding to different motif lengths;
[0201] S2: Filter the fuzzy repeating intervals and identify the STR positions / boundaries of the fuzzy repeating intervals to obtain the STR sequence;
[0202] The filtering and boundary identification process in step S2 includes at least the following:
[0203] Seed distribution and sampling are introduced to obtain candidate motifs on fuzzy repeating intervals. Then, based on the frequency of candidate motifs and a motif identification strategy based on Markov chain, representative motifs are selected from the candidate motifs. The confused repeating intervals are divided into simple repeating intervals containing a single STR and confused repeating intervals containing multiple STRs. For ordinary repeating intervals, non-serialized repeating intervals are filtered using representative motifs. For confused repeating intervals, the initial screening boundaries of STRs are identified using representative motifs, thereby obtaining several simple repeating intervals.
[0204] S3: Obtain the number of inserted / deleted bases (Indel) and the number of matched bases (Match) of the identified STR sequence to characterize the STR identification quality.
[0205] In some instances, steps 1-3 of Embodiment 1 above are specifically executed.
[0206] For the specific implementation process of each step, please refer to the description of the above method.
[0207] The readable storage medium is a computer-readable storage medium, which can be an internal storage unit of the hardware and software device described in any of the foregoing embodiments, such as the hard drive or memory of the controller. The readable storage medium can also be an external storage device of the controller, such as a plug-in hard drive, Smart MediaCard (SMC), Secure Digital (SD) card, or Flash Card equipped on the controller. Further, the readable storage medium can include both internal storage units and external storage devices of the controller. The readable storage medium is used to store the computer program and other programs and data required by the controller. The readable storage medium can also be used to temporarily store data that has been output or will be output.
[0208] Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned readable storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0209] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This application refers to flowchart illustrations and / or instructions executed by a processor of a method, apparatus (system), and computer program product according to embodiments of this application to create means for implementing the functions specified in one or more flowchart illustrations and / or one or more block diagrams. These computer program instructions may also be stored in a computer-readable storage medium capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowchart illustrations and / or one or more block diagrams. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of a block diagram.
[0210] It should be emphasized that the examples described in this invention are illustrative rather than limiting. Therefore, this invention is not limited to the examples described in the specific embodiments. Any other embodiments derived by those skilled in the art based on the technical solutions of this invention, without departing from the spirit and scope of this invention, whether modifications or substitutions, are also within the protection scope of this invention.
Claims
1. A method for STR detection based on context-aware motif recognition, characterized in that: The following steps are involved: S1: For the gene sequence fragment to be detected, obtain the fuzzy repeat intervals corresponding to different motif lengths; S2: Filter the fuzzy repeating intervals and identify the STR positions / boundaries of the fuzzy repeating intervals to obtain the STR sequence; The filtering and boundary identification process in step S2 includes at least the following: Seed distribution and sampling are introduced to obtain candidate motifs on fuzzy repeating intervals. Then, based on the frequency of candidate motifs and a motif identification strategy based on Markov chain, representative motifs are selected from the candidate motifs. The confused repeating intervals are divided into simple repeating intervals containing a single STR and confused repeating intervals containing multiple STRs. For ordinary repeating intervals, non-serialized repeating intervals are filtered using representative motifs. For confused repeating intervals, the initial screening boundaries of STRs are identified using representative motifs, thereby obtaining several simple repeating intervals. S3: Obtain the number of inserted / deleted bases (Indel) and the number of matched bases (Match) of the identified STR sequence to characterize the STR identification quality.
2. The method according to claim 1, characterized in that: The motif identification strategy based on the frequency of candidate motifs and the Markov chain concept is as follows: First, calculate the frequency of each candidate motif in the fuzzy repetition interval; Secondly, if the motif length is less than 4, the candidate motif with the highest frequency is selected as the representative motif of the fuzzy repeating interval; if the motif length is greater than or equal to 4, the candidate motifs with the highest frequency are selected as the representative motifs of the initial screening, and a second screening is performed. The second screening is as follows: Based on the idea of Markov chains, a base transfer matrix of fuzzy repeating intervals is generated, and then the two bases with the highest frequency in the base transfer matrix of the fuzzy repeating intervals are obtained. The estimated copy number of the fuzzy repeat interval is estimated based on the frequency of the two bases. Based on the Markov chain concept, the base transfer matrix of the representative motif initially screened in the fuzzy repeating interval is generated. Based on the base transfer matrix of the representative motifs from the initial screening and the base transfer matrix of the fuzzy repeating intervals, a copy vector of the representative motifs from the initial screening is generated. The representative motif with the smallest variance between the elements of the copy vector and the estimated copy number is selected as the representative motif for the second screening. Alternatively, based on the base transfer matrix of the representative motifs from the initial screening, the representative motif for the second screening is selected based on whether the base transfer copy number of the representative motifs from the initial screening is balanced and close to the estimated copy number of the fuzzy repeating intervals. exist; In the formula, copy_vector is the copy vector, C ij This represents the copy number of base i transferred to base j in the motif. The values of i and j are 1-4, corresponding to base types A, G, T, and C. The frequency of base i transitioning to base j in the base transfer matrix of the representative motif from the initial screening is shown. Let be the frequency at which base i is transferred to base j in the base transfer matrix of the fuzzy repeating interval.
3. The method according to claim 2, characterized in that: The process of estimating the predicted copy number of the fuzzy repeating interval based on the frequency of the two bases is described by the following formula: copy f =α·copy t +(1-α)·copy e In the formula, copy f For the estimated copy number of fuzzy repeating intervals, α is the weight of the nominal copy number. e For the greatest common divisor, copy t Let the nominal copy number satisfy: l STR =u m ·copy t In the formula, b j b k These are the frequencies of the two most frequent bases, gcd(b) j ,b k ) consists of two bases b j b k The greatest common factor of the frequencies, l STR Let u be the length of the STR, and let u be the length of the fuzzy repeating interval. m The length of the fuzzy repeating unit, i.e., the motif length.
4. The method according to claim 2, characterized in that: introducing... The Tri-Gram model calculates the frequency of each candidate motif in the fuzzy repeat interval, as follows: In the formula, P(motif) represents the frequency of the candidate motif, and b i b i-1 b i-2 These are consecutive 3-mers from the candidate motifs, C(b) i-2 b i-1 b i ) represents b in the same fuzzy repeating interval i-2 b i-1 b i 3-mer frequency, C(b) i-2 b i-1 ) represents b in the same fuzzy repeating interval i-2 b i-1 2-mer frequency, l motif To determine the length of the candidate motif, P(b) i |b i-2 b i-1 ) is a known 2-mer of b i-2 b i-1 The next base is b. i The probability of; Among them, the candidate motifs are selected by filtering out all candidate motifs in the fuzzy repeating interval, starting with 2-mer.
5. The method according to claim 1, characterized in that: To identify the initial screening boundaries of STRs by using representative motifs to target confusing repeating intervals, and then obtain several simple repeating intervals, the process is as follows: A regular expression motif_regex is constructed based on representative motifs. The regular expression motif_regex is the 4-mer or 5-mer with the highest frequency in the sequence of representative motifs. Starting from the beginning of the confused repeating interval, obtain each consecutive C perfect The distance between each motif_regex is then used to calculate the average distance, variable C. perfect ≈75 / u m u m This refers to the set length of the fuzzy repeating unit, i.e., the motif length; If the average distance is less than or equal to a preset threshold, the intervals containing the motif_regex are merged, and the traversal continues until a motif_regex is reached and the calculated average distance is greater than the preset threshold. The intervals containing the merged motif_regex are considered as one STR, and the current motif_regex being traversed is the boundary of the STR. This process is repeated to identify the initial screening boundary of each STR in the confusing repeating intervals, resulting in several simple repeating intervals.
6. The method according to claim 1, characterized in that: In step S3, based on the length of the STR sequence, the local sequence alignment method or segmented global sequence alignment is selected to determine the number of inserted / deleted bases (Indel) and the number of matched bases (Match); The segmented global sequence alignment process is as follows: First, a corresponding marker motif is constructed based on the representative motifs on the STR sequence. The marker motif is a motif sequence with a length of 3bp to 8bp. Secondly, use the compile function from the regular expression library to find all positions that perfectly match mark_motif; Furthermore, the sequence intervals between adjacent perfect matches mark_motif are marked as matching gap sequences, and then a standard STR of multiple motif length is constructed for the matching gap sequences; Then, the standard STR is compared with the matching gap sequence, and the number of inserted or deleted bases N in the matching gap sequence is counted. indel and the number of matching bases N match N insert N delete These represent the number of bases inserted and the number of bases deleted, respectively. The sequence in which the positions of multiple perfectly matching mark_motifs overlap is considered a chaotic sequence. The sequences corresponding to perfect match mark_motifs are merged one by one until a non-overlapping perfect match mark_motif is encountered. Then, the number of inserted and deleted bases N in the chaotic sequence is obtained by comparing gap sequences using the same method in the global sequence algorithm. indel and the number of matching bases N match ; Finally, N is obtained from all the comparisons. indel and N match The number of inserted / deleted bases (Indel) and the number of matched bases (Match) for the entire sequence are summed separately.
7. An STR detection method based on any one of claims 1-6, characterized in that: include: Step 1: Read the gene sequence file and segment the gene sequence to obtain gene sequence fragments of uniform length with overlapping ends of adjacent segments; Step 2: Using the method described in claim 1, short tandem repeat sequences (STRs) on each gene sequence fragment are detected in parallel; Step 3: Merge overlapping STRs on adjacent segments to obtain STR identification results for gene sequences, and determine whether to retain STRs for multiple overlapping STRs in the same interval based on the gain magnitude; Specifically, if one of the overlapping STRs has a length ratio interval shorter than the minimum length threshold P_th_profit, while another STR has a length ratio interval exceeding 80%, the STR with a non-negative gain among the two STRs is retained; otherwise, it is discarded.
8. An STR detection system based on the method of any one of claims 1-7, characterized in that: At least include: The fuzzy repeat interval construction module is used to obtain fuzzy repeat intervals corresponding to different motif lengths for the gene sequence fragment to be detected. The filtering and identification module is used to filter the fuzzy repeating intervals and identify the STR positions / boundaries of the fuzzy repeating intervals to obtain STR sequences. The filtering and boundary identification process in step S2 includes at least the following: Seed distribution and sampling are introduced to obtain candidate motifs on fuzzy repeating intervals. Then, based on the frequency of candidate motifs and a motif identification strategy based on Markov chain, representative motifs are selected from the candidate motifs. The confused repeating intervals are divided into simple repeating intervals containing a single STR and confused repeating intervals containing multiple STRs. For ordinary repeating intervals, non-serialized repeating intervals are filtered using representative motifs. For confused repeating intervals, the initial screening boundaries of STRs are identified using representative motifs, thereby obtaining several simple repeating intervals. The alignment module is used to obtain the number of inserted / deleted bases (Indel) and the number of matched bases (Match) of the identified STR sequence, in order to characterize the STR identification quality.
9. A computer device, characterized in that: include: one or more processors; A memory that stores one or more computer programs; The processor invokes the computer program to implement the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: A computer program is stored, which is invoked by a processor to implement the steps of the method according to any one of claims 1-7.