Resistance gene analysis method based on metagenome
By combining adaptive data preprocessing and dynamic knowledge graphs with graph neural networks, a three-dimensional relational network model is constructed, which solves the systematic and efficiency problems of resistance gene analysis in existing technologies and realizes efficient analysis of resistance gene propagation mechanisms and risk assessment.
Patent Information
- Application Number
- CN202510781427.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-10-31
AI Technical Summary
Existing technologies for analyzing antibiotic resistance genes in the environment neglect the characteristics of transmission dynamics, isolate each analytical step, lack systematic integration, make it difficult for static databases to adapt to rapidly evolving resistance genes, and fail to reveal complex nonlinear relationships using conventional statistical methods.
An adaptive quality filtering algorithm was used for data preprocessing. Combined with dynamic knowledge graphs and graph neural networks, a three-dimensional association network model of resistance genes-species-mobile elements was constructed. Transfer learning was applied to establish a propagation risk assessment model, and deep learning was used for functional prediction and risk assessment.
It has achieved in-depth analysis of the mechanism of resistance gene propagation, improved analysis efficiency by 15 times, and increased the identification rate of newly discovered resistance genes by 40%.
Smart Images

Figure CN120877848A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of bioinformatics technology, specifically to a method for analyzing resistance genes based on metagenomics. Background Technology
[0002] With the increasing severity of antibiotic overuse, the spread of antibiotic resistance genes in the environment has become a global health threat. Meanwhile, antibiotic resistance genes, as a new type of environmental pollutant, exist in various environments such as soil, water, and the human body, and can be transferred from the host to other organisms through horizontal gene transfer, spreading in the environment and causing even more serious pollution problems. Therefore, studying the distribution of antibiotic resistance genes in the environment has become a research hotspot for many scholars.
[0003] Metagenomics, as an omics technology, can cover microorganisms throughout the entire environment, making it a suitable technique for studying antibiotic resistance genes in the environment.
[0004] However, existing technologies have the following limitations:
[0005] Traditional analytical methods focus only on the presence or absence of genes, ignoring the characteristics of propagation dynamics;
[0006] The various analytical steps are isolated from each other and lack systematic integration;
[0007] Static databases struggle to adapt to rapidly evolving resistance genes;
[0008] Conventional statistical methods cannot reveal complex nonlinear relationships. Summary of the Invention
[0009] (a) Technical problems to be solved
[0010] To address the aforementioned technical problems, this invention provides a metagenomic-based method for analyzing resistance genes.
[0011] (II) Technical Solution
[0012] Based on this, the present invention provides the following technical solution: a metagenomic-based method for analyzing resistance genes, comprising the following steps:
[0013] Step S1: Data preprocessing stage: Obtain the raw sequencing data of multiple metagenomic samples, use an adaptive quality filtering algorithm to perform quality control processing on the raw sequencing data, dynamically adjust the quality threshold and length threshold, use a hybrid assembly strategy to integrate second-generation and third-generation sequencing data, construct high-quality contigs, and obtain optimized data for each metagenomic sample;
[0014] Step S2: Multi-dimensional feature extraction stage: The sequence data is simultaneously aligned to the integrated composite reference database through a parallel alignment engine. A deep learning model is used to predict the function of unannotated sequences. Sequence adapters or sequence tails with quality values lower than a preset quality threshold are removed from the original sequencing data. Sequences with lengths less than a preset length threshold are also removed from the original sequencing data to obtain optimized data for each metagenomic sample.
[0015] Step S3: Intelligent analysis stage, construct a three-dimensional association network model of resistance gene-species-mobile element, apply graph neural network to mine potential horizontal gene transfer paths, and establish a risk assessment model for resistance gene propagation based on transfer learning.
[0016] Preferably, the adaptive quality filtering algorithm includes: a sliding window-based dynamic quality trimming module, a sequencing platform-adaptive error rate correction module, and a sample-specific threshold optimization module. The sliding window-based dynamic quality trimming module performs dynamic quality trimming, adapter contamination filtering, and repetitive sequence marking on the raw sequencing data. The sequencing platform-adaptive error rate correction module performs platform-specific correction on the processed data. After data correction, the sample-specific threshold optimization module performs sample filtering to generate clean data.
[0017] Preferably, the specific formulas for dynamically adjusting the quality threshold and length threshold are as follows:
[0018] Q_threshold=Q_base+α·log10(read_length)+β·(GC_deviation);
[0019] Where Q_base: Illumina=28, Nanopore=9;
[0020] α = 1.5 (length compensation coefficient);
[0021] β = 2.0 (GC deviation coefficient).
[0022] The preferred method for integrating second- and third-generation sequencing data using a hybrid assembly strategy is as follows:
[0023] Step S11: Construction of the three-generation data skeleton;
[0024] Step S12: Second-generation data correction;
[0025] Step S13: Consistency optimization.
[0026] Preferably, the composite reference database includes: a resistance gene knowledge base, a species classification database, a mobile element feature database, and a functional database. The optimized data of each metagenomic sample are compared with the resistance gene knowledge base, the species classification database, the mobile element feature database, and the functional database to obtain the corresponding resistance gene annotation information, species classification annotation information, mobile element annotation information, and functional annotation information, thereby constructing a dynamic knowledge graph.
[0027] Preferably, the construction of the three-dimensional relational network model includes:
[0028] Node feature encoding: Optimized data features for each metagenomic sample are encoded using a graph attention network;
[0029] Edge weight calculation: The association strength is calculated based on co-occurrence frequency and evolutionary distance;
[0030] Dynamic update mechanism: Integrating newly discovered knowledge relationships in real time.
[0031] Preferably, the edge weight calculation formula is as follows:
[0032] W_ij=α·log(co-occur)+β·(1 / d_phylogeny)+γ·P(transfer);
[0033] Where: α = 0.4, β = 0.3, γ = 0.3 (optimized through grid search);
[0034] co-occur: co-occurrence frequency (normalized);
[0035] d_phylogeny: Evolutionary distance of species (16S rRNA);
[0036] P(transfer): Transition probability (HGTector prediction value).
[0037] Preferably, the steps for establishing the resistance gene transmission risk assessment model through transfer learning are as follows:
[0038] Step S31: Perform dual-channel input processing on the optimized data, namely gene feature channel processing and environmental factor channel processing;
[0039] Step S32: Perform feature extraction and neighborhood identification on the dual-channel input data;
[0040] Step S33: By predicting the risk level through the risk prediction head, a comprehensive analysis and risk prediction of the antagonistic gene propagation mechanism was achieved.
[0041] (III) Beneficial Effects
[0042] Compared with existing technologies, this invention provides a metagenomics-based method for analyzing resistance genes, which has the following advantages:
[0043] This metagenomics-based resistance gene analysis method innovatively combines adaptive data preprocessing, dynamic knowledge graph construction, and graph neural networks to achieve in-depth analysis of the resistance gene propagation mechanism. Through the combined application of a three-dimensional association network model and a dynamic knowledge graph, the analysis efficiency is improved: the processing speed is 15 times faster than traditional methods, and the prediction accuracy is improved: the recognition rate of newly discovered resistance genes is increased by 40%. Attached Figure Description
[0044] Figure 1 This is a schematic diagram of the adaptive quality filtering algorithm workflow of the present invention;
[0045] Figure 2 This is a schematic diagram illustrating the classification of the composite reference database of the present invention;
[0046] Figure 3 This is a schematic diagram of the risk assessment model framework of the present invention. Detailed Implementation
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] Please see Figures 1-3 A metagenomic-based method for analyzing resistance genes includes the following steps:
[0049] Data preprocessing stage: Obtain raw sequencing data from multiple metagenomic samples and perform quality control processing on the raw sequencing data using an adaptive quality filtering algorithm. Specifically, firstly, use a second- or third-generation sequencing platform to obtain the raw sequencing data for each metagenomic sample. This can be any second- or third-generation sequencing platform that meets the FastQ data format. This embodiment does not limit this, such as Illumina, Nanopore, Ion Torrent, PacBio, etc. Then, use quality control software to perform sequence quality control on the raw sequencing data of each sample to obtain optimized data (clean reads) for each sample. The choice of quality control software depends on the type of sequencing platform and can be any software that supports quality control of second- or third-generation raw data. Specifically, for second-generation platforms, Fastp, FastQC, etc. can be selected, and for third-generation platforms, Nanoplot, etc. can be selected.
[0050] The adaptive quality filtering algorithm includes: a sliding window-based dynamic quality trimming module, a sequencing platform-adaptive error rate correction module, and a sample-specific threshold optimization module. The sliding window-based dynamic quality trimming module performs dynamic quality trimming, adapter contamination filtering, and repetitive sequence marking on the raw sequencing data. The sequencing platform-adaptive error rate correction module performs platform-specific correction on the processed data. After data correction, the sample-specific threshold optimization module performs sample filtering to generate clean data, dynamically adjusting the quality threshold and length threshold, increasing data utilization by 35%. A hybrid assembly strategy is used to integrate second-generation and third-generation sequencing data, constructing a third-generation data backbone and performing segmented weighted filtering. For second-generation data correction, platform adaptive selection is used: consistency optimization, N50 length increased by 300%, strict values are taken during data fusion, and high-quality contigs are constructed to obtain optimized data for each metagenomic sample, reducing processing time by 40%.
[0051] In some embodiments, the specific formulas for dynamically adjusting the quality threshold and length threshold are as follows:
[0052] Q_threshold=Q_base+α·log10(read_length)+β·(GC_deviation);
[0053] Where Q_base: Illumina=28, Nanopore=9;
[0054] α = 1.5 (length compensation coefficient);
[0055] β = 2.0 (GC deviation coefficient);
[0056] Input data: Illumina NovaSeq: 150bp PE, 300X; Nanopore PromethION: 50X, N50 = 25kb;
[0057] Processing results: Filtration retention rate: 89%;
[0058] Assembly continuity (N50): 8.7 Mb;
[0059] Variance detection accuracy: 99.7%.
[0060] Multi-dimensional feature extraction stage: The parallel alignment engine simultaneously aligns the sequence data to an integrated composite reference database, which includes: a resistance gene knowledge base, a species classification database, a mobile element feature database, and a functional database. The optimized data of each metagenomic sample are compared with the resistance gene knowledge base, species classification database, mobile element feature database, and functional database to obtain the corresponding resistance gene annotation information, species classification annotation information, mobile element annotation information, and functional annotation information. A deep learning model is used to predict the function of unannotated sequences. This model needs to be able to process DNA sequences and predict their possible functions, such as resistance genes, metabolic functions, etc. Considering the characteristics of sequence data, convolutional neural networks (CNNs) are used to capture local patterns, and recurrent neural networks (RNNs) or attention mechanisms are combined to capture long-range dependencies. Sequence adapters or sequence tails with quality values below a preset quality threshold are removed from the raw sequencing data, as are sequences shorter than a preset length threshold. This yields optimized data for each metagenomic sample. The preset quality threshold is set according to different sequencing platforms; for example, a quality threshold of 20 can be set for second-generation platforms, and 7 for third-generation platforms. The preset length threshold is also set according to different sequencing platforms; for example, a length threshold of 50 can be set for second-generation platforms, and 2000 bp for third-generation platforms. The optimized data is compared with CARD (resistance genes), NR (species), ISfinder (mobile elements), and BacMet (functional) databases to generate annotation information.
[0061] In some embodiments, the construction of the three-dimensional interconnected network model includes:
[0062] Node feature encoding: Optimized data features for each metagenomic sample are encoded using a graph attention network;
[0063] Edge weight calculation: The association strength is calculated based on co-occurrence frequency and evolutionary distance;
[0064] Dynamic update mechanism: Real-time integration of newly discovered knowledge relationships;
[0065] The formula for calculating edge weights is as follows:
[0066] W_ij=α·log(co-occur)+β·(1 / d_phylogeny)+γ·P(transfer);
[0067] Where: α = 0.4, β = 0.3, γ = 0.3 (optimized through grid search);
[0068] co-occur: co-occurrence frequency (normalized);
[0069] d_phylogeny: Evolutionary distance of species (16S rRNA);
[0070] P(transfer): Transfer probability (HGTector predictor value), enabling comprehensive analysis of antagonistic genes, including their distribution, transmission mechanisms, and correlation with environment and function.
[0071] In the intelligent analysis phase, a three-dimensional correlation network model of resistance gene-species-mobile element is constructed, graph neural networks are applied to mine potential horizontal gene transfer pathways, and a risk assessment model for resistance gene propagation is established based on transfer learning.
[0072] The steps for establishing a risk assessment model for the spread of resistance genes using transfer learning are as follows:
[0073] The optimized data is processed through a dual-channel input process, namely gene feature channel processing and environmental factor channel processing.
[0074] Feature extraction and domain identification are performed on data processed by dual-channel input.
[0075] In this application, the gene signature channel is: class GeneEncoder(nn.Module);
[0076] def__init__(self);
[0077] self.conv = nn.Sequential(
[0078] nn.Conv1d(4,64,kernel_size=9), #4 channel base encoding
[0079] nn.ReLU(),
[0080] nn.MaxPool1d(3))
[0081] self.lstm=nn.LSTM(64,128,bidirectional=True);
[0082] Environmental factor pathways:
[0083] class EnvEncoder(nn.Module);
[0084] def__init__(self);
[0085] self.fc = nn.Sequential(
[0086] nn.Linear(10,64), #10-dimensional environment parameters
[0087] nn.LeakyReLU();
[0088] nn.LayerNorm(64))
[0089] By predicting risk levels using risk prediction heads, a comprehensive analysis and risk prediction of the mechanism of antagonistic gene transmission has been achieved.
[0090] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A metagenomic-based method for analyzing resistance genes, characterized by: Includes the following steps: Step S1: Data preprocessing stage: Obtain the raw sequencing data of multiple metagenomic samples, use an adaptive quality filtering algorithm to perform quality control processing on the raw sequencing data, dynamically adjust the quality threshold and length threshold, use a hybrid assembly strategy to integrate second-generation and third-generation sequencing data, construct high-quality contigs, and obtain optimized data for each metagenomic sample; Step S2: Multi-dimensional feature extraction stage: The sequence data is simultaneously aligned to the integrated composite reference database through a parallel alignment engine. A deep learning model is used to predict the function of unannotated sequences. Sequence adapters or sequence tails with quality values lower than a preset quality threshold are removed from the original sequencing data. Sequences with lengths less than a preset length threshold are also removed from the original sequencing data to obtain optimized data for each metagenomic sample. Step S3: Intelligent analysis stage, construct a three-dimensional association network model of resistance gene-species-mobile element, apply graph neural network to mine potential horizontal gene transfer paths, and establish a risk assessment model for resistance gene propagation based on transfer learning.
2. The metagenomic-based resistance gene analysis method according to claim 1, characterized in that: As described above, the adaptive quality filtering algorithm in step S1 includes: a sliding window-based dynamic quality trimming module, a sequencing platform-adaptive error rate correction module, and a sample-specific threshold optimization module. The sliding window-based dynamic quality trimming module performs dynamic quality trimming, adapter contamination filtering, and repetitive sequence labeling on the original sequencing data. The sequencing platform-adaptive error rate correction module performs platform-specific correction on the processed data. After data correction, the sample-specific threshold optimization module performs sample filtering to generate clean data.
3. The metagenomic-based resistance gene analysis method according to claim 1, characterized in that: The specific formulas for dynamically adjusting the quality threshold and length threshold in step S1 as described above are as follows: Q_threshold=Q_base+α·log10(read_length)+β·(GC_deviation); Where Q_base: Illumina=28, Nanopore=9; α = 1.5 (length compensation coefficient); β = 2.0 (GC deviation coefficient).
4. The metagenomic-based resistance gene analysis method according to claim 1, characterized in that: The specific steps for integrating second- and third-generation sequencing data using the hybrid assembly strategy in step S1, as described above, are as follows: Step S11: Construction of the three-generation data skeleton; Step S12: Second-generation data correction; Step S13: Consistency optimization.
5. The metagenomic-based resistance gene analysis method according to claim 1, characterized in that: As described above, the composite reference database in step S2 includes: a resistance gene knowledge base, a species classification database, a mobile element feature database, and a functional database. The optimized data of each metagenomic sample are compared with the resistance gene knowledge base, the species classification database, the mobile element feature database, and the functional database to obtain the corresponding resistance gene annotation information, species classification annotation information, mobile element annotation information, and functional annotation information.
6. The metagenomic-based resistance gene analysis method according to claim 1, characterized in that: Construction of the three-dimensional relational network model include: Node feature encoding: Optimized data features for each metagenomic sample are encoded using a graph attention network; Edge weight calculation: The association strength is calculated based on co-occurrence frequency and evolutionary distance; Dynamic update mechanism: Integrating newly discovered knowledge relationships in real time.
7. The metagenomic-based resistance gene analysis method according to claim 6, characterized in that: The formula for calculating the edge weight is as follows: W_ij=α·log(co-occur)+β·(1 / d_phylogeny)+γ·P(transfer); Where: α = 0.4, β = 0.3, γ = 0.3 (optimized through grid search); co-occur: co-occurrence frequency (normalized); d_phylogeny: Evolutionary distance of species (16S rRNA); P(transfer): Transition probability (HGTector prediction value).
8. The metagenomic-based resistance gene analysis method according to claim 1, characterized in that: The steps for establishing a risk assessment model for the spread of resistance genes using transfer learning are as follows: Step S31: Perform dual-channel input processing on the optimized data, namely gene feature channel processing and environmental factor channel processing; Step S32: Perform feature extraction and neighborhood identification on the dual-channel input data; Step S33: Predict the risk level using the risk prediction head.
Citation Information
Cited By
Medicinal plant genome assembly method and system based on high-throughput sequencing
CN121565257A
