| onehot_vectorizer {kmers} | R Documentation |
the k-mer composition
onehot_vectorizer(x,
type = Protein,
k = 6);
unlike the tfidf_vectorizer api, which evaluates the weight of each k-mer term by the term frequency and the inverse document frequency, this api just encodes the k-mer composition of the sequence data as a binary vector, i.e. the presence or absence of each k-mer term.
a data frame object: each row is a sequence in the input sequence collection(the row name is the fasta title of the corresponding sequence), and each column is a k-mer term, the cell value is ONE when the k-mer is exists in the corresponding sequence, otherwise ZERO.
this function returns NULL if the input data can not be cast to a fasta sequence collection.