View source: R/sequence-motifs.R
| format_sequence_motifs | R Documentation |
Produces a stable, report-ready table from motif extraction, summary, or filtered-motif output.
format_sequence_motifs(
x,
digits = 3L,
prevalence = c("proportion", "percent"),
include_rank = TRUE,
rank_by = c("sequence_prevalence", "n_occurrences", "n_sequences"),
ties = c("min", "first"),
include_ids = TRUE
)
x |
A motif extraction, motif summary, or filtered-motif object. |
digits |
Whole number from 0 to 15 controlling numeric rounding. |
prevalence |
Character value specifying whether prevalence and
occurrence share are shown as |
include_rank |
Logical value indicating whether to add a rank column. |
rank_by |
Metric used to order and rank motifs: one of
|
ties |
Character value specifying |
include_ids |
Logical value indicating whether |
Formatting changes display precision and units only. It does not change the underlying motif counts or introduce substantive interpretation.
A named list containing table, validation metadata, and formatting
settings. The table contains only structural motif measurements.
sequences <- data.frame(
id = c(rep("s1", 5L), rep("s2", 4L)),
position = c(1:5, 1:4),
state = c("A", "B", "A", "B", "A", "A", "B", "A", "C")
)
extracted <- extract_sequence_ngrams(
sequences,
sequence_id_col = "id",
order_col = "position",
state_col = "state"
)
formatted <- format_sequence_motifs(
extracted,
prevalence = "percent",
digits = 1
)
formatted$table
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.