A DNA sequencing read clustering method and system based on representation learning

By using a deep learning model based on representation learning to preprocess and cluster DNA sequencing reads, the problem of clustering difficulties caused by sequencing errors in DNA storage is solved, achieving high-precision clustering results and improving the reliability and retrieval efficiency of DNA storage data.

CN121122431BActive Publication Date: 2026-04-17GUANGZHOU UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-29
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing DNA storage technologies, clustering difficulties arise due to sequencing errors, especially in high-throughput sequencing where traditional tools have high time complexity, machine learning methods lose spatial location information, and graph embedding methods are sensitive to sequencing depth fluctuations, resulting in low clustering accuracy.

Method used

A representation learning-based approach is adopted to preprocess DNA sequencing reads, perform representation learning through a deep learning model, and achieve clustering by fine-tuning the model. A 6-layer Transformer module and a linear network are used for encoding, and the softmax activation function is combined for clustering.

Benefits of technology

Achieving 99% clustering accuracy on the high-error-rate Nanopore sequencing platform significantly improves clustering efficiency and enhances the reliability and retrieval efficiency of DNA storage data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121122431B_ABST
    Figure CN121122431B_ABST
Patent Text Reader

Abstract

This invention belongs to the interdisciplinary field of DNA digital storage and bioinformatics, and discloses a method and system for DNA sequencing read clustering based on representation learning. The method includes: preprocessing the original DNA sequencing reads to obtain the sequencing reads themselves and corresponding variant 1 and variant 2 sets; performing representation learning on the DNA sequencing reads using a deep learning model based on the sequencing reads themselves and the corresponding variant 1 and variant 2 sets; and achieving DNA sequencing read clustering by fine-tuning the model based on the representation-learned DNA sequencing reads. This invention solves the problem of difficult clustering caused by sequencing errors in DNA storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the interdisciplinary field of DNA digital storage and bioinformatics, specifically relating to a DNA sequencing read clustering method and system based on representation learning. Background Technology

[0002] DNA storage, with its advantages of ultra-high storage density, ultra-long storage time, and low energy consumption, has become a potential solution for coping with the explosive growth of global data. However, errors such as insertions, deletions, and substitutions (IDS) occur during DNA synthesis and sequencing, and these errors are spatially heterogeneous and platform-specific, seriously affecting the reliable retrieval of data. Therefore, clustering of sequencing reads is necessary to better achieve reliable data retrieval from DNA storage.

[0003] Traditional tools such as BLAST and CD-HIT rely on full sequence alignment, resulting in a time complexity of O(N) when processing millions of read segments. 2 These methods struggle to meet the demands of high-throughput sequencing (e.g., PacBio HiFi data can generate >50Gb of data in a single run). Machine learning-driven methods using k-mer frequency features (e.g., the KMC3 tool) lose spatial location information, resulting in a 37% drop in accuracy in dense indel regions (e.g., microsatellite sequences). Graph embedding methods (e.g., GraKeL) are sensitive to variations in sequencing depth, with cluster purity decreasing by 42% when coverage differences exceed 5-fold. Summary of the Invention

[0004] To address the difficulty of clustering DNA storage due to sequencing errors in existing technologies, this invention provides a DNA sequencing read clustering method and system based on representation learning. This method can effectively cluster sequencing reads containing heterogeneous errors such as insertions, deletions, and substitutions. On the high-error-rate Nanopore sequencing platform, the clustering accuracy can reach 99%, significantly improving the efficiency of traditional clustering algorithms and promoting the reliability and efficiency of DNA storage data retrieval.

[0005] To achieve the above objectives, the present invention provides the following solution:

[0006] A DNA sequencing read clustering method based on representation learning, the method comprising:

[0007] Preprocess the raw DNA sequencing reads to obtain the sequencing reads themselves and the corresponding variant 1 and variant 2 sets;

[0008] Based on the sequencing reads themselves and the corresponding variant 1 and variant 2 sets, a deep learning model is used to learn the representation of DNA sequencing reads.

[0009] Based on the DNA sequencing reads learned through representation learning, DNA sequencing read clustering is achieved by fine-tuning the model.

[0010] Preferably, the method for preprocessing the raw DNA sequencing reads to obtain the sequencing reads themselves and the corresponding variant 1 and variant 2 sets includes:

[0011] Each raw DNA sequencing read is masked twice, so that each DNA sequencing read has three copies: the sequencing read itself, variant 1, and variant 2.

[0012] One-hot encoding was performed on the sequencing read itself, variant 1, and variant 2.

[0013] After one-hot encoding, all sequencing reads and their corresponding variants 1 and 2 are converted into matrix form. The set of one-hot encoded sequencing reads is denoted as x, the set of corresponding variants 1 is denoted as x1, and the set of variants 2 is denoted as x2.

[0014] Preferred methods for performing two masking operations on each raw DNA sequencing read include:

[0015] The bases corresponding to the primers at both ends of the DNA sequencing read are converted to the character N, while the middle data part remains unchanged, and each sequencing read generates variant 1;

[0016] The bases corresponding to the middle data portion of the DNA sequencing read are converted into the character N, while the primers at both ends remain unchanged, resulting in variant 2 for each sequencing read.

[0017] Preferably, the method for one-hot encoding the sequencing read itself, variant 1, and variant 2 includes:

[0018] The character N is encoded into a column vector [0, 0, 0, 0]. T The base A is encoded into a column vector [1, 0, 0, 0]. T The base T is encoded into a column vector [0, 1, 0, 0]. T The base C is encoded into a column vector [0, 0, 1, 0]. T The base G is encoded into a column vector [0, 0, 0, 1]. T .

[0019] Preferably, the deep learning model encoder uses a 6-layer Transformer module, and the decoder is a linear network. The output dimension of the linear network is the same as the dimension of the sequencing read matrix.

[0020] Methods for characterizing DNA sequencing reads using deep learning models, based on the sequencing reads themselves and the corresponding variant 1 and variant 2 sets, include:

[0021] The elements in the set x, x1 and x2 are input into the encoder. The transformer module in the encoder will automatically learn a 32-dimensional vector r for each input element. r is the low-dimensional representation of the input element of the encoder.

[0022] The low-dimensional representation is input into a linear network, and the linear network outputs a DNA sequence.

[0023] Preferably, the fine-tuning model consists of an encoder and a softmax activation function. First, the linear network of the deep learning model is removed, and its encoder is retained. Then, a softmax activation function is connected after the encoder. The output dimension of the softmax activation function is equal to the number of categories of the sequencing read.

[0024] Preferably, methods for clustering DNA sequencing reads based on representation learning and by fine-tuning the model include:

[0025] The elements in the set x, x1 and x2 are input into the encoder of the fine-tuning model. The encoder learns a 32-dimensional vector r1 and inputs it into the softmax function. The output of the function is set to a vector with dimension n, where n is the number of sequencing read categories.

[0026] For elements in the input encoder that belong to set x, they are classified into the category corresponding to the maximum value in the softmax output vector, resulting in cluster 1; for elements belonging to set x1, the mask characters N at both ends are first converted into the bases corresponding to the original primers, and then classified into the category corresponding to the maximum value in the softmax output vector, resulting in cluster 2; for elements belonging to set x2, the middle mask character N is first converted into the bases corresponding to the original data part, and then classified into the category corresponding to the maximum value in the softmax output vector, resulting in cluster 3.

[0027] For each cluster in cluster 1, cluster 2, and cluster 3, a majority vote is performed within the cluster. Each cluster obtains a cluster center through the majority vote, and the base at each position of the cluster center is the base that received the most votes at that position.

[0028] The present invention also provides a DNA sequencing read clustering system based on representation learning, the system being used to implement the aforementioned method, the system comprising: a data preprocessing module, a model pretraining module, and a model clustering fine-tuning module;

[0029] The data preprocessing module is used to preprocess the raw DNA sequencing reads to obtain the sequencing reads themselves and the corresponding variant 1 and variant 2 sets;

[0030] The model pre-training module is used to learn the representation of DNA sequencing reads based on the sequencing reads themselves and the corresponding variant 1 and variant 2 sets through a deep learning model.

[0031] The model clustering fine-tuning module is used to achieve DNA sequencing read clustering based on the DNA sequencing reads after representation learning by fine-tuning the model.

[0032] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0033] This invention discloses a DNA sequencing read clustering method based on representation learning. The method first performs representation learning on DNA sequencing reads using a deep learning model, and then fine-tunes the model's encoder to achieve clustering. The deep learning model's encoder uses a 6-layer Transformer module, and the decoder is a linear network. During fine-tuning, only the decoder is removed, and a softmax function is added after the encoder to perform the clustering task. This invention can effectively cluster sequencing reads containing heterogeneous errors such as insertions, deletions, and substitutions. On the high-error-rate Nanopore sequencing platform, the clustering accuracy can reach 99%, significantly improving the efficiency of traditional clustering algorithms and promoting the reliability and efficiency of DNA storage data retrieval. Attached Figure Description

[0034] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 This is a schematic diagram of a DNA sequencing read clustering method based on representation learning, according to an embodiment of the present invention. Detailed Implementation

[0036] 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.

[0037] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0038] Example 1

[0039] like Figure 1 As shown, this invention provides a DNA sequencing read clustering method based on representation learning, the method comprising:

[0040] Preprocess the raw DNA sequencing reads to obtain the sequencing reads themselves and the corresponding variant 1 and variant 2 sets;

[0041] Based on the sequencing reads themselves and the corresponding variant 1 and variant 2 sets, a deep learning model is used to learn the representation of DNA sequencing reads.

[0042] Based on the DNA sequencing reads learned through representation learning, DNA sequencing read clustering is achieved by fine-tuning the model.

[0043] In this embodiment, the method for preprocessing the raw DNA sequencing reads to obtain the sequencing reads themselves and the corresponding variant 1 and variant 2 sets includes:

[0044] Each raw sequencing read is masked twice, resulting in two variants for each read. The specific steps of the masking operation are as follows.

[0045] 1. The bases corresponding to the primers at both ends of the sequencing read are converted to the character N, while the middle data part remains unchanged, thus generating variant 1 for each sequencing read;

[0046] 2. The bases corresponding to the middle data part of the sequencing read are converted into the character N, while the primers at both ends remain unchanged. Thus, each sequencing read generates variant 2.

[0047] After two masking operations, each sequencing read has three copies: the sequencing read itself, variant 1, and variant 2. These sequencing reads, along with variants 1 and 2, are then one-hot encoded according to the following rules:

[0048] The character N is encoded into a column vector [0, 0, 0, 0]. T The base A is encoded into a column vector [1, 0, 0, 0]. T The base T is encoded into a column vector [0, 1, 0, 0]. T The base C is encoded into a column vector [0, 0, 1, 0]. T The base G is encoded into a column vector [0, 0, 0, 1]. T .

[0049] After one-hot encoding, all sequencing reads and their corresponding variants 1 and 2 are converted into matrix form. The set of one-hot encoded sequencing reads is denoted as x, the set of corresponding variants 1 is denoted as x1, and the set of variants 2 is denoted as x2.

[0050] In this embodiment, the pre-trained model, i.e., the deep learning model, includes an encoder composed of six stacked transformer modules and a linear network. The output dimension of the linear network is the same as the dimension of the sequencing read matrix. The specific pre-training process is as follows:

[0051] 1. Input the elements in the set x, x1 and x2 into the encoder of the pre-trained model. The transformer module in the encoder will automatically learn a 32-dimensional vector r for each input element. r is the low-dimensional representation of the input element of the encoder, which can be represented by the following equation (1):

[0052] r = W · x (1);

[0053] Where x is an element of the input encoder.

[0054] 2. Input the low-dimensional representation into the linear network. The output y of the linear network has dimensions that can be expressed by equation (2):

[0055] y = W·r (2);

[0056] Where W represents the parameters of the linear network, and the dimension of y is the same as the input dimension of the encoder.

[0057] The loss function of the pre-trained model is the cross-entropy loss function, as shown in equation (3):

[0058]

[0059] Where Y i,c It is a true label encoded in one-hot encoding, y i,c is the predicted probability, N is the batch size, and C is the sequencing read length.

[0060] In this embodiment, the fine-tuning model consists of an encoder and a softmax activation function. First, the linear network of the pre-trained model is removed, retaining only the encoder. Then, a softmax activation function is appended after the encoder. The output dimension of the softmax activation function is equal to the number of categories in the sequencing reads. The specific steps are as follows:

[0061] 1. Input the elements of sets X, X1, and X2 into the encoder of the fine-tuning model. The encoder learns a 32-dimensional vector r1 = W·x, where W is the encoder parameter and x is the element input to the encoder. Then input r1 into the softmax function, and set the output of the function to a vector y1 = softmax(r1) with dimension n, where n is the number of sequencing read categories;

[0062] 2. For elements in the input encoder that belong to set X, classify them into the category corresponding to the maximum value in the softmax output vector, resulting in cluster 1, i.e., C1; for elements belonging to set X1, first convert the mask characters N at both ends into the bases corresponding to the original primers, and then classify them into the category corresponding to the maximum value in the softmax output vector, resulting in cluster 2, i.e., C2; for elements belonging to set X2, first convert the middle mask character N into the bases corresponding to the original data part, and then classify them into the category corresponding to the maximum value in the softmax output vector, resulting in cluster 2, i.e., C3.

[0063] 3. Perform majority voting within each cluster in cluster 1, cluster 2, and cluster 3. Each cluster obtains a cluster center through majority voting, and the base at each position of the cluster center is the base with the highest number of votes at that position.

[0064] Because DNA storage primer design requires an edit clustering of at least 3 between primers of different sequences to prevent non-specific amplification, the next step is to cluster all cluster centers according to their edit distance. The specific steps are as follows:

[0065] 1. Initialization: Each cluster center is an independent cluster;

[0066] 2. Loop until termination:

[0067] a. Calculate the full connectivity distance between all clusters. For any two clusters Cp and Cq, the full connectivity distance is calculated as shown in equation D. complete (Cp,Cq)=max xi∈Cp,xj∈Cq d(x i x j ), d(x i x j ) represents x i x j Edit distance, x i x j Elements for input editors;

[0068] b. Find the cluster pair (A, B) with the minimum distance;

[0069] c. If D complete If (A, B) < 3, then merge them;

[0070] d. Otherwise, merging the pair is prohibited;

[0071] 3. Output the set of clusters that satisfy the constraints;

[0072] 4. Finally, each cluster center within the same cluster corresponds to one of clusters 1, 2, or 3. The clusters corresponding to the cluster centers are merged, and duplicate segments are removed to obtain the final clustering result.

[0073] Testing showed that this invention achieved a clustering accuracy of 99.3% on the Srinivasavaradhan dataset (Nanopore platform, error rate 5.90%) and 99.99% on Illumina platform datasets, outperforming existing technologies. The average processing time per cluster was 3.28 microseconds, improving the efficiency and practicality of DNA storage data retrieval.

[0074] Example 2

[0075] The present invention also provides a DNA sequencing read clustering system based on representation learning. The system is used to implement the method described in Embodiment 1. The system includes: a data preprocessing module, a model pretraining module, and a model clustering fine-tuning module.

[0076] The data preprocessing module is used to preprocess the raw DNA sequencing reads to obtain the sequencing reads themselves and the corresponding variant 1 and variant 2 sets;

[0077] The model pre-training module is used to learn the representation of DNA sequencing reads based on the sequencing reads themselves and the corresponding variant 1 and variant 2 sets through a deep learning model.

[0078] The model clustering fine-tuning module is used to cluster DNA sequencing reads based on representation learning by fine-tuning the model.

[0079] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A DNA sequencing read clustering method based on representation learning, characterized in that, The method includes: Preprocess the raw DNA sequencing reads to obtain the sequencing reads themselves and the corresponding variant 1 and variant 2 sets; Based on the sequencing reads themselves and the corresponding variant 1 and variant 2 sets, a deep learning model is used to learn the representation of DNA sequencing reads. Based on the DNA sequencing reads learned through representation learning, DNA sequencing read clustering is achieved by fine-tuning the model; The deep learning model encoder uses a 6-layer Transformer module, and the decoder is a linear network. The output dimension of the linear network is the same as the dimension of the sequencing read matrix. Methods for characterizing DNA sequencing reads using deep learning models, based on the sequencing reads themselves and the corresponding variant 1 and variant 2 sets, include: The elements in the set x, x1 and x2 are input into the encoder. The transformer module in the encoder will automatically learn a 32-dimensional vector r for each input element. r is the low-dimensional representation of the input element of the encoder. A low-dimensional representation is input into a linear network, and the linear network outputs a DNA sequence. The fine-tuning model consists of an encoder and a softmax activation function. First, the linear network of the deep learning model is removed, and the encoder is retained. Then, a softmax activation function is connected after the encoder. The output dimension of the softmax activation function is equal to the number of categories of the sequencing read. Methods for clustering DNA sequencing reads based on representation learning and by fine-tuning the model include: The elements in the set x, x1 and x2 are input into the encoder of the fine-tuning model. The encoder learns a 32-dimensional vector r1 and inputs it into the softmax function. The output of the function is set to a vector with dimension n, where n is the number of sequencing read categories. For elements in the input encoder that belong to set x, they are classified into the category corresponding to the maximum value in the softmax output vector, resulting in cluster 1; for elements belonging to set x1, the mask characters N at both ends are first converted into the bases corresponding to the original primers, and then classified into the category corresponding to the maximum value in the softmax output vector, resulting in cluster 2; for elements belonging to set x2, the middle mask character N is first converted into the bases corresponding to the original data part, and then classified into the category corresponding to the maximum value in the softmax output vector, resulting in cluster 3. For each cluster in cluster 1, cluster 2, and cluster 3, a majority vote is performed within the cluster. Each cluster obtains a cluster center through the majority vote. The base at each position of the cluster center is the base with the highest number of votes at that position. Methods for preprocessing raw DNA sequencing reads to obtain the sequencing reads themselves and the corresponding variant 1 and variant 2 sets include: Each raw DNA sequencing read is masked twice, so that each DNA sequencing read has three copies: the sequencing read itself, variant 1, and variant 2. One-hot encoding was performed on the sequencing read itself, variant 1, and variant 2. After one-hot encoding, all sequencing reads and their corresponding variants 1 and 2 are converted into matrix form. The set of sequencing reads after one-hot encoding is denoted as x, the set of corresponding variants 1 is denoted as x1, and the set of variants 2 is denoted as x2. Methods for performing two masking operations on each raw DNA sequencing read include: The bases corresponding to the primers at both ends of the DNA sequencing read are converted to the character N, while the middle data part remains unchanged, and each sequencing read generates variant 1; The bases corresponding to the middle data portion of the DNA sequencing read are converted into the character N, while the primers at both ends remain unchanged, resulting in variant 2 for each sequencing read.

2. The method according to claim 1, characterized in that, Methods for one-hot encoding of the sequencing read itself, variant 1, and variant 2 include: The character N is encoded into a column vector [0, 0, 0, 0]. T The base A is encoded into a column vector [1, 0, 0, 0]. T The base T is encoded into a column vector [0, 1, 0, 0]. T The base C is encoded into a column vector [0, 0, 1, 0]. T The base G is encoded into a column vector [0, 0, 0, 1]. T .

3. A DNA sequencing read clustering system based on representation learning, said system being used to implement the method according to any one of claims 1-2, characterized in that, The system includes: a data preprocessing module, a model pretraining module, and a model clustering fine-tuning module; The data preprocessing module is used to preprocess the raw DNA sequencing reads to obtain the sequencing reads themselves and the corresponding variant 1 and variant 2 sets; The model pre-training module is used to learn the representation of DNA sequencing reads based on the sequencing reads themselves and the corresponding variant 1 and variant 2 sets through a deep learning model. The model clustering fine-tuning module is used to achieve DNA sequencing read clustering based on the DNA sequencing reads after representation learning by fine-tuning the model.

Citation Information

Patent Citations

  • Non-standardized single cell transcriptome sequencing data-oriented clustering method and system

    CN113257365A

  • DNA storage error correction method and system based on generative adversarial network

    CN118155722A