color_dna_sequence | R Documentation |
Colors a vector of DNA/peptide sequences via html
color_dna_sequence(sequences)
sequences |
vector of DNA or peptide sequences |
#' library(knitr)
library(kableExtra)
# Example 1: DNA sequences
dna_sequences <- c("ACTG", "GCTA", "TACG")
colored_dna_sequences <- color_dna_sequence(dna_sequences)
# Creating a table with kable for DNA sequences
dna_data <- data.frame(
DNA_Sequence = dna_sequences,
Colored_DNA_Sequence = colored_dna_sequences
)
dna_data %>%
kable('html', escape = FALSE) %>%
kable_styling('striped', full_width = FALSE)
# Example 2: Peptide sequences
peptide_sequences <- c("MKTAY", "LLGTP", "IVAGL")
colored_peptide_sequences <- color_dna_sequence(peptide_sequences)
# Creating a table with kable for peptide sequences
peptide_data <- data.frame(
Peptide_Sequence = peptide_sequences,
Colored_Peptide_Sequence = colored_peptide_sequences
)
peptide_data %>%
kable('html', escape = FALSE) %>%
kable_styling('striped', full_width = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.