A method and system for biogeographical ancestry inference fusing ibd segment features

CN123017159APending Publication Date: 2026-10-30INST OF FORENSIC SCI OF MIN OF PUBLIC SECURITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611066581.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-17
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

然而,主成分特征对洲际内部遗传背景相近的亚人群区分能力有限,导致亚人群层次的推断准确率不足,难以满足精细尺度祖源推断的实际需求

Benefits of technology

[0014]本发明第四方面提供一种计算机可读存储介质,所述计算机可读存储介质上存储有指令,所述指令被处理器执行时实现如以上任一项所述的一种融合IBD片段特征的生物地理祖源推断方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123017159A_ABST
    Figure CN123017159A_ABST
Patent Text Reader

Abstract

The present application relates to the field of bioinformatics, and provides a method and system for inferring biogeographical ancestry by fusing IBD segment features. The method comprises: performing quality control processing on whole genome SNP data to obtain a reference population SNP dataset; performing IBD segment detection and principal component analysis on the reference population SNP dataset respectively to obtain an IBD feature matrix and a PC feature matrix; fusing the IBD feature matrix and the PC feature matrix as joint input features; training a classification model for the joint input features by a TabPFN algorithm to obtain an ancestry inference classification model; and inputting SNP data of a sample to be tested into the ancestry inference classification model to obtain a biogeographical ancestry inference result of the sample to be tested. The present application improves the fineness and resolution of ancestry inference.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of bioinformatics technology, and in particular to a method and system for inferring biogeographical ancestry by integrating IBD fragment features. Background Technology

[0002] Biogeographical ancestry inference is a crucial research area in forensic science. It aims to trace the biogeographical origins of an individual's ancestral group by analyzing their genotyping data, playing a key role in scenarios such as tracing the origins of unknown individuals and identifying victims of disasters. Research in this field typically encompasses finely segmented data at multiple levels, from intercontinental populations to subpopulations in specific regions. With the continuous development of whole-genome SNP microarrays and high-throughput sequencing technologies, researchers are now able to efficiently acquire genotyping data from high-density SNP loci, laying a data foundation for accurate ancestry analysis.

[0003] Existing high-density SNP biogeographical ancestry inference methods mainly rely on principal component features derived from dimensionality reduction using principal component analysis, combined with machine learning classification algorithms to construct predictive models. However, principal component features have limited ability to distinguish subpopulations with similar genetic backgrounds within continents, resulting in insufficient inference accuracy at the subpopulation level and failing to meet the practical needs of fine-scale ancestry inference. Summary of the Invention

[0004] This invention provides a biogeographical ancestry inference method and system that integrates IBD fragment features to overcome the shortcomings of existing technologies.

[0005] The first aspect of this invention provides a method for inferring biogeographical ancestry by fusing IBD fragment features, comprising: S1. Perform quality control processing on the whole genome SNP data to obtain the reference population SNP dataset; S2. Perform IBD fragment detection and principal component analysis on the SNP dataset of the reference population to obtain the IBD feature matrix and PC feature matrix; S3. The IBD feature matrix and the PC feature matrix are fused together as joint input features. The TabPFN algorithm is used to train a classification model on the joint input features to obtain an ancestor inference classification model. S4. Input the SNP data of the sample to be tested into the ancestry inference classification model to obtain the biogeographical ancestry inference results of the sample to be tested.

[0006] According to the biogeographical ancestry inference method that integrates IBD fragment features provided by the present invention, step S1 further includes: S11. Extract autosomal SNP sites from the reference dataset and the target dataset to obtain a candidate SNP set; S12. The candidate SNP set is filtered sequentially according to the site detection rate threshold, the minor allele frequency threshold, and the Hardy-Weinberg balance test threshold to obtain the filtered SNP set. S13. Using a sliding window strategy, perform chain imbalance pruning on the filtered SNP set to obtain the reference population SNP dataset.

[0007] According to the biogeographical ancestry inference method that integrates IBD fragment features provided by the present invention, step S2, the step of detecting IBD fragments in the reference population SNP dataset, further includes: S211. IBD fragment identification is performed on each pair of individuals in the reference population SNP dataset using the IBIS algorithm, and the data is filtered according to the IBD fragment length threshold and the error rate threshold to obtain the IBD fragment length data between individuals. S212. Based on the IBD fragment length data between individuals, the average IBD fragment length of the reference sample and each individual in the subpopulation is calculated to obtain the IBD feature value of the reference sample corresponding to the subpopulation. S213. Arrange the IBD feature values ​​of the reference sample and all subgroups to obtain the IBD feature matrix.

[0008] According to the biogeographical ancestry inference method that integrates IBD fragment features provided by the present invention, step S2, the step of performing principal component analysis on the reference population SNP dataset, further includes: S221. Calculate the genetic relationship matrix of the reference population SNP dataset using GCTA software; S222. Perform feature decomposition on the genetic relationship matrix, extract the principal components of the number of preceding principal components, and obtain the PC feature matrix.

[0009] According to the biogeographical ancestry inference method that integrates IBD fragment features provided by the present invention, step S3 further includes: S31. Divide the reference population SNP dataset into a training set and a validation set according to the five-fold cross-validation strategy; S32. Based on the training set and validation set, the input is constructed in three ways: a single PC feature matrix, a single IBD feature matrix, and a joint input feature matrix formed by the PC feature matrix and the IBD feature matrix. The input is used to train the classification model using the TabPFN algorithm to obtain three sets of candidate inference classification models. S33. For the three candidate inference classification models, calculate the first prediction accuracy, LR consistency rate, LR accuracy and LR error rate at the intercontinental level and subpopulation level respectively, and obtain the multidimensional evaluation results of each candidate inference classification model. S34. Based on the multidimensional evaluation results, the first prediction accuracy and LR consistency rate at the sub-population level are used as the main evaluation indicators to compare the three candidate inference classification models, and the candidate inference classification model corresponding to the joint input features is determined as the optimal input scheme. S35. Based on the optimal input scheme, the number of principal components in the joint input features is continuously optimized to obtain the optimal number of principal components. The joint input features containing the optimal number of principal components are then re-input into the TabPFN algorithm for training to obtain the ancestor inference classification model.

[0010] According to the biogeographical ancestry inference method fused with IBD fragment features provided by the present invention, in step S4, before inputting the SNP data of the sample to be tested into the ancestry inference classification model, the method further includes: The sum of IBD feature values ​​of the test sample is calculated. When the sum of IBD feature values ​​is lower than a preset threshold, only the PC feature matrix of the test sample is used as the input feature. When the sum of IBD feature values ​​is greater than or equal to the preset threshold, the joint input feature is used as the input feature.

[0011] According to the biogeographical ancestry inference method that integrates IBD fragment features provided by the present invention, in step S4, the biogeographical ancestry inference results include: intercontinental level inference results and subpopulation level inference results.

[0012] A second aspect of the present invention provides a biogeographical ancestry inference system that integrates IBD fragment features, comprising: Quality control module: Used to perform quality control processing on whole-genome SNP data to obtain a reference population SNP dataset; Analysis module: used to perform IBD fragment detection and principal component analysis on the reference population SNP dataset to obtain the IBD feature matrix and PC feature matrix; Training module: used to fuse the IBD feature matrix and the PC feature matrix as joint input features, and to train a classification model on the joint input features using the TabPFN algorithm to obtain an ancestry inference classification model; The output module is configured as the ancestry inference classification model obtained by the training module, which is used to receive the SNP data of the test sample and infer the biogeographical ancestry inference result of the test sample.

[0013] A third aspect of the present invention provides a biogeographical ancestry inference device that integrates IBD fragment features, comprising: a memory and at least one processor, wherein the memory stores instructions; and at least one processor invokes the instructions in the memory to cause the biogeographical ancestry inference device that integrates IBD fragment features to perform a biogeographical ancestry inference method that integrates IBD fragment features as described in any of the preceding claims.

[0014] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed by a processor, implement a biogeographical ancestry inference method that integrates IBD fragment features as described in any of the preceding claims.

[0015] This invention provides a biogeographical ancestry inference method, system, device, and storage medium that integrates IBD fragment features. By fusing the IBD feature matrix and the PC feature matrix to construct joint input features, and introducing the TabPFN algorithm for classification model training, the first prediction accuracy and LR consistency rate at the subpopulation level are improved compared to using principal component features alone, effectively making up for the shortcomings of traditional principal component methods in fine subpopulation differentiation. In the quality control stage, this invention applies multiple filters to the candidate SNP set, including detection rate, minor allele frequency, Hardy-Weinberg balance, and linkage disequilibrium, to ensure the reliability of subsequent feature extraction data. This results in the model achieving a first-order accuracy and LR consistency rate of over 99% at the intercontinental level on the reference set. Furthermore, by continuously optimizing the number of principal components, this invention locks in the optimal feature dimension while maintaining model computational efficiency, avoiding performance degradation due to feature redundancy. In addition, the mechanism of automatically switching to individual PC feature input for test samples with IBD feature sums below a preset threshold effectively avoids the risk of erroneous predictions in IBD information-sparse scenarios, enhancing the model's robustness under different data quality conditions. In the validation on the independent test set, the first-order accuracy at the intercontinental level and the first-order accuracy at the subpopulation level for homologous group samples is extremely high. Most samples in the generalized group can be predicted to the same country or region as the reference population, indicating that this invention has good generalization ability and practical application value in diverse population contexts. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1A schematic diagram of the biogeographical ancestry inference method that integrates IBD fragment features provided by the present invention; Figure 2 This is a schematic diagram of a biogeographical ancestry inference system that integrates IBD fragment features, provided by the present invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, embodiments of this invention, and should not be construed as limiting the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention. In the description of this invention, it should be understood that the terminology used is for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0019] The embodiments of the present invention are described below with reference to the figures.

[0020] like Figure 1 As shown, this invention provides a biogeographical ancestry inference method that integrates IBD fragment features, comprising: S1. Perform quality control processing on the whole genome SNP data to obtain the reference population SNP dataset.

[0021] Step S1 further includes: S11. Extract autosomal SNP sites from the reference dataset and the target dataset to obtain a candidate SNP set.

[0022] Furthermore, both the reference dataset and the target dataset contain SNP sites across the entire genome. In step S11, this invention extracts the intersection of autosomal SNP sites from both datasets, removes sites on sex chromosomes and the mitochondrial genome, and obtains a candidate SNP set. The purpose of extracting the intersection is to ensure that the reference dataset and the target dataset share the same site coordinate system in subsequent processing, so that their genotype data can be compared and fused on the same site dimension.

[0023] S12. The candidate SNP set is filtered sequentially according to the site detection rate threshold, the minor allele frequency threshold, and the Hardy-Weinberg balance test threshold to obtain the filtered SNP set.

[0024] In step S12, this invention applies three filters sequentially to the candidate SNP set. The site detection rate is the proportion of samples in all samples where a genotyping result for a specific SNP site is successfully obtained. Sites with a detection rate below a threshold indicate that the site has a missing genotype in a large number of samples. This invention sets the detection rate threshold to 0.01, meaning sites with a missing rate exceeding 0.01 are removed. The minor allele frequency is the proportion of alleles with lower frequencies at a specific SNP site among all alleles. Sites with excessively low frequencies have limited distinguishing ability between populations. This invention sets the minor allele frequency threshold to 0.01, removing sites below this threshold. The Hardy-Weinberg equilibrium test checks whether the genotype frequency of a specific SNP site conforms to the equilibrium distribution in an ideal population. Sites deviating from equilibrium often have genotyping errors. This invention sets the p-value threshold for the test to 10. - ¹ 0 Sites with P-values ​​below the threshold are removed. Finally, after performing these three filtering steps sequentially, a filtered SNP set is obtained.

[0025] S13. Using a sliding window strategy, perform chain imbalance pruning on the filtered SNP set to obtain the reference population SNP dataset.

[0026] Furthermore, linkage disequilibrium refers to the phenomenon where alleles of two SNP loci on the genome are not randomly co-inherited in a population. The degree of linkage disequilibrium between adjacent loci is measured by the r² value; the closer r² is to 1, the more redundant the genetic information carried by the two loci. For linkage disequilibrium, this invention employs a sliding window strategy to perform linkage disequilibrium pruning on the filtered SNP set, setting the window size to 200 SNP loci, the step size to 25 SNP loci, and the r² threshold to 0.4. Within each window, the r² value between all locus pairs within the window is calculated. For locus pairs with r² exceeding 0.4, one locus is removed. Then, the window is slid 25 loci along the chromosome direction, and the above calculation and removal operations are repeated for the loci in the new window, continuing until all chromosomal loci have been processed, ultimately obtaining the reference population SNP dataset.

[0027] S2. Perform IBD fragment detection and principal component analysis on the SNP dataset of the reference population to obtain the IBD feature matrix and PC feature matrix.

[0028] In step S2, the step of detecting IBD fragments in the reference population SNP dataset further includes: S211. IBD fragment identification is performed on each pair of individuals in the reference population SNP dataset using the IBIS algorithm. The individuals are then filtered according to the IBD fragment length threshold and the error rate threshold to obtain the IBD fragment length data between individuals.

[0029] Furthermore, an IBD fragment refers to a continuous, unrecombined DNA fragment originating from the same ancestral chromosome between two individuals, with its length measured in centimoles (cM). In step S211, this invention uses the IBIS algorithm to identify IBD fragments for each pair of individuals in the reference population SNP dataset. Specifically, this invention uses the IBIS algorithm to directly scan chromosomes based on genotype data, without prior haplotype phasing. It identifies segments of genotype consistency between the two individuals on each chromosome for each pair, and then calculates the IBD fragment length, as detailed below.

[0030] The formula for calculating IBD within a population is:

[0031] in, For the group The average IBD fragment length inside; For the group The total number of individuals in the group; , For the group The numbers of any two individuals in the set, and This ensures that each pair of individuals is counted only once; For individuals With individuals The length of the filtered IBD fragments; Representing a group The total number of all possible pairs of individuals within the group.

[0032] The formula for calculating inter-group IBD is:

[0033] in, For the group with the group Average IBD fragment length between; For the group The total number of individuals in the group; For the group The total number of individuals in the group; For the group The individual's ID number; For the group The individual's ID number; For the group medium-sized individuals with the group medium-sized individuals The length of the filtered IBD fragments; denominator Representing a group with the group The total number of all possible pairs of individuals.

[0034] The identified segments will then be filtered according to the IBD segment length threshold and the error rate threshold. Segments with a length lower than the threshold or an error rate higher than the threshold will be removed. The filtered IBD segment length between each pair of individuals will be output to obtain the IBD segment length data between individuals.

[0035] S212. Based on the IBD fragment length data between individuals, the average IBD fragment length of the reference sample and each individual in the subpopulation is calculated to obtain the IBD feature value of the reference sample corresponding to the subpopulation.

[0036] In step S212, based on the IBD fragment length data between individuals, this invention calculates the IBD feature value of each reference sample in the reference dataset and its relationship with each subpopulation. For a certain reference sample and a certain subpopulation, this invention extracts the IBD fragment length data between the reference sample and all individuals within that subpopulation. After extraction, the average of the extracted IBD fragment lengths is calculated, and the resulting average value is the IBD feature value of the reference sample corresponding to that subpopulation. This feature value reflects the average genetic affinity between the reference sample and a specific subpopulation; the closer the genetic distance, the larger the IBD feature value of the sample and its corresponding subpopulation.

[0037] The formula for calculating the IBD feature value of the sample to be tested in step S212 is as follows:

[0038] in, For the sample to be tested Corresponding to subgroups IBD eigenvalues; The sample to be tested; For a certain subgroup; For subgroups The total number of individuals in the group; For subgroups The Middle Individual; For the sample to be tested subgroups The Middle The length of the filtered IBD fragments among individuals; The total number of sample pairs, i.e., the number of samples to be tested. subgroups The number of sample pairs consisting of all individuals in the sample. .

[0039] S213. Arrange the IBD feature values ​​of the reference sample and all subgroups to obtain the IBD feature matrix.

[0040] In step S213, the present invention uses the IBD feature values ​​of each reference sample corresponding to each subgroup obtained in S212 to arrange the IBD feature values ​​of each reference sample and all subgroups in a fixed order as a row feature vector. Then, the feature vectors of all reference samples are stacked in rows to form an IBD feature matrix. The row dimension of the matrix corresponds to the reference sample, the column dimension corresponds to each subgroup, and each element in the matrix is ​​the IBD feature value between the corresponding reference sample and the corresponding subgroup.

[0041] In step S2, the step of performing principal component analysis on the reference population SNP dataset further includes: S221. Calculate the genetic relationship matrix of the reference population SNP dataset using GCTA software.

[0042] In step S221, the present invention reads the genotype data of the reference population SNP dataset through GCTA software. The GCTA software performs standardization processing on the genotype data by locus. Then, based on the standardized genotype matrix, the inner product between all pairs of reference samples is calculated, and the genetic relationship matrix is ​​output. The obtained matrix is ​​a symmetric square matrix, with rows and columns corresponding to reference samples. Each element in the matrix represents the genetic affinity coefficient between the corresponding two samples based on whole-genome SNP data.

[0043] S222. Perform feature decomposition on the genetic relationship matrix, extract the principal components of the number of preceding principal components, and obtain the PC feature matrix.

[0044] In step S222, the present invention performs eigenvalue decomposition on the genetic relationship matrix obtained in S221, decomposing the genetic relationship matrix into eigenvalues ​​and eigenvectors. The eigenvalues ​​are arranged in descending order, and a number of leading eigenvectors are extracted sequentially. Each eigenvector represents the genetic variation pattern with the largest variance in that direction for the reference sample population. Subsequently, the present invention arranges the projection values ​​of all reference samples in each eigenvector direction column by column to obtain the PC feature matrix. The row dimension of this matrix corresponds to the reference samples, and the column dimension corresponds to each principal component. Each element in the matrix is ​​the projection value of the corresponding reference sample onto the corresponding principal component.

[0045] S3. The IBD feature matrix and the PC feature matrix are fused together as joint input features. The TabPFN algorithm is used to train a classification model on the joint input features to obtain an ancestor inference classification model.

[0046] Step S3 further includes: S31. Divide the reference population SNP dataset into a training set and a validation set according to the five-fold cross-validation strategy.

[0047] In step S31, the present invention divides all reference samples corresponding to the SNP dataset of the reference population according to a five-fold cross-validation strategy. Five-fold cross-validation involves randomly dividing all samples into five equal parts, taking four parts as the training set and the remaining part as the validation set each time, and performing this process five times in rotation, ensuring that each sample is evaluated as a validation set exactly once. In a specific embodiment, the present invention randomly divides 1736 reference samples into five equal parts, taking the IBD feature matrix and PC feature matrix corresponding to four of the samples as the training set input each time, and taking the IBD feature matrix and PC feature matrix corresponding to the remaining sample as the validation set. After five rotations, a training set and validation set partitioning result covering all reference samples is obtained.

[0048] S32. Based on the training set and validation set, the input is constructed in three ways: a single PC feature matrix, a single IBD feature matrix, and a joint input feature matrix formed by the PC feature matrix and the IBD feature matrix. The TabPFN algorithm is used to train the classification model, resulting in three sets of candidate inference classification models.

[0049] Specifically, TabPFN is a tabular data classification model based on the Transformer architecture. It learns the mapping relationship from input features to class labels by pre-training on a large number of synthetic datasets. It receives a feature matrix in tabular form and the corresponding class labels, and outputs the predicted probability of each class after a single forward propagation.

[0050] In step S32, this invention uses the training set and validation set obtained in S31 as a basis to construct classification models using three different input methods. The first method uses only the PC feature matrix as input, extracting the row vectors of the PC feature matrix corresponding to the training set samples and their subgroup labels, inputting them into the TabPFN for training, and then using the row vectors of the PC feature matrix of the validation set samples as input to perform prediction, obtaining the first set of candidate inference classification models. The second method uses only the IBD feature matrix as input, extracting the row vectors of the IBD feature matrix corresponding to the training set samples and their subgroup labels, inputting them into the TabPFN for training, and then using the row vectors of the IBD feature matrix of the validation set samples to perform prediction, obtaining the second set of candidate inference classification models. The third method concatenates the PC feature matrix and the IBD feature matrix column-wise to form joint input features, extracts the row vectors of the joint input features corresponding to the training set samples and their subgroup labels, inputting them into the TabPFN for training, and then using the row vectors of the joint input features of the validation set samples to perform prediction, obtaining the third set of candidate inference classification models.

[0051] All three methods were performed under the five-fold cross-validation framework, with each method yielding five validation results. The results were then aggregated to obtain the prediction results of three candidate inference classification models.

[0052] S33. For the three candidate inference classification models, calculate the first prediction accuracy, LR consistency rate, LR accuracy and LR error rate at the intercontinental level and subpopulation level respectively, and obtain the multidimensional evaluation results of each candidate inference classification model.

[0053] In step S33, based on the prediction results of the three candidate inference classification models on the validation set, this invention calculates four evaluation indicators at the intercontinental and subpopulation levels, respectively. The first prediction accuracy rate is the ratio of the number of samples in the validation set whose first predicted class matches the true class to the total number of validation samples; the LR consistency rate is the ratio of the probability of the first predicted class output by the model to the probabilities of the other classes, with an LR value greater than 10 indicating a consistent conclusion, and the LR consistency rate is the ratio of the number of consistent conclusion samples to the total number of validation samples; the LR accuracy rate is the ratio of the sum of the number of consistent conclusion samples and the number of non-exclusion conclusion samples to the total number of validation samples, where a non-exclusion conclusion means the correct class is included in the first few predictions with an LR value not exceeding 10; the LR error rate is the ratio of the number of samples whose correct class is not included in the first few predictions to the total number of validation samples. Based on these four indicators, this invention calculates the values ​​of the four indicators for each of the three candidate inference classification models at both the intercontinental and subpopulation levels, obtaining multidimensional evaluation results for each candidate inference classification model.

[0054] S34. Based on the multidimensional evaluation results, the first prediction accuracy and LR consistency rate at the sub-population level are used as the main evaluation indicators to compare the three candidate inference classification models, and the candidate inference classification model corresponding to the joint input features is determined as the optimal input scheme.

[0055] In step S34, this invention uses the first-order prediction accuracy and LR consistency rate at the subpopulation level as the main evaluation indicators to compare the multidimensional evaluation results of the three candidate inference classification models obtained in S33. In a specific embodiment, among the three candidate inference classification models, the candidate inference classification model corresponding to the joint input features has a first-order prediction accuracy of 91.47% at the subpopulation level, which is higher than the 87.67% corresponding to the individual PC feature matrix and the 89.46% corresponding to the individual IBD feature matrix; the LR consistency rate is 74.08%, which is higher than the 62.85% corresponding to the individual PC feature matrix and the 70.39% corresponding to the individual IBD feature matrix. Based on this, this invention determines the candidate inference classification model corresponding to the joint input features as the optimal input scheme.

[0056] S35. Based on the optimal input scheme, the number of principal components in the joint input features is continuously optimized to obtain the optimal number of principal components. The joint input features containing the optimal number of principal components are then re-input into the TabPFN algorithm for training to obtain the ancestor inference classification model.

[0057] Based on the optimal input scheme determined in S34, step S35 of this invention continuously optimizes the number of principal components in the joint input features. Specifically, this invention sequentially sets the number of principal components to 5, 10, 20, 40, 80, 160, and 450. For each candidate number of principal components, the corresponding number of principal component column vectors are extracted from the PC feature matrix and concatenated column-wise with the IBD feature matrix to form the current candidate joint input features. Subsequently, the current candidate joint input features are input into TabPFN for training and validation under a five-fold cross-validation framework, and the first prediction accuracy and LR consistency rate at the subpopulation level are calculated. After performing the above process sequentially for all candidate principal component numbers, this invention compares the first prediction accuracy and LR consistency rate corresponding to each candidate principal component number, selects the principal component number corresponding to the peak first prediction accuracy as the optimal number of principal components, concatenates the PC feature matrix containing the columns corresponding to the optimal number of principal components with the IBD feature matrix column-wise to form the final joint input features, and finally inputs the final joint input features corresponding to all reference samples and their subpopulation labels into TabPFN for training to obtain the ancestry inference classification model.

[0058] S4. Input the SNP data of the sample to be tested into the ancestry inference classification model to obtain the biogeographical ancestry inference results of the sample to be tested; the biogeographical ancestry inference results include: intercontinental level inference results and subpopulation level inference results.

[0059] In step S4, before inputting the SNP data of the sample to be tested into the ancestry inference classification model, the following steps are also included: The sum of IBD feature values ​​of the test sample is calculated. When the sum of IBD feature values ​​is lower than a preset threshold, only the PC feature matrix of the test sample is used as the input feature. When the sum of IBD feature values ​​is greater than or equal to the preset threshold, the joint input feature is used as the input feature.

[0060] In step S4, before inputting the SNP data of the sample to be tested into the ancestry inference classification model, the present invention first merges the SNP data of the sample to be tested with the SNP dataset of the reference population, takes the intersection of the SNP sites of the two, and extracts the genotype data of the sample to be tested based on the intersection sites.

[0061] Subsequently, following the same processing path as the reference sample, the IBD segment length between the test sample and each individual in the subgroup in the reference dataset is calculated using the IBIS algorithm. The mean value is calculated for each subgroup to obtain the IBD feature value of the test sample corresponding to each subgroup. The IBD feature values ​​corresponding to all subgroups are summed to obtain the total IBD feature value of the test sample.

[0062] When the sum of IBD feature values ​​is less than a preset threshold of 1 cM, this invention only extracts the projection values ​​of the sample to be tested on each principal component corresponding to the optimal number of principal components, forming the PC feature row vector of the sample to be tested, and inputs the row vector into the ancestry inference classification model; when the sum of IBD feature values ​​is greater than or equal to 1 cM, this invention concatenates the subpopulation IBD feature values ​​of the sample to be tested with the PC feature row vector column by column, forming the joint input feature row vector of the sample to be tested, and inputs the row vector into the ancestry inference classification model.

[0063] The ancestry inference classification model performs forward propagation on the input feature row vectors and outputs the predicted probability of the test sample belonging to each continent and subpopulation. This invention takes the category with the highest predicted probability as the first prediction result, and combines it with the LR value judgment rule to obtain the continental level inference result and the subpopulation level inference result of the test sample, which together constitute the biogeographical ancestry inference result.

[0064] The following section, in conjunction with the technical content of steps S1 to S4, further explains the model structure of the ancestor inference classification model trained by this invention.

[0065] This invention uses TabPFN as the basic architecture of the ancestor inference classification model. TabPFN stands for TabularPrior-data Fitted Network, which is a tabular data classification model built on the Transformer architecture.

[0066] The core mechanism of the Transformer architecture is self-attention. Self-attention calculates the relevance weights between each element in the input sequence and all other elements, and then uses this weighted aggregation of the feature representations of all elements to output a new feature representation for each element that incorporates global context information. In TabPFN, each row of the input tabular data is treated as an element in the sequence, and each column of features is treated as an attribute of that element. The self-attention mechanism calculates the relevance between all training sample rows, allowing the model to simultaneously reference the feature distribution information of all training samples when making a prediction for a given sample.

[0067] In this invention, the processing flow of TabPFN during the training phase is as follows: The joint input feature matrix corresponding to the training set samples and its subgroup labels are simultaneously input into TabPFN. TabPFN concatenates the feature vector of each sample in the joint input feature matrix with its corresponding subgroup label into an input record. The input records of all training samples form an input sequence, which, after self-attention calculation by a multi-layer Transformer encoder and transformation by a feedforward network, outputs a context-aware feature representation for each training sample. Subsequently, TabPFN performs the same encoding process on the feature vectors of the validation set or test samples. Combining the context-aware feature representations of the training samples, the output layer calculates the probability distribution of the predicted sample belonging to each subgroup category, and outputs the predicted probability value for each category.

[0068] Regarding the pre-training mechanism, the TabPFN of this invention is pre-trained on millions of synthetic small-scale tabular datasets. These synthetic datasets cover a variety of feature distributions and category structures, enabling TabPFN to learn a general mapping capability from arbitrary tabular features to category labels during the pre-training stage.

[0069] Therefore, when the joint input feature matrix is ​​input into TabPFN according to this invention, TabPFN does not need to perform parameter optimization from scratch. It can complete the classification inference of the new dataset through a single forward propagation, demonstrating efficient classification performance on datasets with no more than 10,000 samples and no more than 500 features. In a specific embodiment, the reference dataset of this invention contains 1,736 samples, and the joint input feature dimension is 26 IBD feature values ​​plus the optimal number of principal components (PC features), all of which meet the above-mentioned size constraints. TabPFN can directly perform efficient classification on a joint input feature matrix of this size.

[0070] During the prediction phase, TabPFN receives the feature vector of the sample to be tested, combines it with the joint input feature matrix of all the input training samples and their subpopulation labels, and completes the class probability prediction of the sample to be tested in the same forward propagation. It outputs the predicted probability distribution of the sample to be tested belonging to each continent and each subpopulation. Based on this, the present invention extracts the first predicted class and the corresponding LR value to obtain the final biogeographical ancestry inference result.

[0071] like Figure 2 As shown, the present invention also provides a biogeographical ancestry inference system that integrates IBD fragment features, comprising: Quality control module 100: Used to perform quality control processing on whole-genome SNP data to obtain a reference population SNP dataset; Analysis module 200: used to perform IBD fragment detection and principal component analysis on the reference population SNP dataset to obtain the IBD feature matrix and PC feature matrix; Training module 300: used to fuse the IBD feature matrix and the PC feature matrix as joint input features, and to train a classification model on the joint input features using the TabPFN algorithm to obtain an ancestor inference classification model; The output module 400 is configured as the ancestry inference classification model obtained by the training module 300, which is used to receive the SNP data of the test sample and infer the biogeographical ancestry inference result of the test sample.

[0072] The present invention also provides a biogeographical ancestry inference device that integrates IBD fragment features, comprising: a memory and at least one processor, wherein the memory stores instructions; at least one of the processors invokes the instructions in the memory to cause the biogeographical ancestry inference device that integrates IBD fragment features to perform a biogeographical ancestry inference method that integrates IBD fragment features as described in any of the preceding claims.

[0073] The present invention also provides a computer-readable storage medium storing instructions that, when executed by a processor, implement a biogeographical ancestry inference method that integrates IBD fragment features as described in any of the preceding claims.

[0074] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0075] In one specific embodiment, this invention selects whole-genome SNP data from 1736 unrelated samples from Phase III of the 1000 Genomes Project as the reference set for model construction, obtaining a total of 340,938 SNP loci after quality control. Secondly, the IBD (Individual Blinding) calculation among populations is first applied using the Identical by Descent via Identical by State (IBIS) algorithm to study sharing patterns. Subsequently, IBD and PC (Positive Pathway) are used as input features to construct TabPFN classification models across continental and sub-population dimensions. Five-fold cross-validation is used to compare the predictive performance of IBD feature values, PC, and their fused features, and the likelihood ratio (LR) method is introduced as an evaluation metric to assess the optimal input feature model. Finally, the model's performance is further validated on an independent test set of 603 samples.

[0076] The results of the IBD sharing pattern study in this invention show that the model that integrates IBD features and PC performs best, with first-order accuracy and LR consistency rate both reaching over 99% across continents. The prediction results of this model at the sub-population level show that the first-order accuracy and LR consistency rate are 91.47% and 74.08%, respectively, which are improvements of 3.80% and 11.23% compared to using PC alone.

[0077] In a specific embodiment, the present invention uses two types of test sets to validate and evaluate the model of the present invention. The test sets include: (1) Type I, 107 samples with the same ancestral origin as the reference population and highly similar population types (such as ethnicity, region, etc.) (homologous group), used to evaluate the classification prediction accuracy of the model on homologous samples; (2) Type II, 496 test samples with the same ancestral origin as the reference population (generalization group), used to verify the generalization ability of the model. Specifically, in the Type I test set, the first-order accuracy and LR consistency rate for the intercontinental population were 100% and 98.13%, respectively, and the first-order accuracy and LR consistency rate for the sub-population were 84.11% and 74.77%, respectively; in the Type II test set, 86.69% of the test samples could be correctly predicted to the continent, and 56.25% of the test samples could be predicted to the same region as the reference population. In summary, the method of this invention effectively improves the prediction accuracy of subpopulations after fusing IBD features, has robust predictive ability and good universality, and can be applied to fine-scale population ancestry inference.

[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A biogeographical ancestry inference method integrating IBD fragment features, characterized in that, include: S1. Perform quality control processing on the whole genome SNP data of the reference population to obtain the reference population SNP dataset; S2. Perform IBD fragment detection and principal component analysis on the SNP dataset of the reference population to obtain the IBD feature matrix and PC feature matrix; S3. The IBD feature matrix and the PC feature matrix are fused together as joint input features. The TabPFN algorithm is used to train a classification model on the joint input features to obtain an ancestor inference classification model. S4. Input the SNP data of the sample to be tested into the ancestry inference classification model to obtain the biogeographical ancestry inference results of the sample to be tested.

2. The biogeographical ancestry inference method based on the fusion of IBD fragment features according to claim 1, characterized in that, Step S1 further includes: S11. Extract autosomal SNP loci from the whole genome SNP dataset of the reference population and the target dataset to obtain a candidate SNP set; S12. The candidate SNP set is filtered sequentially according to the site detection rate threshold, the minor allele frequency threshold, and the Hardy-Weinberg balance test threshold to obtain the filtered SNP set. S13. Using a sliding window strategy, perform chain imbalance pruning on the filtered SNP set to obtain the reference population SNP dataset.

3. The biogeographical ancestry inference method integrating IBD fragment features according to claim 1, characterized in that, Step S2, the step of performing IBD fragment detection on the reference population SNP dataset, further includes: S211. IBD fragment identification is performed on each pair of individuals in the reference population SNP dataset using the IBIS algorithm, and the data is filtered according to the IBD fragment length threshold and the error rate threshold to obtain the IBD fragment length data between individuals. S212. Based on the IBD fragment length data between individuals, the average IBD fragment length of the reference sample and each individual in the subpopulation is calculated to obtain the IBD feature value of the reference sample corresponding to the subpopulation. S213. Arrange the IBD feature values ​​of the reference sample and all subgroups to obtain the IBD feature matrix.

4. The biogeographical ancestry inference method integrating IBD fragment features according to claim 1, characterized in that, Step S2, the step of performing principal component analysis on the reference population SNP dataset, further includes: S221. Calculate the genetic relationship matrix of the reference population SNP dataset using GCTA software; S222. Perform feature decomposition on the genetic relationship matrix, extract the principal components of the number of preceding principal components, and obtain the PC feature matrix.

5. The biogeographical ancestry inference method integrating IBD fragment features according to claim 1, characterized in that, Step S3 further includes: S31. Divide the reference population SNP dataset into a training set and a validation set according to the five-fold cross-validation strategy; S32. Based on the training set and validation set, the input is constructed in three ways: a single PC feature matrix, a single IBD feature matrix, and a joint input feature matrix formed by the PC feature matrix and the IBD feature matrix. The input is used to train the classification model using the TabPFN algorithm to obtain three sets of candidate inference classification models. S33. For the three candidate inference classification models, calculate the first prediction accuracy, LR consistency rate, LR accuracy and LR error rate at the intercontinental level and subpopulation level respectively, and obtain the multidimensional evaluation results of each candidate inference classification model. S34. Based on the multidimensional evaluation results, the first prediction accuracy and LR consistency rate at the sub-population level are used as the main evaluation indicators to compare the three candidate inference classification models, and the candidate inference classification model corresponding to the joint input features is determined as the optimal input scheme. S35. Based on the optimal input scheme, the number of principal components in the joint input features is continuously optimized to obtain the optimal number of principal components. The joint input features containing the optimal number of principal components are then re-input into the TabPFN algorithm for training to obtain the ancestor inference classification model.

6. The biogeographical ancestry inference method based on the fusion of IBD fragment features according to claim 1, characterized in that, In step S4, before inputting the SNP data of the sample to be tested into the ancestry inference classification model, the following steps are also included: The sum of IBD feature values ​​of the test sample is calculated. When the sum of IBD feature values ​​is lower than a preset threshold, only the PC feature matrix of the test sample is used as the input feature. When the sum of IBD feature values ​​is greater than or equal to the preset threshold, the joint input feature is used as the input feature.

7. The biogeographical ancestry inference method based on the fusion of IBD fragment features according to claim 1, characterized in that, In step S4, the biogeographical ancestry inference results include: intercontinental level inference results and subpopulation level inference results.

8. A biogeographical ancestry inference system integrating IBD fragment features, characterized in that, include: Quality control module: Used to perform quality control processing on whole-genome SNP data to obtain a reference population SNP dataset; Analysis module: used to perform IBD fragment detection and principal component analysis on the reference population SNP dataset to obtain the IBD feature matrix and PC feature matrix; Training module: used to fuse the IBD feature matrix and the PC feature matrix as joint input features, and to train a classification model on the joint input features using the TabPFN algorithm to obtain an ancestry inference classification model; The output module is configured as the ancestry inference classification model obtained by the training module, which is used to receive the SNP data of the test sample and infer the biogeographical ancestry inference result of the test sample.

9. A biogeographical ancestry inference device integrating IBD fragment features, characterized in that, include: A memory and at least one processor, wherein the memory stores instructions; At least one of the processors invokes the instructions in the memory to cause a biogeographical ancestry inference device incorporating IBD fragment features to perform a biogeographical ancestry inference method incorporating IBD fragment features as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed by a processor, implement a biogeographical ancestry inference method that integrates IBD fragment features as described in any one of claims 1 to 7.