plot_bits_logo | R Documentation |
This function makes a publication quality logo.
If the sequences contains an alphabet with letters in upper AND lower case,
the Shannon entropy is calculated in a case-insensitive way.
Meaning that the maximum bit value will be log2
the number of in the alphabet.
Instead in the plot the letters preserve their case.
plot_bits_logo(
df,
ID_col,
alphabet,
small_n_correction = FALSE,
y_lims = c(0, NA),
anno_width = 0.75,
InfoContent_thrshld,
highlight_colour = "grey74",
axis_txt_size = 10,
ttl_txt = NULL,
...
)
df |
A data.frame with a column called |
ID_col |
A character specifying the column name in |
alphabet |
A character vector containing the alphabet letters present in |
small_n_correction |
Logical for applying a small correction to the Shannon Entropy for low number of input sequences. Parameter for df2bits, type |
y_lims |
A numeric vector of length 2 specifying the Y-axis min and max value. Default |
anno_width |
A small number that defines how wide the vertical bar should be. Default |
InfoContent_thrshld |
The information content (bits) threshold to consider a letter position
to be highlighted. Position whose letter information sum is lower than |
highlight_colour |
A colour name to fill the letter highlighting rectangle. Default |
axis_txt_size |
A number specifying the size of the axis text in the plot. Default 10. |
ttl_txt |
Some text in quotes specifying the plot title. |
... |
Advanced parameters passed to renumber_logo_seq_breaks. |
This function uses geom_logo to plot the logo.
A ggplot sequence logo
plot_bits_logo(df = df_w_seqs, ID_col = 'Species')
plot_bits_logo(df = df_w_seqs, ID_col = 'Species',
InfoContent_thrshld = 0.5, anno_width = 0.5,
highlight_colour = 'lightblue',
uppercase_spacer = 5, lowercase_spacer = 6)
# compare the plot when a small number epsilon is added to the Shannon's Entropy formula
# This is the default
plot_bits_logo(df = suz12_ex4_eutheria, ID_col = 'Species', y_lims = c(0, 2),
small_n_correction = F, ttl_txt = 'Without small correction')
# This is optional, but recommended when having few input sequences
plot_bits_logo(df = suz12_ex4_eutheria, ID_col = 'Species', y_lims = c(0, 2),
small_n_correction = F, ttl_txt = 'Without small correction')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.