A method and system for inferring the ancestral origins of inbred line genomes based on pedigree constraints
Patent Information
- Application Number
- CN202611217061.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-12
- Publication Date
- 2026-10-09
AI Technical Summary
[0041]本申请提出的一种基于系谱约束的自交系基因组祖源推断方法及系统,至少能够推断每个区段来源于哪个创始亲本,便于育种家据此了解优良性状的遗传来源,指导后续的回交和聚合育种决策。
Smart Images

Figure CN122889050A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of gene inference technology, and more specifically, to a method and system for inferring the genomic ancestry of inbred lines based on pedigree constraints. Background Technology
[0002] In crop breeding, a superior line typically originates from multiple parental materials. Through generations of hybridization and self-pollination, the desirable traits of different parents are gradually aggregated. After the line is developed, a core question is: from which founding parent do each segment of the line's genome originate? The professional term for this question is genomic ancestry deduction—given a pedigree record and a set of SNP genotype data for a line, each chromosome of the target line is divided into continuous segments, and the origin of each segment is deduced. Breeders can use this information to understand the genetic source of desirable traits, guiding subsequent backcrossing and aggregation breeding decisions. Currently, there are not many tools on the market that can accomplish this task. Summary of the Invention
[0003] In view of this, the present invention discloses a method and system for inferring the genomic ancestry of inbred lines based on pedigree constraints, which can at least infer which founding parent each segment originated from, so that breeders can understand the genetic origin of superior traits and guide subsequent backcrossing and aggregation breeding decisions.
[0004] Specifically, the present invention is achieved through the following technical solutions:
[0005] On the one hand, this application proposes a method for inferring the genomic ancestry of inbred lines based on pedigree constraints, the method comprising:
[0006] Read the pedigree file and VCF file, construct the pedigree directed acyclic graph, and perform a depth-first search backtracking starting from the target individual to extract all nodes without parental records as the founding parent set;
[0007] Chromosome-by-chromosome scanning of the VCF file. For each SNP locus, genotype values of all founding parents were extracted, and multiple informative SNPs were identified based on these genotype values.
[0008] The filtered informative SNPs are divided into non-overlapping windows of a fixed window size, and the log emission probability of each window corresponding to each founding parent is determined based on each window and each founding parent.
[0009] Based on the pre-constructed uniform transition matrix, the marginal posterior probability of each window belonging to each original parent is obtained according to the log emission probability of each window corresponding to the original parent.
[0010] Scan the state sequence output by Viterbi along each chromosome from front to back, merge adjacent consecutive windows that are assigned to the same founding parent into a single ancestral segment, and obtain multiple ancestral segments.
[0011] Based on the logarithmic emission probability, uniform transition matrix, and multiple ancestral segments corresponding to each window for the corresponding primordial parent, determine multiple output files, including: ancestral segment file, window-level posterior probability file, and whole-genome contribution ratio file for each primordial parent.
[0012] In some embodiments, multiple informative SNPs are determined through the following steps:
[0013] If all founding parents have identical genotypes at this locus, then that locus is skipped; only loci where at least one pair of founding parents have different genotypes are retained as informative SNPs.
[0014] In some embodiments, determining the logarithmic emission probability of a window for a given parent based on each window and each parent parent includes:
[0015] For each window and each founding parent, count the number of target individuals within the window whose genotypes match the founding parent at valid loci (neither of which are deleted), divide this number by the total number of valid loci to obtain the IBS matching ratio. Multiply this ratio by the emission intensity adjustment parameter (default 10) and take the natural logarithm to obtain the log-emission probability of the window corresponding to the founding parent.
[0016] In some embodiments, based on a pre-constructed uniform transition matrix, the marginal posterior probability of each window belonging to each originating parent is obtained according to the logarithmic emission probability of each window corresponding to the originating parent, including:
[0017] For each window and each founding parent, calculate the IBS matching ratio and natural log number of each target individual with that founding parent at the effective loci within the window;
[0018] The log-emission matrix is determined based on the IBS matching ratio and natural logarithm of each target individual with the founding parent at effective loci within the window.
[0019] Based on the logarithmic emission matrix and the pre-constructed uniform transition matrix, the Viterbi algorithm is executed in the full logarithmic space to obtain the most likely parental state for each window;
[0020] Execute the Forward-Backward algorithm to obtain the marginal posterior probability of each window belonging to each founding parent.
[0021] In some embodiments, the self-transition probability of the uniform transition matrix is 1-ε, and the cross-state transition probability is ε / (K-1), where K is the number of original parents.
[0022] In some embodiments, the state sequence output by Viterbi is scanned from front to back along each chromosome, and adjacent consecutive windows assigned to the same founding parent are merged into a single ancestral segment, resulting in multiple ancestral segments, including:
[0023] Consecutive windows that are adjacent and assigned to the same founding parent are merged into one ancestral segment;
[0024] The information recorded in each segment includes: the genome start coordinates, the end coordinates, the assigned founding parent identity, and the average of the maximum posterior probabilities of all windows within that segment.
[0025] In some embodiments, the ancestry segment file includes: coordinates, founding parent identity, and confidence level;
[0026] The window-level posterior probability file supports both wide and long output modes.
[0027] In some embodiments, the pedigree file is in a space-separated "offspring-parent-parent" format, with one parent-offspring relationship per line;
[0028] Individuals without parental records are considered founding parents;
[0029] The VCF file must include the target individual and all ancestral individuals in the pedigree;
[0030] The SNP screening module simultaneously calculates the missing rate and heterozygosity rate of each sample during the scanning process, outputs the data to the standard error stream, and marks and prompts samples with a missing rate exceeding the first proportion or a heterozygosity rate exceeding the second proportion.
[0031] In some embodiments, window merging is performed through the following steps:
[0032] If the maximum posterior probability of all windows within a segment is close to 1.0, then the confidence level is close to 1.0.
[0033] If there is a state dispute between windows within the segment, it is determined that the posterior probability of some windows is dispersed among multiple founding parents, and the confidence level is reduced accordingly.
[0034] On the other hand, this application also provides a pedigree-constrained inbred line genome ancestry inference system, the system comprising:
[0035] The file reading module 101 is used to read pedigree files and VCF files, construct a directed acyclic graph of pedigrees, and perform a depth-first search backtracking starting from the target individual to extract all nodes without parental records as the set of founding parents.
[0036] SNP determination module 102 is used to scan the VCF file chromosome by chromosome. For each SNP locus, genotype values of all founding parents are extracted, and multiple informative SNPs are determined based on the genotype values.
[0037] The log emission probability determination module 103 is used to divide the screened informative SNPs into non-overlapping windows of a fixed window size, and determine the log emission probability of the window corresponding to the original parent based on each window and each original parent.
[0038] The edge posterior probability determination module 104 is used to obtain the edge posterior probability of each window belonging to each original parent based on the pre-constructed uniform transition matrix and the log emission probability of each window corresponding to the original parent.
[0039] The ancestral segment determination module 105 is used to scan the state sequence output by Viterbi along each chromosome from front to back, and merge adjacent consecutive windows that are assigned to the same founding parent into one ancestral segment to obtain multiple ancestral segments.
[0040] The file output module 106 is used to determine multiple output files based on the logarithmic emission probability, uniform transition matrix, and multiple ancestral segments corresponding to each window for the corresponding primordial parent. These multiple output files include: ancestral segment file, window-level posterior probability file, and contribution ratio file of each primordial parent for the whole genome.
[0041] This application proposes a pedigree-constrained method and system for inferring the genomic ancestry of inbred lines, which can at least infer which founding parent each segment originated from, enabling breeders to understand the genetic origin of desirable traits and guide subsequent backcrossing and aggregation breeding decisions. Attached Figure Description
[0042] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0043] Figure 1 A schematic diagram illustrating a process for inferring the genomic ancestry of inbred lines based on pedigree constraints, provided as an embodiment of this application;
[0044] Figure 2 This is a schematic diagram of the architecture for inbred line genomic ancestry inference based on pedigree constraints provided in an embodiment of this application;
[0045] Figure 3 This is a schematic diagram of the structure of an inbred line genome ancestry inference system based on pedigree constraints, provided in an embodiment of this application. Detailed Implementation
[0046] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of systems and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0047] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0048] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0049] This application relates to the field of gene inference technology, and more specifically, to a method and system for inferring the ancestry of inbred lines based on pedigree constraints.
[0050] In crop breeding, a superior line typically originates from multiple parental materials. Through generations of hybridization and self-pollination, the desirable traits of different parents are gradually aggregated. After the line is developed, a core question is: from which founding parent do each segment of the line's genome originate? The professional term for this question is genomic ancestry deduction—given a pedigree record and a set of SNP genotype data for a line, each chromosome of the target line is divided into continuous segments, and the origin of each segment is deduced. Breeders can use this information to understand the genetic source of desirable traits, guiding subsequent backcrossing and aggregation breeding decisions. Currently, there are not many tools on the market that can accomplish this task.
[0051] The relevant technologies can be roughly divided into the following categories, each with its own shortcomings.
[0052] Methods based on Hidden Markov Models (HMMs) and utilizing pedigree information, exemplified by GAIN, rely on the idea of using HMMs to infer ancestry along chromosomes. However, its mathematical derivation is deeply tied to the funnel-shaped mating design of mouse Collaborative Crosses. The pedigrees of crops like rice are far less regular: three-way crosses, backcrosses, and multi-parental stepwise aggregation are common, resulting in diverse pedigree structures. GAIN lacks universality for these types of pedigrees. Furthermore, GAIN's transfer probability calculation depends on genetic maps and inbreeding coefficients, while most crop breeding projects do not possess high-resolution genetic maps.
[0053] The pedigree consistency (IBD)-based retrospective method uses IBD detection tools to compare pairwise chromosome segments of all samples within the pedigree, and then traces the origin of each segment based on local three-generation kinship. Its limitation lies in relying only on local three-generation relationships and not establishing a whole-genome probabilistic model, resulting in a significant decrease in inference accuracy at the boundaries of continuous segments.
[0054] This method, based on a population reference panel, uses the RFMix tool and requires reference genotype sets from two parental populations to construct an ancestral haplotype frequency model before inferring the ancestral origin of each segment in offspring. Its limitations are twofold: first, it only supports two ancestral populations and cannot handle multi-generational hybridization-self-fertilization scenarios with three or more founding parents; second, the output is a population origin code (0 / 1 / 2, representing the copy number from ancestor 1), rather than specifying the attribution information of the founding parent individual. The ultimate goal of this method is to locate phenotypic-associated genomic segments, without providing a specific assignment of which founding parent individual the segment originates from.
[0055] Furthermore, existing methods share a common drawback: they do not utilize pedigree priors to assess SNP information content. If all candidate founding parents have identical genotypes for a given SNP locus, that locus contributes nothing to ancestry determination. Retaining such loci only increases computational cost, and existing methods either omit screening or employ general filtering strategies unrelated to pedigree (such as linkage disequilibrium pruning).
[0056] At the engineering level, most existing tools are implemented in C / C++ or R. For breeding data analysis teams that primarily use Python, deploying and integrating these tools presents an additional barrier to entry.
[0057] Based on this, this application proposes a method and system for inferring the genomic ancestry of inbred lines based on pedigree constraints.
[0058] Please see Figure 1 This application discloses a flowchart illustrating a method for inferring the genomic ancestry of inbred lines based on pedigree constraints. For example... Figure 1As shown, the pedigree-constrained inbred line genomic ancestry inference method includes:
[0059] S101. Read the pedigree file and VCF file, construct a directed acyclic pedigree graph, and perform a depth-first search backtracking starting from the target individual to extract all nodes without parental records as the founding parent set.
[0060] The pedigree file is in a space-separated "offspring-father-mother" format, with one parent-offspring relationship per line;
[0061] Individuals without parental records are considered founding parents;
[0062] The VCF file must include the target individual and all ancestral individuals in the pedigree;
[0063] The SNP screening module simultaneously calculates the missing rate and heterozygosity rate of each sample during the scanning process, outputs the data to the standard error stream, and marks and prompts samples with a missing rate exceeding the first proportion or a heterozygosity rate exceeding the second proportion.
[0064] S102. Scan the VCF file chromosome by chromosome. For each SNP locus, extract the genotype values of all founding parents, and determine multiple informative SNPs based on the genotype values.
[0065] Specifically, multiple informative SNPs can be identified through the following steps:
[0066] If all founding parents have identical genotypes at this locus, then that locus is skipped; only loci where at least one pair of founding parents have different genotypes are retained as informative SNPs.
[0067] S103. Divide the filtered informative SNPs into non-overlapping windows of a fixed window size, and determine the logarithmic emission probability of each window for each founding parent based on each window and each founding parent.
[0068] Specifically, based on each window and each founding parent, the logarithmic emission probability of that window for that founding parent is determined, including:
[0069] For each window and each founding parent, count the number of target individuals within the window whose genotypes match the founding parent at valid loci (neither of which are deleted), divide this number by the total number of valid loci to obtain the IBS matching ratio. Multiply this ratio by the emission intensity adjustment parameter (default 10) and take the natural logarithm to obtain the log-emission probability of the window corresponding to the founding parent.
[0070] In some embodiments, the screened informative SNPs can be divided into non-overlapping windows of a fixed window size (default 100 SNPs per window). For each window and each founding parent, the number of target individuals within the window whose genotypes match the founding parent at valid loci (neither deleted) is counted, and this number is divided by the total number of valid loci to obtain the IBS matching ratio. This ratio is then multiplied by the emission intensity adjustment parameter (default 10) and the natural logarithm is taken to obtain the log-emission probability of the window corresponding to the founding parent.
[0071] S104. Based on the pre-constructed uniform transition matrix, the marginal posterior probability of each window belonging to each original parent is obtained according to the logarithmic emission probability of each window corresponding to the original parent.
[0072] Specifically, based on a pre-constructed uniform transition matrix, and according to the logarithmic emission probability of each window corresponding to its respective parent, the marginal posterior probability of each window belonging to each parent is obtained, including:
[0073] For each window and each founding parent, calculate the IBS matching ratio and natural log number of each target individual with that founding parent at the effective loci within the window;
[0074] The log-emission matrix is determined based on the IBS matching ratio and natural logarithm of each target individual with the founding parent at effective loci within the window.
[0075] Based on the logarithmic emission matrix and the pre-constructed uniform transition matrix, the Viterbi algorithm is executed in the full logarithmic space to obtain the most likely parental state for each window;
[0076] Execute the Forward-Backward algorithm to obtain the marginal posterior probability of each window belonging to each founding parent.
[0077] The self-transition probability of the uniform transition matrix is 1-ε, and the cross-state transition probability is ε / (K-1), where K is the number of founding parents.
[0078] Here, the uniform transition matrix is independent of the genetic map. In the full logarithmic space, based on the logarithmic emission probabilities and the logarithmic transition matrix, the standard Viterbi algorithm is executed to solve for the optimal parental state path for each window on each chromosome; simultaneously, the Forward-Backward algorithm is executed to calculate the marginal posterior probability of each window belonging to each parent. All operations are performed in the log domain, and the log-sum-exp technique is used to maintain numerical precision. The core loop of the HMM is compiled into machine code using Numba JIT.
[0079] S105. Scan the state sequence output by Viterbi from front to back along each chromosome, merge adjacent consecutive windows that are assigned to the same founding parent into one ancestral segment, and obtain multiple ancestral segments.
[0080] The process involves scanning the Viterbi output state sequence along each chromosome from front to back, merging adjacent consecutive windows assigned to the same founding parent into a single ancestral segment, resulting in multiple ancestral segments, including:
[0081] Consecutive windows that are adjacent and assigned to the same founding parent are merged into one ancestral segment;
[0082] The information recorded in each segment includes: the genome start coordinates, the end coordinates, the assigned founding parent identity, and the average of the maximum posterior probabilities of all windows within that segment.
[0083] The ancestral origin segment file includes: coordinates, founding parent identity, and confidence level;
[0084] The window-level posterior probability file supports both wide and long output modes.
[0085] Specifically, you can merge windows using the following steps:
[0086] If the maximum posterior probability of all windows within a segment is close to 1.0, then the confidence level is close to 1.0.
[0087] If there is a state dispute between windows within the segment, it is determined that the posterior probability of some windows is dispersed among multiple founding parents, and the confidence level is reduced accordingly.
[0088] In some embodiments, the state sequence output by Viterbi can be scanned from front to back along each chromosome. Adjacent consecutive windows assigned to the same founding parent are merged into an ancestral segment. Each segment records the following information: genome start coordinates, end coordinates, the assigned founding parent identity, and the average of the maximum posterior probabilities of all windows within that segment (as a confidence level). Segments shorter than a preset threshold (default 10,000 bp) are filtered out.
[0089] In one possible embodiment, please refer to Figure 2The HMM inference engine divides the selected SNPs into non-overlapping windows of a fixed window size (default 100 SNPs per window). For each window and each founding parent, it calculates the proportion of IBS genotype matching between the target individual and the founding parent within the window, i.e., the proportion of genotypes that are identical at effective SNP loci. This proportion is multiplied by the emission intensity adjustment parameter (default 10) and the natural logarithm is taken as the log-emission probability of that window corresponding to that founding parent. A uniform transition matrix is constructed: the self-transition probability is set to 0.97, and the cross-state transition probability is evenly distributed among the remaining 0.03. The standard Viterbi algorithm is executed in the full logarithmic space to solve for the optimal founding parent state path, and the Forward-Backward algorithm is used to calculate the marginal posterior probability of each window belonging to each founding parent. The segment merging module merges adjacent, consecutive windows assigned to the same originating parent by Viterbi into ancestral segments. Each segment records the start and end coordinates of the genome, the originating parent's identity, and the mean of the maximum posterior probabilities of all windows within that segment as the confidence level. Short fragments shorter than a preset threshold (default 10,000 bp) are filtered out. The output module generates ancestral segment files, window-level posterior probability files, and statistics on the contribution proportions of each originating parent across the entire genome.
[0090] S106. Based on the logarithmic emission probability, uniform transition matrix, and multiple ancestral segments corresponding to each window for the corresponding primordial parent, determine multiple output files, including: ancestral segment file, window-level posterior probability file, and contribution ratio file of each primordial parent in the whole genome.
[0091] The ancestral origin segment file includes: coordinates, founding parent identity and confidence level, and the window-level posterior probability file supports both wide and long format output modes.
[0092] Taking a rice breeding project as an example, four founding parent varieties, A, B, D, and F, were hybridized and self-pollinated to obtain the target line G. The pedigree is: C=A×B, E=C×D, G=E×F. A, B, D, and F have no parental records and are therefore identified as the founding parents.
[0093] The input data is a multi-sample VCF file containing SNP genotyping results for seven samples (G, E, C, F, D, A, and B), totaling approximately 50,000 SNP loci. The pedigree file is in a space-separated "offspring, parent, mother" format. The operating parameters use default values: window size 100 SNPs, emission intensity parameter 10, switching probability parameter 0.03, and minimum block length 10,000 bp.
[0094] The pedigree file was read, and a depth-first search was performed backtracking starting from the target individual G. A, B, D, and F had no parental records and were automatically identified as the founding parent set {A, B, D, F}. Simultaneously, loop detection confirmed that there were no circular references in the pedigree. Next, the VCF file was read and a chromosome-by-chromosome scan was performed. For each SNP locus, the genotype values of A, B, D, and F were checked. If the genotypes of the four individuals were completely identical, the locus was skipped; only loci with at least one pair of founding parent genotypes showing differences were retained. After screening approximately 50,000 loci, approximately 35,000 informative SNPs were retained. Simultaneously, the missing rate and heterozygosity of each sample were output in the standard error stream. In this example, the missing rate of all seven samples was less than 5%, and the heterozygosity was less than 1%, with no abnormality indications.
[0095] The selected SNPs were then divided into non-overlapping windows in groups of 100. For each window and each founding parent (A, B, D, F), the IBS matching ratio between the target individual G and the founding parent at the effective loci within the window was calculated, multiplied by 10, and the natural logarithm was taken to construct a log-emission matrix.
[0096] Simultaneously, a 4×4 uniform transition matrix is constructed—0.97 for the diagonal and approximately 0.01 for the off-diagonal. The Viterbi algorithm is executed in the full logarithmic space to obtain the most likely parental state for each window; the Forward-Backward algorithm is then executed to obtain the marginal posterior probability of each window belonging to each parental state.
[0097] Then, the state sequence output by Viterbi is scanned along each chromosome, and adjacent windows assigned to the same founding parent are merged into a continuous segment. For each segment, its genomic start and end coordinates, the identity of the assigned founding parent, and the mean of the maximum posterior probabilities of all windows within the segment are recorded as the confidence level. Segments shorter than 10,000 bp are filtered out.
[0098] Finally, three files are generated: the ancestral segment file (blocks.tsv, containing the coordinates of each segment on each chromosome, the original parent to which it belongs, and the confidence level), the window-level posterior probability file (posterior.tsv, containing the probability of each window to each original parent), and the whole genome contribution ratio file (summary.txt, containing the cumulative contribution ratio of each original parent to the G genome).
[0099] On the other hand, please see Figure 3 This application also provides a pedigree-constrained inbred line genomic ancestry inference system, the system comprising:
[0100] The file reading module 101 is used to read pedigree files and VCF files, construct a directed acyclic graph of pedigrees, and perform a depth-first search backtracking starting from the target individual to extract all nodes without parental records as the set of founding parents.
[0101] SNP determination module 102 is used to scan the VCF file chromosome by chromosome. For each SNP locus, genotype values of all founding parents are extracted, and multiple informative SNPs are determined based on the genotype values.
[0102] The log emission probability determination module 103 is used to divide the screened informative SNPs into non-overlapping windows of a fixed window size, and determine the log emission probability of the window corresponding to the original parent based on each window and each original parent.
[0103] The edge posterior probability determination module 104 is used to obtain the edge posterior probability of each window belonging to each original parent based on the pre-constructed uniform transition matrix and the log emission probability of each window corresponding to the original parent.
[0104] The ancestral segment determination module 105 is used to scan the state sequence output by Viterbi along each chromosome from front to back, merge adjacent consecutive windows that are assigned to the same founding parent into one ancestral segment, and obtain multiple ancestral segments.
[0105] The file output module 106 is used to determine multiple output files based on the logarithmic emission probability, uniform transition matrix, and multiple ancestral segments corresponding to each window for the corresponding primordial parent. These multiple output files include: ancestral segment file, window-level posterior probability file, and contribution ratio file of each primordial parent for the whole genome.
[0106] The method and system for inferring the genomic ancestry of inbred lines based on pedigree constraints proposed in this application can achieve at least the following effects:
[0107] (1) The pedigree structure has high adaptability. Existing tools such as GAIN can only handle pedigrees under specific mating designs. This invention can automatically extract the set of founding parents for any directed acyclic graph structure of breeding pedigrees through depth-first search backtracking. It is suitable for diverse breeding scenarios such as three-way crosses, backcrosses, and multi-parent aggregation. The pedigree parsing module has a built-in loop detection mechanism, which directly reports an error for inputs with circular references.
[0108] (2) This invention does not rely on genetic maps. The emission probability is based solely on the IBS matching ratio, and the transition matrix uses a uniform prior. Both are calculated directly from genotype data and do not involve recombination rates or genetic maps. This invention can still be used directly for breeding projects lacking genetic maps—which is the current situation for most crop breeding projects.
[0109] (3) Automatic SNP reduction: Before entering HMM inference, non-informative loci are automatically removed by utilizing genotypic polymorphism among founding parents. This screening uses pedigree structure as a priori, does not require genetic maps or linkage disequilibrium information, and can usually reduce the amount of input data by 20%–30% while maintaining the ancestry discrimination effect unchanged—because the removed loci are themselves non-discriminatory loci.
[0110] (4) Segment-level confidence output: the Viterbi optimal path provides a hard assignment conclusion, while the Forward-Backward posterior probability provides a soft assignment basis. Each output segment is accompanied by a confidence score, allowing breeding decisions to weigh the reliability of the inferred conclusions: high-confidence segments can be used directly for decision-making, while low-confidence segments indicate the need for supplementary data or further verification.
[0111] (5) The system is lightweight and deployable. Except for the VCF parsing library (cyvcf2), it is entirely written in Python. The HMM core loop is compiled to machine code using Numba JIT. It can be deployed as a single file without the need for a compilation toolchain. It is used in a genome the size of Arabidopsis thaliana (approximately 129M).
[0112] Finally, it should be noted that although this specification contains many specific implementation details, these should not be construed as limiting the scope of any invention or the scope of the claims, but rather are primarily used to describe the features of specific embodiments of a particular invention. Certain features described in the various embodiments of this specification may also be implemented in combination in a single embodiment. On the other hand, various features described in a single embodiment may also be implemented separately in various embodiments or in any suitable sub-combination. Furthermore, while features may function in certain combinations as described above and even initially claimed in this way, one or more features from a claimed combination may be removed from that combination in some cases, and a claimed combination may refer to a sub-combination or a variation of a sub-combination.
[0113] Similarly, although the operations are depicted in a specific order in the accompanying drawings, this should not be construed as requiring these operations to be performed in the specific order shown or sequentially, or requiring all illustrated operations to be performed to achieve the desired result. In some cases, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system modules and components in the above embodiments should not be construed as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
[0114] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired result. Furthermore, the processes depicted in the drawings are not necessarily shown in a specific order or sequence to achieve the desired result. In some implementations, multitasking and parallel processing may be advantageous.
[0115] The above description is merely a preferred embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for inferring the genomic ancestry of inbred lines based on pedigree constraints, characterized in that, The method includes: Read the pedigree file and VCF file, construct the pedigree directed acyclic graph, and perform a depth-first search backtracking starting from the target individual to extract all nodes without parental records as the founding parent set; The VCF file was scanned chromosome by chromosome. For each SNP locus, the genotype values of all founding parents were extracted, and multiple informative SNPs were determined based on the genotype values. The filtered informative SNPs are divided into non-overlapping windows of a fixed window size, and the log emission probability of each window corresponding to each founding parent is determined based on each window and each founding parent. Based on the pre-constructed uniform transition matrix, the marginal posterior probability of each window belonging to each original parent is obtained according to the log emission probability of each window corresponding to the original parent. Scan the state sequence output by Viterbi from front to back along each chromosome, merge adjacent consecutive windows that are assigned to the same founding parent into one ancestral segment, and obtain multiple ancestral segments. Based on the logarithmic emission probability, uniform transition matrix, and multiple ancestral segments corresponding to each window for the corresponding primordial parent, determine multiple output files, including: ancestral segment file, window-level posterior probability file, and whole-genome contribution ratio file for each primordial parent.
2. The method according to claim 1, characterized in that, Multiple informative SNPs were identified using the following steps: If all founding parents have identical genotypes at this locus, then that locus is skipped; only loci where at least one pair of founding parents have different genotypes are retained as informative SNPs.
3. The method according to claim 1, characterized in that, Based on each window and each founding parent, determine the log-emission probability of that window for that founding parent, including: For each window and each founding parent, count the number of target individuals within the window whose genotypes match the founding parent at valid loci (neither of which are deleted), divide this number by the total number of valid loci to obtain the IBS matching ratio. Multiply this ratio by the emission intensity adjustment parameter (default 10) and take the natural logarithm to obtain the log-emission probability of the window corresponding to the founding parent.
4. The method according to claim 1, characterized in that, Based on a pre-constructed uniform transition matrix, and according to the logarithmic emission probability of each window corresponding to its respective parent, the marginal posterior probability of each window belonging to each parent is obtained, including: For each window and each founding parent, calculate the IBS matching ratio and natural log number of each target individual with that founding parent at the effective loci within the window; The log-emission matrix is determined based on the IBS matching ratio and natural logarithm of each target individual with the founding parent at the effective sites within the window; Based on the logarithmic emission matrix and the pre-constructed uniform transition matrix, the Viterbi algorithm is executed in the full logarithmic space to obtain the most likely parental state for each window; Execute the Forward-Backward algorithm to obtain the marginal posterior probability of each window belonging to each founding parent.
5. The method according to claim 1 or 4, characterized in that, The self-transition probability of the uniform transition matrix is 1-ε, and the cross-state transition probability is ε / (K-1), where K is the number of original parents.
6. The method according to claim 1, characterized in that, Scanning the state sequence output by Viterbi along each chromosome from front to back, adjacent consecutive windows assigned to the same founding parent are merged into a single ancestral segment, resulting in multiple ancestral segments, including: Consecutive windows that are adjacent and assigned to the same founding parent are merged into one ancestral segment; The information recorded in each segment includes: the genome start coordinates, the end coordinates, the assigned founding parent identity, and the average of the maximum posterior probabilities of all windows within that segment.
7. The method according to claim 1, characterized in that, The ancestral origin segment file includes: coordinates, founding parent identity, and confidence level; The window-level posterior probability file supports both wide and long output modes.
8. The method according to claim 1, characterized in that, The pedigree file is in a space-separated "offspring-father-mother" format, with one parent-offspring relationship per line; Individuals without parental records are considered founding parents; The VCF file must include the target individual and all ancestral individuals in the pedigree; The SNP screening module simultaneously calculates the missing rate and heterozygosity rate of each sample during the scanning process, outputs the data to the standard error stream, and marks and prompts samples with a missing rate exceeding the first proportion or a heterozygosity rate exceeding the second proportion.
9. The method according to claim 1, characterized in that, Merge windows using the following steps: If the maximum posterior probability of all windows within a segment is close to 1.0, then the confidence level is close to 1.
0. If there is a state dispute between windows within the segment, it is determined that the posterior probability of some windows is dispersed among multiple founding parents, and the confidence level is reduced accordingly.
10. A pedigree-constrained inbred line genomic ancestry inference system, characterized in that, The system includes: The file reading module is used to read pedigree files and VCF files, construct a directed acyclic pedigree graph, and perform a depth-first search backtracking starting from the target individual to extract all nodes without parental records as the set of founding parents. The SNP identification module is used to scan the VCF file chromosome by chromosome, extract the genotype values of all founding parents for each SNP locus, and identify multiple informative SNPs based on the genotype values. The log emission probability determination module is used to divide the screened informative SNPs into non-overlapping windows of a fixed window size, and determine the log emission probability of each window for each founding parent based on each window and each founding parent. The edge posterior probability determination module is used to obtain the edge posterior probability of each window belonging to each original parent based on the pre-constructed uniform transition matrix and the log emission probability of each window corresponding to the original parent. The ancestral segment determination module is used to scan the state sequence output by Viterbi from front to back along each chromosome, and merge adjacent consecutive windows that are assigned to the same founding parent into one ancestral segment to obtain multiple ancestral segments. The file output module is used to determine multiple output files based on the logarithmic emission probability, uniform transition matrix, and multiple ancestral segments corresponding to each window for the corresponding primordial parent. These multiple output files include: ancestral segment file, window-level posterior probability file, and whole-genome contribution ratio file for each primordial parent.