DNA Introduction
Deoxyribonucleic acid (DNA) is one of the four major biological macromolecules found in living cells. DNA carries the genetic information necessary for synthesizing RNA and proteins, and is an essential biomolecule for organism development and normal functioning.
A DNA sequence refers to the primary structure of a DNA molecule, represented using a string of letters (A, T, C, G) that carries genetic information, either real or hypothetical. DNA sequencing methods include optical sequencing and chip-based sequencing.
SDK Features
- Feature Extraction — Text (DNA sequence) feature extraction: the process of converting text data into feature vectors. A commonly used text feature representation is the bag-of-words model, which disregards word order and treats each unique word as a separate feature column, forming a vocabulary of distinct feature words.
- CountVectorizer is a common feature value computation class and a text feature extraction method. For each training text, it only considers the frequency of each word appearing in that training text.
- CountVectorizer converts words in text into a word frequency matrix, using the fit function to count the occurrences of each word.
- CountVectorizer aims to convert a document into a vector through counting. When no prior dictionary exists, CountVectorizer acts as an Estimator to extract vocabulary for training and generates a CountVectorizerModel to store the corresponding vocabulary vector space. The model produces a sparse representation of documents by word. During CountVectorizerModel training, CountVectorizer selects vocabulary from high to low frequency in the corpus. The maximum vocabulary size is specified by the vocabsize hyperparameter, while the minDF hyperparameter specifies the minimum number of different documents a word must appear in.
Running Example — DNASequenceExample
After running successfully, the command line should display the following:
# Show first 5 records +-----+--------------------+ |label| sequence| +-----+--------------------+ | 4|[ATGC, TGCC, GCCC...| | 4|[ATGA, TGAA, GAAC...| | 3|[ATGT, TGTG, GTGT...| | 3|[ATGT, TGTG, GTGT...| | 3|[ATGC, TGCA, GCAA...| +-----+--------------------+ # Feature vectors +-----+--------------------+--------------------+ |label| sequence| features| +-----+--------------------+--------------------+ | 4|[ATGC, TGCC, GCCC...|(336,[0,8,14,17,1...| | 4|[ATGA, TGAA, GAAC...|(336,[0,1,2,3,5,7...| | 3|[ATGT, TGTG, GTGT...|(336,[0,1,2,3,4,5...| | 3|[ATGT, TGTG, GTGT...|(336,[0,1,2,3,4,5...| | 3|[ATGC, TGCA, GCAA...|(336,[0,1,2,3,4,5...| +-----+--------------------+--------------------+