View source: R/extract_features_from_bam.R
calc_string_entropy_k_mer | R Documentation |
This function computes the Shannon entropy for all possible k-mers within a given string. Shannon entropy is a measure of the unpredictability of the k-mer composition, with higher values indicating more diversity. This function is useful in bioinformatics for analyzing the complexity of sequences.
calc_string_entropy_k_mer(s, k = 2, alphabet = c("A", "C", "G", "T", "N"))
s |
A string for which the Shannon entropy is to be calculated. |
k |
The size of the k-mers (substrings of length k) to be considered for entropy calculation. The default value is 2. |
alphabet |
A vector of characters representing the possible nucleotides or readings in the string. The default set includes "A", "C", "G", "T", "N". |
Returns a numeric value representing the Shannon entropy of the k-mers in the string. This entropy value is a measure of the randomness or diversity of k-mer composition.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.