An animal mating method, system and device based on pedigree relationship and offspring predicted inbreeding coefficient constraint and a storage medium
By predicting the inbreeding coefficient of future offspring of candidate male-female combinations based on pedigree relationships, this method solves the problems of low accuracy and efficiency in existing technologies, and achieves efficient and detailed output of animal mating results, applicable to both local and cloud platforms.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INSTITUTE OF ANIMAL SCIENCES OF CHINESE ACADEMY OF AGRICULTURAL SCIENCES
- Filing Date
- 2026-04-21
- Publication Date
- 2026-06-09
AI Technical Summary
Existing technologies in animal breeding cannot accurately predict the degree of inbreeding in future offspring of candidate male-female combinations, and existing mating methods are inefficient and have poor interpretability, failing to meet the precision and efficiency requirements of large-scale breeding populations.
By acquiring animal pedigree data, performing legality checks and structured processing, calculating the inbreeding coefficient of existing individuals, and predicting the inbreeding coefficient of future offspring of candidate male-female combinations based on pedigree relationships, the system automatically filters offspring by combining common ancestor constraints and inbreeding thresholds, supports multiple sorting strategies and random mechanisms, and outputs detailed screening reasons and statistical summary results.
It improves the accuracy and efficiency of selection results, supports batch automatic screening of large-scale pedigrees and candidate combinations, enhances the interpretability and verifiability of results, and is suitable for local and cloud platform deployment.
Smart Images

Figure CN122177205A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of animal breeding technology, specifically to an animal mating method, system, device, and storage medium based on pedigree relationships and offspring prediction inbreeding coefficient constraints. Background Technology
[0002] In animal breeding, scientific and rational selection and mating are crucial technical aspects for controlling inbreeding accumulation, maintaining genetic diversity, improving production performance, and ensuring the continuous improvement of the population. In actual production, mating decisions typically require simultaneous consideration of multiple factors, including individual origin, pedigree relationship, inbreeding level, number of candidate males and females, mating ratio requirements, and common ancestor constraints within a certain generation range. With the continuous expansion of breeding populations and the increasing complexity of pedigree records, relying on manual experience or simple rules for mating is no longer sufficient to meet the demands for precise, large-scale, and efficient applications.
[0003] In existing technologies, pedigree analysis typically calculates the inbreeding coefficient of individuals already existing in the pedigree to describe the degree of inbreeding of that individual. However, in actual breeding scenarios, breeders are often not truly concerned with the inbreeding levels of the candidate male and female animals themselves, but rather with the potential inbreeding level of their future offspring. Since these offspring have not yet been born and do not exist in the original pedigree data, relying solely on the inbreeding coefficient of existing individuals cannot directly meet the actual needs of breeding selection. Incorrectly substituting the parents' own inbreeding coefficients for predicting the inbreeding coefficient of future offspring can easily lead to biased selection criteria and affect the accuracy of the breeding results.
[0004] On the other hand, existing mating methods often involve constraints related to common ancestors from previous generations. For example, to avoid excessive inbreeding risk, it is usually required that candidate males and females do not have a common ancestor within a preset generation range. Traditional methods often require manual verification of each pair or the use of inefficient programs to trace back and judge step by step, and the computational load increases rapidly when the number of candidate males and females is large. At the same time, when it is necessary to further superimpose offspring prediction inbreeding thresholds, mating ratio restrictions, and different combination ranking strategies, existing methods are difficult to form a unified, automated, and interpretable screening process.
[0005] Furthermore, the output of candidate combination screening results in existing technologies is usually quite coarse, often only providing the final pairing results without explaining the reasons for filtering all candidate combinations. It is impossible to intuitively distinguish whether a candidate combination is excluded because the common ancestor of the previous generation is excluded or because the inbreeding level of future offspring exceeds the threshold. It is also difficult to provide statistical summary information such as the number of successfully paired males, the number of successfully paired females, the number of unused females, and the overall inbreeding level of candidate combinations. This is not conducive to breeders' result verification, strategy optimization, and production decisions.
[0006] To this end, we propose an animal mating method, system, device, and storage medium based on pedigree relationships and offspring prediction inbreeding coefficient constraints. Summary of the Invention
[0007] The purpose of this invention is to provide an animal mating method, system, device, and storage medium based on pedigree relationships and offspring prediction inbreeding coefficient constraints, in order to solve the problems existing in the prior art.
[0008] To achieve the above objectives, the present invention adopts the following technical solution:
[0009] This invention provides an animal mating method based on pedigree and offspring prediction inbreeding coefficient constraints, comprising:
[0010] S1. Obtain animal pedigree data, male animal individual data, and female animal individual data, wherein the pedigree data includes at least an individual identifier, a paternal identifier, and a maternal identifier;
[0011] S2. Perform legality checks and structured processing on the genealogy data, wherein:
[0012] The legality checks include at least one of the following: duplicate individual identifier checks, checks that the parent or mother is equal to the individual itself, checks that the parent individual is missing from the pedigree, topological anomaly checks, and circular dependency checks;
[0013] The structured processing includes establishing an individual identifier index, supplementing parent individuals that are referenced by offspring but do not appear independently in the pedigree, marking individuals whose parent information is unknown as ancestral individuals, and performing topological sorting on all individuals based on the rule of parents first and offspring last, in order to construct a pedigree relationship data structure.
[0014] S3. Based on the pedigree relationship data structure, calculate the inbreeding coefficient of the individuals already in the pedigree to obtain the individual inbreeding results;
[0015] S4. For the candidate male-female combination, based on the pedigree relationship data structure, trace back the ancestral sets of the candidate male and candidate female animals within a preset generation range, and determine whether there is an intersection between the two ancestral sets, so as to determine whether the candidate male-female combination has a common ancestor within the preset generation range.
[0016] S5. For candidate male-female combinations that do not have a common ancestor within the preset generation range, calculate the predicted inbreeding coefficient of the future offspring of the combination based on the pedigree relationship value between the candidate male and the candidate female, and there is no need to pre-write the future offspring into the original pedigree data during the calculation process.
[0017] S6. Compare the predicted inbreeding coefficient of the future offspring with a preset inbreeding threshold, and filter out candidate male-female combinations whose predicted inbreeding coefficient exceeds the preset inbreeding threshold;
[0018] S7. Based on the preset male-female ratio and candidate sorting strategy, generate a selection result from the selected candidate male-female combinations; the candidate sorting strategy includes at least one of the following: a first strategy where male animals are processed in the forward order of input and female animals are processed in the forward order of input; a second strategy where male animals are processed in the forward order of input and female animals are processed in the reverse order of input; a third strategy where male animals are processed in the forward order of input and female animals are processed in a random order; when the third strategy is adopted, a random order of female animals is further generated based on reproducible random seed parameters;
[0019] Furthermore, in step S7, when the third strategy is adopted, a local random seed is formed by combining the basic random seed and the male animal index for different male animals, so that the random scanning order of the female animals corresponding to different male animals is different, and consistent mating results are obtained when running repeatedly under the same input data and the same random seed parameters.
[0020] Furthermore, in step S8, the output result information also includes at least one of the following:
[0021] The candidate combination screening results include: candidate male animal identifier, candidate female animal identifier, whether there is a common ancestor within a preset generation range, predicted inbreeding coefficient of future offspring, whether the screening is passed and the reasons for the screening;
[0022] Results of individual inbreeding;
[0023] The statistical summary results include at least one of the following: total number of individuals in the pedigree, total number of candidate combinations, number of combinations filtered due to common ancestor constraints, number of combinations filtered due to the predicted inbreeding coefficient of future offspring exceeding the threshold, number of successfully paired combinations, individual inbreeding statistics, and inbreeding statistics of future offspring of candidate combinations.
[0024] An animal mating system based on pedigree and offspring predicted inbreeding coefficient constraints, the system being used to implement the aforementioned animal mating method based on pedigree and offspring predicted inbreeding coefficient constraints, comprising:
[0025] The data acquisition module is used to acquire animal pedigree data, individual data of male animals, and individual data of female animals;
[0026] A genealogy checking and structuring module is used to perform the legality check and structuring processing on the genealogy data as described in step S2 of claim 1, so as to construct a genealogy relationship data structure;
[0027] The individual inbreeding calculation module is used to calculate the inbreeding coefficient of existing individuals in the pedigree;
[0028] The common ancestor determination module is used to determine whether candidate male and candidate female animals have a common ancestor within a preset generation range;
[0029] The offspring inbreeding prediction module is used to calculate the predicted inbreeding coefficient of future offspring of candidate male-female combinations;
[0030] The filtering module is used to filter candidate male-female combinations based on common ancestor constraints and inbreeding thresholds;
[0031] The pairing generation module is used to generate pairing results based on a preset male-female ratio and candidate sorting strategy;
[0032] The output module is used to output the selection results and related information.
[0033] Furthermore, the system has a local operating mode and is configured to be implemented by a local executable program; the local executable program receives the pedigree file path, the male animal file path, the female animal file path and operating parameters, independently completes each step of the method on a local computing device, and controls the operating mode through command line parameters; the operating mode includes at least a pedigree check mode, an individual inbreeding coefficient calculation mode, a candidate male and female future offspring inbreeding coefficient calculation mode, and an automatic mating mode.
[0034] Furthermore, the system operates in a cloud platform configuration and is configured to include a front-end interactive platform and a back-end analysis program.
[0035] The front-end interactive platform is used to receive pedigree files, male animal files, and female animal files uploaded by users, obtain the operating parameters set by users, trigger the execution of the background analysis program, and display the analysis results and provide result downloads.
[0036] The background analysis program is used to perform the calculation steps of the method as described in any one of claims 1 to 3.
[0037] Furthermore, the background analysis program is implemented in C++, and the front-end interaction platform is implemented using the Shiny platform;
[0038] The front-end interactive platform communicates with the back-end analysis program via command invocation or service interface, saves uploaded files to the working directory, generates back-end analysis program invocation commands based on analysis mode and running parameters, and reads and displays result files and running logs after the back-end analysis program has finished executing.
[0039] An electronic device includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the electronic device performs the aforementioned animal mating method based on pedigree and offspring prediction inbreeding coefficient constraints.
[0040] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the animal mating method based on pedigree and offspring prediction inbreeding coefficient constraints.
[0041] Compared with the prior art, the present invention has at least the following beneficial effects:
[0042] 1. Clearly distinguish between the inbreeding coefficient of existing individuals and the predicted inbreeding coefficient of future offspring of candidate males and females to improve the accuracy of screening criteria;
[0043] 2. Combining common ancestor constraints with offspring prediction inbreeding thresholds in the automatic mating process improves the scientific rigor of mating;
[0044] 3. Supports automatic batch screening of large-scale pedigrees and a large number of candidate combinations, improving processing efficiency;
[0045] 4. It can output the reasons for filtering candidate combinations and statistical summary results, improving the interpretability and verifiability of the results;
[0046] 5. Supports different candidate sorting strategies and reproducible randomization mechanisms, improving application flexibility and engineering practicality;
[0047] 6. Suitable for deployment in the form of C++ backend programs and Shiny online platforms, facilitating promotion and application. Attached Figure Description
[0048] Figure 1 This is a schematic diagram of the overall process of an animal mating method based on pedigree and offspring prediction inbreeding coefficient constraints according to the present invention.
[0049] Figure 2 This is a schematic diagram of the automatic mating method based on common ancestor constraints and offspring prediction inbreeding coefficient threshold of the present invention.
[0050] Figure 3 This is a structural block diagram of an animal mating system according to the present invention.
[0051] Figure 4 This is the main page of the IASmating animal mating website for this invention.
[0052] Figure 5 This is an interface display of the pedigree check function of the IASmating animal mating cloud platform of this invention.
[0053] Figure 6 This is an interface display of the selection scheme for the operation of the IASmating animal selection cloud platform of the present invention. Detailed Implementation
[0054] The present invention will be further described below with reference to specific embodiments, but the present invention is not limited to the following embodiments. Various equivalent substitutions or modifications that can be made by those skilled in the art without departing from the spirit and essence of the present invention should fall within the protection scope of the present invention.
[0055] This invention provides an animal mating method based on pedigree relationships and inbreeding coefficient constraints for predicted offspring. This method can be deployed as a local command-line program, a server backend program, or an online analysis platform. The following description uses a software implementation as an example to illustrate this invention.
[0056] Example 1 Pedigree verification method: This implementation method is used to perform legality checks and structured preprocessing on the input animal pedigree files, providing reliable input for subsequent inbreeding coefficient calculation and mating analysis.
[0057] 1. Input data
[0058] The input pedigree file must include at least three columns: Individual ID; Parent ID (Sire); Parent ID (Dam). If the parent is unknown, 0, NA, ".", or other preset missing values can be used to indicate this. For example:
[0059]
[0060] 2. Genealogy Reading and Standardization
[0061] The program first reads the genealogy file line by line, identifying and skipping blank lines, comment lines, and header lines; then it extracts the individual ID, parent ID, and mother ID for each record and performs standardization processing, including:
[0062] (1) Missing parents are uniformly identified as unknown parents;
[0063] (2) Check if the individual ID is empty;
[0064] (3) Check if there are duplicate individual IDs;
[0065] (4) Check whether the father or mother is the same as the individual;
[0066] For parent individuals who are cited in the offspring record but do not appear independently in the genealogy, they are added as progenitor individuals, and the father and mother of the added individuals are both recorded as unknown.
[0067] By following the steps above, a complete standardized pedigree data structure can be obtained.
[0068] 3. Genealogical structure examination
[0069] After obtaining the standardized pedigree, it is further examined, including:
[0070] (1) Duplicate ID check;
[0071] (2) The parent is equal to the self-check;
[0072] (3) The parent plant is equivalent to self-examination;
[0073] (4) Parents are missing in pedigree examination;
[0074] (5) Topology check;
[0075] (6) Check for loops or illegal dependencies.
[0076] The topology check is achieved by constructing a directed relationship of "parents first, offspring last" and performing a topological sort. If all individuals are not traversed during the topological sorting process, it indicates that there are circular dependencies or anomalous dependencies in the pedigree.
[0077] 4. Output Results
[0078] After the pedigree check is completed, a pedigree check summary report and a pedigree problem details table can be output. The summary report may include: total number of records; number of unique individuals; number of ancestral individuals; number of non-ancestral individuals; number of missing paternal parents; number of missing maternal parents; number of paternal parents equal to themselves; number of maternal parents equal to themselves; number of duplicate IDs; number of parents missing from the pedigree; presence of cycles; topological integrity; and total number of problems. The problem details table records each problem found, facilitating user corrections to the input pedigree.
[0079] Example 2 Method for calculating the inbreeding coefficient of existing individuals: This implementation method is used to calculate the inbreeding coefficient of individuals that already exist in the pedigree, so as to reflect the inbreeding level of the individual itself.
[0080] 1. Calculation Object
[0081] In this implementation, the calculation targets are individuals that already exist in the pedigree and have a unique identifier. For ancestral individuals whose father or mother is unknown, their inbreeding coefficient is set to 0.
[0082] 2. Calculation process
[0083] After completing pedigree checking and topological sorting, all individuals are processed sequentially in the order of "parents first, offspring last". For any individual 𝑖, if its father is The parent is Then its proximity coefficient It is determined by the pedigree relationship between its parents. Specifically, the inbreeding coefficient of an individual satisfies:
[0084]
[0085] in, This represents the diagonal element of the individual in the additive relationship matrix A. Equivalently, it can also be represented based on the parent-child relationship:
[0086]
[0087] in, This represents the additive relationship value between the parent and parent of the individual. In the program implementation, a lower triangular calculation method based on the pedigree recursion relation matrix can be used to gradually construct the pedigree relation values and simultaneously obtain the inbreeding coefficients of each individual.
[0088] 3. Output Results
[0089] After calculation, output an individual inbreeding results table, which should include at least: individual ID and individual inbreeding coefficient. For example:
[0090]
[0091] This result can be used to describe the degree of inbreeding among individuals in a pedigree, but it is not directly used for inbreeding screening of future offspring of candidate males and females.
[0092] Example 3 Method for calculating the predicted inbreeding coefficient of future offspring of candidate males and females: This implementation method is used to calculate the predicted inbreeding coefficient of future offspring of all candidate combinations in batches based on the list of candidate males and females.
[0093] 1. Input data
[0094] In addition to the pedigree file, it also includes: a list of male livestock and a list of female livestock. Each line in the male livestock list file contains a male livestock ID; each line in the female livestock list file contains a female livestock ID.
[0095] 2. Technological Ideas
[0096] This implementation differs from existing methods for calculating individual inbreeding coefficients. Its focus is not on individuals already existing in the pedigree, but rather on unborn future offspring, presumably formed by mating candidate males and females. For any candidate combination... The predicted inbreeding coefficient of its future offspring Candidate male livestock With candidate female animals The genealogical relationship between them is determined and can be expressed as:
[0097]
[0098] in, This represents the additive relationship value between candidate male and candidate female animals. Therefore, even if the offspring has not yet appeared in the original pedigree, as long as its father and mother can be indexed in the pedigree structure, the predicted inbreeding coefficient of the future offspring can be calculated directly without having to virtually insert the future offspring into the pedigree and then perform the calculation again.
[0099] 3. Batch Calculation Process
[0100] After reading all male and female animals, the program creates candidate pairs for each male and female animal and executes them one by one:
[0101] (1) Determine whether a male animal exists in the pedigree index;
[0102] (2) Determine whether the female animal exists in the pedigree index;
[0103] (3) If both exist, then read the relationship value between them. ;
[0104] (4) According to Calculate the inbreeding coefficient for future offspring;
[0105] (5) Output result table.
[0106] 4. Output Results
[0107] Output a table of inbreeding results for future offspring of candidate combinations, including at least: male animal ID, female animal ID, and predicted inbreeding coefficient for offspring. For example:
[0108]
[0109] The results can be used as a pre-screening basis before pairing, or they can be used by breeders for comparative analysis of combinations.
[0110] Example 4: Automatic mating method based on common ancestor constraints and offspring prediction inbreeding coefficient threshold: This embodiment is used to generate automatic mating results based on male animals, female animals, mating ratio, and strategy, under the premise of meeting preset constraints.
[0111] 1. Input parameters
[0112] The input includes: pedigree file; list of male animals; list of female animals; male-to-female ratio; common ancestor generation; inbreeding coefficient threshold for offspring prediction; candidate sorting strategy; and optional random seed. The default inbreeding threshold can be set to 0.0625, i.e., 1 / 16 as the default upper limit.
[0113] 2. Common Ancestor Constraint Determination
[0114] For any candidate male-female combination, first determine whether they share a common ancestor within a preset generation range. The specific procedure is as follows:
[0115] (1) Tracing back the candidate male livestock before Ancestors' collection;
[0116] (2) Tracing back to the candidate female animal before Ancestors' collection;
[0117] (3) Determine whether the two sets have an intersection.
[0118] If there is an intersection, the candidate combination is considered to have a common ancestor within the preset generation range, and is marked as "not passing the common ancestor screening"; if there is no intersection, it is marked as "passing the common ancestor screening".
[0119] 3. Determination of inbreeding threshold for offspring prediction
[0120] For candidate combinations selected through common ancestor screening, the inbreeding coefficients of their future offspring are further calculated. If the following conditions are met:
[0121]
[0122] If the candidate combination passes the inbreeding screening, it is considered to have passed the inbreeding screening; otherwise, it is considered to have failed the inbreeding screening.
[0123] 4. Proportioning control and selection process
[0124] Set the male-to-female ratio as follows This indicates that each male animal can be assigned a maximum of 4 female animals. The program processes male animals one by one in the order of the male animal list, scanning the female animal candidate list for each male animal and executing the following:
[0125] (1) If the female animal has been successfully used, skip this step;
[0126] (2) Check for common ancestor constraints;
[0127] (3) Examine the inbreeding threshold for predicting offspring;
[0128] (4) If all passes, the female animal is assigned to the current male animal;
[0129] (5) When the current male animal has reached the maximum mating ratio, stop scanning for female animals for that male animal;
[0130] Move on to the next male animal.
[0131] If the current male animal cannot find a matching pair among all scannable female animals, it is recorded as an unsuccessfully paired male animal.
[0132] 5. Candidate Ranking Strategy
[0133] In this implementation, the order of male animals remains in the forward direction of the input order, while the scanning order of female animals is controlled by strategy parameters. Optional strategies include:
[0134] (1) Best-best strategy: male animals are processed in the forward order of input; female animals are scanned in the forward order of input. This strategy is applicable to scenarios where the input order of both male and female animals has been sorted according to their degree of excellence.
[0135] (2) The best-worst matching strategy. Male animals are processed in the forward order of input; female animals are scanned in the reverse order of input. This strategy is suitable for scenarios where it is desirable to prioritize matching male animals that are earlier in the input order with female animals that are later in the input order.
[0136] (3) Random strategy, denoted as random. Male animals are processed in the forward order of input; female animals are scanned in a random order. Under the random strategy, a random seed parameter can be further received. When a random seed is provided, a reproducible random scan order for female animals is generated for each male animal. To avoid all male animals using the same random order, a local random seed can be generated by superimposing the male animal index on the basic random seed in the implementation, so that different male animals correspond to different random female animal orders while maintaining reproducibility.
[0137] 6. Output Results
[0138] After automatic mating is completed, the following outputs can be generated: final mating result table; inbreeding result table of offspring of successfully selected combinations; report of all candidate combinations; summary statistical results.
[0139] (1) Final Matching Results Table: Each row corresponds to one male animal, and the following columns are the successfully matched female animals; if the maximum matching ratio is not reached, a preset null value is used to fill the gap. For example:
[0140]
[0141] (2) Successful selection of the offspring inbreeding result table: records all male and female combinations that have finally passed the screening and been successfully assigned and their predicted inbreeding coefficients for future offspring.
[0142] (3) Report of all candidate combinations: For each candidate combination that actually participated in the scan, output the following information: male animal number; female animal number; whether there is a common ancestor in the previous N generations; predicted inbreeding coefficient of future offspring; whether it passed the common ancestor screening; whether it passed the inbreeding threshold screening; whether it finally passed; and the corresponding reason. Among them, the reasons include but are not limited to: passed; there is a common ancestor in the previous N generations; the predicted inbreeding coefficient of offspring exceeds the threshold.
[0143] (4) Summary of statistical results: The statistical output should include at least the number of individuals in the pedigree; the number of male animals; the number of female animals; the number of candidate combinations; the number of combinations filtered due to common ancestor; the number of combinations filtered due to inbreeding exceeding the threshold; the number of successfully paired combinations; the number of male animals that successfully participated in pairing; the number of female animals that successfully participated in pairing; the average inbreeding coefficient of individuals; the maximum inbreeding coefficient of individuals; the average inbreeding coefficient of future offspring of all candidate combinations; the minimum inbreeding coefficient of future offspring of all candidate combinations; and the maximum inbreeding coefficient of future offspring of all candidate combinations.
[0144] Example 5
[0145] System implementation method:
[0146] This invention can also be implemented as an animal mating system. The system includes:
[0147] 1. Data Acquisition Module
[0148] It is used to read pedigree files, male animal files, and female animal files, and obtain parameters such as mating ratio, generation, threshold, strategy, and random seed.
[0149] 2. Genealogy Check Module
[0150] It is used to perform genealogy legitimacy checks, anomaly detection, and topology checks.
[0151] 3. Individual Inbreeding Calculation Module
[0152] Used to calculate the inbreeding coefficient of individuals already existing in a pedigree.
[0153] 4. Offspring Inbreeding Prediction Module
[0154] Used to predict the inbreeding coefficient of future offspring of candidate male-female combinations.
[0155] 5. Combined Filtering Module
[0156] Used to filter candidate combinations based on common ancestor constraints and descendant inbreeding thresholds.
[0157] 6. Pairing Generation Module
[0158] Used to generate the final selection scheme based on the ratio and strategy.
[0159] 7. Output Module
[0160] It is used to output individual inbreeding results, offspring inbreeding results, final pairing table, all candidate combination reports, and summary statistics.
[0161] The aforementioned system can be deployed on a local computer, server, or online analysis platform, and provide services to users through a command-line interface, graphical interface, or web interface.
[0162] Example 6 Implementation using C++ software and the Shiny cloud platform: In this embodiment, the animal mating method based on pedigree relationships and offspring prediction inbreeding coefficient constraints described in this invention is implemented by combining a C++ background analysis program with the Shiny online platform. It should be noted that C++ and Shiny are only one preferred implementation of this invention, and this invention is not limited to specific programming languages, operating frameworks, or deployment methods.
[0163] 1. System Overall Architecture
[0164] The implementation architecture of this embodiment includes a front-end interaction layer, a back-end analysis layer, and a file interaction layer. Specifically: the front-end interaction layer is built using the Shiny framework to provide a graphical web interface, receive user-uploaded data files, set running parameters, and display analysis results; the back-end analysis layer is implemented using C++ programs to perform pedigree checks, individual inbreeding coefficient calculations, inbreeding coefficient calculations for predicted future offspring of candidate males and females, and automatic mating analysis.
[0165] The file interaction layer is used to implement input file saving, output writing, log recording, and result file reading.
[0166] In this architecture, the front-end interaction layer is responsible for user input / output and visualization, while the back-end analysis layer is responsible for core computing tasks. The two communicate through command calls or API calls.
[0167] 2. Implementation method of C++ background analysis program
[0168] In this embodiment, the background core analysis program is an independent C++ executable program that executes the method steps described in this invention by reading input files and external parameters.
[0169] 2.1 Functional Mode
[0170] The C++ program includes at least the following analysis modes:
[0171] (1) Genealogy check mode
[0172] Used to perform legality checks and structured analysis on input genealogy files, and output check reports and problem details;
[0173] (2) Calculation model of individual inbreeding coefficient
[0174] Used to calculate the inbreeding coefficient of individuals already existing in a pedigree and output the inbreeding results;
[0175] (3) Calculation model of inbreeding coefficient of future offspring of candidate male and female
[0176] This tool is used to calculate the predicted inbreeding coefficients of future offspring for all candidate male-female combinations based on a list of male and female animals, and outputs the inbreeding results of the candidate combinations.
[0177] (4) Automatic selection mode
[0178] It is used to generate the final mating result based on common ancestor constraints, the inbreeding coefficient threshold for future offspring, the male-to-female ratio, and the candidate ranking strategy.
[0179] 2.2 Parameter Input Method
[0180] The C++ program controls its analysis behavior by receiving external parameters, which include at least: pedigree file path parameters; male animal file path parameters; female animal file path parameters; output prefix parameters; male-to-female pairing parameters; common ancestor check generation parameters; future offspring prediction inbreeding coefficient threshold parameters; candidate ranking strategy parameters; random seed parameters; full candidate combination report output parameters; and summary statistical output parameters. These parameters enable automated operation under different analysis modes.
[0181] In a preferred embodiment, the parameters may include:
[0182] --check-pedigree is used to perform a pedigree check;
[0183] --inbreeding is used to calculate the inbreeding coefficient of individuals;
[0184] --offspring is used to calculate the inbreeding coefficient of future offspring of candidate males and females;
[0185] The `--mating` option is used to perform automatic matching.
[0186] The `--pedigree` option specifies the genealogy file.
[0187] The `--sires` option specifies the male animal file.
[0188] --dams is used to specify the female animal file;
[0189] --output is used to specify the output prefix;
[0190] The `--ratio` option specifies the male-to-female ratio.
[0191] --generations, used to specify the generation to check for common ancestor;
[0192] --max_inbreeding is used to specify the threshold for predicting the inbreeding coefficient of future offspring;
[0193] --strategy is used to specify the candidate sorting strategy;
[0194] The `--seed` option specifies a random seed.
[0195] The `--all-pairs-report` option is used to output a report of all candidate pairings.
[0196] The `--summary` option is used to output statistical summary results.
[0197] It should be noted that the above parameter names are only one preferred implementation, and the present invention is not limited to the parameter naming method.
[0198] 2.3 Backend Analysis Process
[0199] In this embodiment, the execution flow of the C++ program includes:
[0200] (1) Read pedigree files, male animal files, female animal files, and parameter configurations;
[0201] (2) Standardize and verify the legality of the genealogy data;
[0202] (3) Establish individual indexes and construct pedigree relationship data structures;
[0203] (4) Calculate the inbreeding coefficient of individuals already existing in the pedigree;
[0204] (5) Calculate the predicted inbreeding coefficients of the future offspring of candidate male-female combinations in batches;
[0205] (6) In automatic matching mode, perform the common ancestor constraint judgment of the first N generations on the candidate combination;
[0206] (7) Perform a threshold judgment on the inbreeding coefficient of future offspring prediction for candidate combinations determined by common ancestor constraints;
[0207] (8) Generate the final mating result based on the male-female ratio and candidate sorting strategy;
[0208] (9) Output analysis results file, combined screening report and statistical summary results.
[0209] 2.4 Output Results
[0210] The C++ program can output at least one of the following result files:
[0211] • Genealogical examination report documents;
[0212] • Detailed document on genealogical issues;
[0213] • Individual inbreeding results file;
[0214] • Documentation on the inbreeding results of future offspring from male-female combinations;
[0215] • Final configuration result file;
[0216] • Successfully selected the inbreeding results file for the combined offspring;
[0217] • Reports of all candidate combinations;
[0218] • Statistical summary documents;
[0219] • The inverse file of the genealogical relationship matrix and its index file.
[0220] 3. Implementation of the Shiny online platform
[0221] In this embodiment, the front-end interaction platform is implemented using the Shiny framework and deployed as a web application in a server or cloud platform environment, providing users with a visual and interactive analysis entry point.
[0222] 3.1 Page Components
[0223] The Shiny online platform includes at least the following pages:
[0224] (1) Main page
[0225] Used to display the platform name, a brief introduction to its functions, core capabilities, process descriptions, and navigation entry points;
[0226] (2) Online running page
[0227] It is used to receive pedigree files, male animal files, and female animal files uploaded by users, set running parameters, trigger the background analysis program to execute, and display the analysis results;
[0228] (3) Download page
[0229] This provides a download portal for software programs, documentation, sample templates, and result files.
[0230] 3.2 Functional Divisions of the Online Operation Page
[0231] The online operation page may include:
[0232] (1) Analysis mode selection area
[0233] Used for selecting pedigree checks, individual inbreeding coefficient calculations, inbreeding coefficient calculations for future offspring of male-female combinations, or automatic mating modes;
[0234] (2) File upload area
[0235] Used for uploading pedigree files, male animal files, and female animal files;
[0236] (3) Parameter setting area
[0237] This is used to set the male-to-female ratio, the generation number for checking common ancestor, the inbreeding coefficient threshold for predicting future offspring, the candidate sorting strategy, the random seed, and the result output options;
[0238] (4) Operation control area
[0239] Used to receive analysis start commands from users;
[0240] (5) Results display area
[0241] It is used to display operation logs, pedigree check results, individual inbreeding results, inbreeding results of future offspring of candidate males and females, automatic mating results, candidate combination reports and statistical summary information;
[0242] (6) Results Download Area
[0243] Used to provide downloadable analysis result files.
[0244] 4. Front-end and back-end collaboration methods
[0245] In this implementation, the Shiny front-end and the C++ back-end analysis program work together via command-line calls. Specifically, this includes:
[0246] (1) Users upload input files and set running parameters on the web page;
[0247] (2) The Shiny platform will save the uploaded files to the server's working directory or temporary directory;
[0248] (3) The Shiny platform generates corresponding background program call commands based on the selected analysis mode and parameters;
[0249] (4) Start the C++ background analysis program via system call;
[0250] (5) The C++ background analysis program outputs result files and runtime logs in the specified directory;
[0251] (6) The Shiny platform reads the result file and running log, and displays them on the web page;
[0252] (7) Users can download the required analysis results via the web page.
[0253] In another embodiment, the front-end interaction platform and the back-end analysis program can also communicate through service interfaces, such as local interfaces, remote interfaces, or task scheduling interfaces, to submit analysis requests and return results. None of the above substitutions affect the implementation of the technical solution of this invention.
[0254] 5. Platform Deployment Method
[0255] In this embodiment, the system can be deployed on: a local personal computer; a local area network server; a cloud server; or a dedicated breeding analysis platform.
[0256] In different deployment environments, the core backend analysis is still executed by a C++ program, while the Shiny platform serves as the front-end interaction layer, used to organize file input, parameter configuration, task triggering, result display, and result download.
[0257] 6. Technical effects of this embodiment
[0258] Compared with simply using manual analysis or simple script processing, this implementation method has at least the following technical advantages:
[0259] (1) Implement the back-end core analysis program in C++ to improve the processing efficiency of large-scale pedigrees and a large number of candidate combinations;
[0260] (2) Shiny provides a graphical web interface, which lowers the barrier to entry for users and improves the ease of interaction;
[0261] (3) Through the front-end and back-end separation implementation architecture, the method of the present invention can reuse the same analysis core between local tools and online platforms;
[0262] (4) Improve the automation level and engineering application value of analysis work through the integrated process of uploading, analyzing, displaying and downloading;
[0263] (5) Improve the interpretability and verifiability of the analysis results by displaying the results table, candidate combination report and statistical summary information online.
[0264] 7. Explanation
[0265] It should be noted that the background analysis program described in this embodiment is implemented in C++ and the front-end interaction platform is implemented in Shiny, which is only a preferred implementation method. Those skilled in the art can also use other programming languages, front-end frameworks, service calling methods, or deployment methods to implement the methods and systems described in this invention without departing from the spirit and substance of this invention, and all such implementations should fall within the protection scope of this invention.
[0266] Example 7 Implementation of IASmating locally: In this embodiment, the animal mating method based on pedigree and offspring prediction inbreeding coefficient constraints described in this invention is implemented independently on the user's local computing device as a local C++ executable program, IASmating. This implementation does not rely on a cloud platform or online service and can directly complete pedigree checks, individual inbreeding coefficient calculations, inbreeding coefficient calculations for future offspring of candidate males and females, and automatic mating analysis on a local computer or local server environment.
[0267] 1. Overall Implementation Method
[0268] In this embodiment, IASmating is deployed as a locally executable program on the user's terminal device. The user invokes the program via command line, inputting pedigree files, male animal files, female animal files, and operating parameters. The program then performs data reading, calculation processing, candidate combination screening, and result output locally.
[0269] The local operation mode includes at least the following characteristics:
[0270] (1) It does not depend on the front-end web page interface;
[0271] (2) It does not rely on remote server computing resources;
[0272] (3) The analysis task is completed on the local device;
[0273] (4) Both input and output files are stored in the local file system;
[0274] (5) Users can control different analysis modes and filtering conditions through command line parameters.
[0275] 2. Local operating environment
[0276] In a preferred embodiment, the IASmating native program can run in one of the following environments:
[0277] (1) Windows operating system environment;
[0278] (2) Linux operating system environment;
[0279] (3) macOS operating system environment.
[0280] In a preferred embodiment, the program is compiled by a C++ compiler to generate a native executable file, which is then executed by the local processor.
[0281] 3. Local operation mode
[0282] In this embodiment, the IASmating native program supports at least the following operating modes:
[0283] (1) Genealogy check mode
[0284] This tool is used to check local input pedigree files for issues such as duplicate IDs, self-fertilization, missing parents in the pedigree, topological anomalies, or circular dependencies, and generates a local check report.
[0285] (2) Calculation model of individual inbreeding coefficient
[0286] This tool is used to calculate the inbreeding coefficient of existing individuals in a local pedigree file and output the inbreeding results file locally.
[0287] (3) Calculation model of inbreeding coefficient of future offspring of candidate male and female
[0288] This tool is used to read local male and female animal files, batch calculate the predicted inbreeding coefficients of future offspring for all candidate combinations, and output the results file locally.
[0289] (4) Automatic selection mode
[0290] It is used to generate local mating results under constraints of common ancestor, inbreeding coefficient threshold for future offspring prediction, male-to-female ratio, and candidate ranking strategy, and outputs result reports and statistical summaries.
[0291] 4. Local running parameter setting method
[0292] In this embodiment, the IASmating local program receives runtime control information via command-line parameters. These parameters include at least one of the following:
[0293] --check-pedigree: Performs pedigree checking mode;
[0294] --inbreeding: Executes inbreeding coefficient calculation mode;
[0295] --offspring: Calculates the predicted inbreeding coefficients of candidate male and female offspring in the inbreeding calculation mode;
[0296] --mating: Executes automatic matching mode;
[0297] --pedigree: Specifies the path to the local genealogy file;
[0298] --sires: Specifies the path to the local male animal file;
[0299] --dams: Specifies the path to the local female animal files;
[0300] --output: Specifies the local output prefix;
[0301] --ratio: Specifies the male-to-female ratio;
[0302] --generations: Specifies the generations to check for common ancestor;
[0303] --max_inbreeding: Specifies the threshold for predicting inbreeding coefficients of future offspring;
[0304] --strategy: Specifies the candidate sorting strategy;
[0305] --seed: Specifies a random seed;
[0306] --all-pairs-report: Specifies whether to output a report of all candidate combinations;
[0307] --summary: Specifies whether to output statistical summary results;
[0308] --build-ainv: Specifies whether to output the inverse of the relation matrix at the same time.
[0309] Preferably, the candidate ranking strategy includes:
[0310] best_best: Male animals are processed in a positive direction, and female animals are scanned in a positive direction;
[0311] best_worst: Male animals are processed in a forward direction, while female animals are scanned in a reverse direction;
[0312] random: Male animals are processed in a positive direction, while female animals are scanned randomly.
[0313] Furthermore, when using the random strategy, a random seed can be specified via the --seed parameter to ensure consistent random sorting results during repeated local runs.
[0314] 5. Local Operation Process
[0315] In this embodiment, the IASmating local operation process includes:
[0316] (1) The user enters the command line to invoke the instruction in the local terminal;
[0317] (2) The program reads the pedigree file, male animal file, and female animal file from the local file system;
[0318] (3) The program identifies the analysis mode and filtering conditions based on the command line parameters;
[0319] (4) The program constructs the pedigree relationship data structure and performs the corresponding analysis steps;
[0320] (5) The program generates result files, log information, and statistical files locally;
[0321] (6) Users can view the running logs through the local terminal and read the analysis results from the local directory.
[0322] 6. Local running example
[0323] In one specific embodiment, the IASmating local program can perform automatic fitting analysis via the following command:
[0324] . / IASmating --mating --sires sire.id --dams dam.id --pedigree ped.txt --output out --ratio 1:4 --generations 2 --max_inbreeding 0.0625 --strategybest_best --all-pairs-report --summary
[0325] In another specific embodiment, the IASmating local program can perform the calculation of inbreeding coefficients for predicting future offspring of candidate males and females via the following command:
[0326] . / IASmating --inbreeding --offspring --sires sire.id --dams dam.id --pedigree ped.txt --output out
[0327] In another specific embodiment, the IASmating local program can perform a genealogy check via the following command:
[0328] . / IASmating --check-pedigree --pedigree ped.txt --output out
[0329] 7. Local output results
[0330] In this embodiment, the local running program can output at least one of the following result files: pedigree check report file; pedigree issue details file; individual inbreeding result file; candidate male and female future offspring inbreeding result file; final mating result file; successfully selected combination offspring inbreeding result file; all candidate combination report file; statistical summary file; relation matrix inverse file and its index file.
[0331] The above result files are saved as local files in a preset directory or a directory specified by the output prefix.
[0332] 8. Technical advantages of local operation mode
[0333] By adopting this embodiment, at least the following technical effects can be obtained:
[0334] (1) It can complete analysis tasks without relying on a cloud platform and is suitable for local offline environments;
[0335] (2) Execute core computing processes locally, reduce reliance on network transmission, and improve data self-control capabilities;
[0336] (3) The analysis mode and filtering conditions can be flexibly switched through command line parameters to improve the flexibility of software use;
[0337] (4) Suitable for deployment and operation in scientific research terminals, local servers of breeding units, and internal computing environments;
[0338] (5) It facilitates integration with other local data processing or batch processing processes.
[0339] 9. Explanation
[0340] It should be noted that the command-line method used to call the IASmating native C++ program in this embodiment is only a preferred implementation. Those skilled in the art can also implement the same technical solution using a graphical interface, a local script, or a local service encapsulation method without departing from the spirit and substance of this invention, and all such implementations should fall within the protection scope of this invention.
[0341] Example 8 Implementation using C++ software and the Shiny cloud platform: In this embodiment, the animal mating method based on pedigree relationships and offspring prediction inbreeding coefficient constraints described in this invention is implemented collaboratively by IASmating's C++ backend analysis program and the Shiny cloud platform. This embodiment represents a preferred online deployment form of this invention, providing users with a web-based analysis portal, parameter configuration interface, online result display, and result download services.
[0342] 1. Overall Architecture
[0343] The implementation architecture of this embodiment includes: a front-end interaction layer; a back-end analysis layer; a file input / output layer; and a result display and download layer. The front-end interaction layer is built using the Shiny framework to provide a graphical web interface; the back-end analysis layer is implemented using IASmating's C++ program to perform the pedigree checking, individual inbreeding coefficient calculation, prediction of inbreeding coefficients for future offspring of candidate males and females, and automatic mating analysis described in this invention; the file input / output layer is used to save input files, generate result files, record logs, and read files; and the result display and download layer returns the analysis results to the user in log, table, and file formats.
[0344] 2. Cloud Platform Access Method
[0345] In a preferred embodiment, the Shiny cloud platform can be accessed via a network address, such as https: / / iasbreeding.cn / IASmating / . Users can access the online analysis platform through a browser, and complete file uploads, parameter settings, task execution, and result downloads.
[0346] It should be noted that the above access address is only one platform entry form in a preferred embodiment of the present invention, and the present invention is not limited to this specific domain name, path or network deployment address.
[0347] 3. Page Components
[0348] The Shiny cloud platform includes at least the following pages:
[0349] (1) Main page
[0350] This is used to display the platform name, a brief introduction to its functions, core capabilities, usage process, and navigation entry.
[0351] (2) Online running page
[0352] This is used to upload pedigree files, male animal files, and female animal files, set analysis modes and parameters, trigger the background analysis program to run, and display the analysis results.
[0353] (3) Download page
[0354] This provides a download portal for software programs, documentation, sample templates, and result files.
[0355] 4. Functional sections of the online operation page
[0356] The online running page includes at least:
[0357] (1) Analysis type selection area
[0358] Used for: pedigree checking; individual inbreeding coefficient calculation; inbreeding coefficient calculation of future offspring of candidate males and females; automatic mating mode.
[0359] (2) File upload area
[0360] Used for uploading: pedigree files; male animal files; female animal files.
[0361] (3) Parameter setting area
[0362] Used to set: male-to-female ratio; common ancestor check generation; inbreeding coefficient threshold for future offspring prediction; candidate sorting strategy; random seed; whether to output a report of all candidate combinations; and whether to output a statistical summary.
[0363] (4) Operation control area
[0364] Used to receive analysis start commands from users.
[0365] (5) Results display area
[0366] Used to display: operation log; pedigree check results; individual inbreeding results; inbreeding results of future offspring of candidate males and females; final mating results; report of all candidate combinations; statistical summary results.
[0367] (6) Results Download Area
[0368] Used to provide users with downloadable result files.
[0369] 5. Front-end and back-end collaboration methods
[0370] In this implementation, the Shiny cloud platform and IASmating's C++ backend analysis program work together via command invocation, specifically including:
[0371] (1) Users upload input files and set running parameters on the web page interface;
[0372] (2) The Shiny platform will save the uploaded files to the server's working directory or temporary directory;
[0373] (3) The Shiny platform generates background program call commands based on the selected analysis mode and parameters;
[0374] (4) Start the C++ background analysis program of IASmating via system call;
[0375] (5) The C++ background analysis program outputs the result file and running log in the specified directory;
[0376] (6) The Shiny platform reads the result file and running log, and displays them on the web interface;
[0377] (7) Users can download the analysis results file through the web interface.
[0378] In another embodiment, the front-end platform and the back-end program can also communicate via service interfaces, such as submitting analysis requests and returning results through local interfaces, remote interfaces, or task scheduling interfaces. All of the above alternative methods fall within the scope of protection of this invention.
[0379] 6. Cloud Platform Deployment Methods
[0380] In this embodiment, the Shiny cloud platform can be deployed in: a local area network server environment; a cloud server environment; or a dedicated breeding analysis platform environment. In different deployment environments, the core backend analysis logic is executed by IASmating's C++ program, with the Shiny cloud platform serving as the front-end interaction layer for file input, parameter configuration, task triggering, result display, and result download.
[0381] 7. Cloud Platform Technology Effectiveness
[0382] By adopting this embodiment, at least the following technical effects can be obtained:
[0383] (1) The core calculations are performed by the C++ background program of IASmating, which improves the execution efficiency of large-scale pedigree data and analysis of a large number of candidate combinations;
[0384] (2) By providing a web-based interactive interface through the Shiny cloud platform, the threshold for users to use the platform is reduced and the operability of the platform is improved;
[0385] (3) Through the front-end and back-end separation implementation architecture, the method of the present invention can reuse the same analysis core between local tools and cloud platforms;
[0386] (4) An integrated analysis process of "file upload - parameter setting - background analysis - result display - file download" is realized through online access;
[0387] (5) Improve the interpretability and verifiability of the analysis results by displaying the results table, candidate combination report and statistical summary information online.
[0388] 8. Explanation
[0389] It should be noted that the background analysis program described in this embodiment is implemented in C++, the front-end interaction platform is implemented in Shiny, and https: / / iasbreeding.cn / IASmating / is used as the preferred access point. This is only one preferred implementation. Those skilled in the art can also use other programming languages, web frameworks, calling methods, deployment methods, or access addresses to implement the methods and systems described in this invention without departing from the spirit and substance of this invention, and all such implementations should fall within the protection scope of this invention.
Claims
1. An animal mating method based on pedigree and offspring prediction inbreeding coefficient constraints, characterized in that, include: S1. Obtain animal pedigree data, male animal individual data, and female animal individual data, wherein the pedigree data includes at least an individual identifier, a paternal identifier, and a maternal identifier; S2. Perform legality checks and structured processing on the genealogy data, wherein: The legality checks include at least one of the following: duplicate individual identifier checks, checks that the parent or mother is equal to the individual itself, checks that the parent individual is missing from the pedigree, topological anomaly checks, and circular dependency checks; The structured processing includes establishing an individual identifier index, supplementing parent individuals that are referenced by offspring but do not appear independently in the pedigree, marking individuals whose parent information is unknown as ancestral individuals, and performing topological sorting on all individuals based on the rule of parents first and offspring last, in order to construct a pedigree relationship data structure. S3. Based on the pedigree relationship data structure, calculate the inbreeding coefficient of the individuals already in the pedigree to obtain the individual inbreeding results; S4. For the candidate male-female combination, based on the pedigree relationship data structure, trace back the ancestral sets of the candidate male and candidate female animals within a preset generation range, and determine whether there is an intersection between the two ancestral sets, so as to determine whether the candidate male-female combination has a common ancestor within the preset generation range. S5. For candidate male-female combinations that do not have a common ancestor within the preset generation range, calculate the predicted inbreeding coefficient of the future offspring of the combination based on the pedigree relationship value between the candidate male and the candidate female, and there is no need to pre-write the future offspring into the original pedigree data during the calculation process. S6. Compare the predicted inbreeding coefficient of the future offspring with a preset inbreeding threshold, and filter out candidate male-female combinations whose predicted inbreeding coefficient exceeds the preset inbreeding threshold; S7. Based on the preset male-female ratio and candidate sorting strategy, generate a selection result from the selected candidate male-female combinations; the candidate sorting strategy includes at least one of the following: a first strategy where male animals are processed in the forward order of input and female animals are processed in the forward order of input; a second strategy where male animals are processed in the forward order of input and female animals are processed in the reverse order of input; a third strategy where male animals are processed in the forward order of input and female animals are processed in a random order; when the third strategy is adopted, a random order of female animals is further generated based on reproducible random seed parameters; S8. Output at least one result information including the selected result.
2. The animal mating method based on pedigree and offspring prediction inbreeding coefficient constraints as described in claim 1, characterized in that, In step S7, when the third strategy is adopted, a local random seed is formed by combining the basic random seed and the male animal index for different male animals, so that the random scanning order of the female animals corresponding to different male animals is different, and consistent mating results are obtained when running repeatedly under the same input data and the same random seed parameters.
3. The animal mating method based on pedigree and offspring prediction inbreeding coefficient constraints according to claim 1, characterized in that, In step S8, the output result information further includes at least one of the following: The candidate combination screening results include: candidate male animal identifier, candidate female animal identifier, whether there is a common ancestor within a preset generation range, predicted inbreeding coefficient of future offspring, whether the screening is passed and the reasons for the screening; Results of individual inbreeding; The statistical summary results include at least one of the following: total number of individuals in the pedigree, total number of candidate combinations, number of combinations filtered due to common ancestor constraints, number of combinations filtered due to the predicted inbreeding coefficient of future offspring exceeding the threshold, number of successfully paired combinations, individual inbreeding statistics, and inbreeding statistics of future offspring of candidate combinations.
4. An animal mating system based on pedigree and offspring prediction inbreeding coefficient constraints, characterized in that, The system is used to implement the animal mating method based on pedigree and offspring prediction inbreeding coefficient constraints as described in any one of claims 1 to 3, comprising: The data acquisition module is used to acquire animal pedigree data, individual data of male animals, and individual data of female animals; A genealogy checking and structuring module is used to perform the legality check and structuring processing on the genealogy data as described in step S2 of claim 1, so as to construct a genealogy relationship data structure; The individual inbreeding calculation module is used to calculate the inbreeding coefficient of existing individuals in the pedigree; The common ancestor determination module is used to determine whether candidate male and candidate female animals have a common ancestor within a preset generation range; The offspring inbreeding prediction module is used to calculate the predicted inbreeding coefficient of future offspring of candidate male-female combinations; The filtering module is used to filter candidate male-female combinations based on common ancestor constraints and inbreeding thresholds; The pairing generation module is used to generate pairing results based on a preset male-female ratio and candidate sorting strategy; The output module is used to output the selection results and related information.
5. The animal mating system based on pedigree and offspring prediction inbreeding coefficient constraints according to claim 4, characterized in that, The system has a local operating mode and is configured to be implemented by a local executable program. The local executable program receives the pedigree file path, the male animal file path, the female animal file path, and operating parameters, and independently completes each step of the method on the local computing device, and controls the operating mode through command line parameters. The operating mode includes at least a pedigree check mode, an individual inbreeding coefficient calculation mode, a candidate male and female future offspring inbreeding coefficient calculation mode, and an automatic mating mode.
6. The animal mating system based on pedigree and offspring prediction inbreeding coefficient constraints according to claim 4, characterized in that, The system operates in a cloud platform configuration and is configured to include a front-end interactive platform and a back-end analysis program. The front-end interactive platform is used to receive pedigree files, male animal files, and female animal files uploaded by users, obtain the operating parameters set by users, trigger the execution of the background analysis program, and display the analysis results and provide result downloads. The background analysis program is used to perform the calculation steps of the method as described in any one of claims 1 to 3.
7. The animal mating system based on pedigree and offspring prediction inbreeding coefficient constraints according to claim 6, characterized in that, The background analysis program is implemented in C++, and the front-end interaction platform is implemented using the Shiny platform. The front-end interactive platform communicates with the back-end analysis program via command invocation or service interface, saves uploaded files to the working directory, generates back-end analysis program invocation commands based on analysis mode and running parameters, and reads and displays result files and running logs after the back-end analysis program has finished executing.
8. An electronic device, characterized in that, The device includes a processor and a memory, wherein the memory stores a computer program, which, when executed by the processor, causes the electronic device to perform an animal mating method based on pedigree and offspring prediction inbreeding coefficient constraints, as described in any one of claims 1 to 3.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements an animal mating method based on pedigree and offspring prediction inbreeding coefficient constraints, as described in any one of claims 1 to 3.