extract_features_OHE {peptoolkit} | R Documentation |
Extract One-Hot Encoded (OHE) Features from Peptide Sequences
Description
This function takes a data frame or a vector of peptide sequences and generates a one-hot encoded data frame representing each amino acid in the sequences. It can also include additional data (such as docking information), if provided.
Usage
extract_features_OHE(df, sequence_col = "Sequence", docking_col = NULL)
Arguments
df |
A data frame or a vector of peptide sequences. |
sequence_col |
A string representing the name of the column containing the peptide sequences. |
docking_col |
A string representing the name of the column containing the docking information. |
Value
A data frame containing one-hot encoded peptide sequences and, if provided, docking information.
Examples
# Load required library caret
library(caret)
# Generate a mock data frame of peptide sequences
df <- data.frame(Sequence = c("AVILG", "VILGA", "ILGAV", "LGAVI"), X = c(1,1,2,3))
# Apply the function to the mock data
extract_features_OHE(df)
[Package peptoolkit version 0.0.1 Index]