color_dna_sequence: Colors a vector of DNA/peptide sequences via html

color_dna_sequenceR Documentation

Colors a vector of DNA/peptide sequences via html

Description

Colors a vector of DNA/peptide sequences via html

Usage

color_dna_sequence(sequences)

Arguments

sequences

vector of DNA or peptide sequences

Examples

#' 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)


lefeverde/lefutils documentation built on Sept. 18, 2024, 7:30 a.m.