View source: R/sequence-motif-visualisation.R
| format_sequence_motif_positions | R Documentation |
Produces a deterministic report-ready table from positional motif summaries.
format_sequence_motif_positions(
x,
digits = 3L,
position_units = c("proportion", "percent"),
include_rank = TRUE
)
x |
An object returned by |
digits |
Whole number from 0 to 15 controlling numeric rounding. |
position_units |
Display units for relative positions: |
include_rank |
Logical value indicating whether to include an
earlier-to-later rank based on mean position. Ranking is performed within
each supplied |
Formatting copies and transforms the summary table only. The input object is not modified. Rows are ordered deterministically by grouping values, mean and median position, occurrence and sequence counts, motif length, and motif key. Equal mean positions receive the same minimum rank.
A named list containing the formatted table, validation metadata,
and formatting settings.
sequences <- data.frame(
id = c(rep("s1", 5L), rep("s2", 4L)),
position = c(1:5, 1:4),
state = c("A", "B", "A", "B", "C", "A", "B", "C", "B")
)
extracted <- extract_sequence_ngrams(
sequences,
sequence_id_col = "id",
order_col = "position",
state_col = "state"
)
positions <- summarise_sequence_motif_positions(
extracted,
position = "centre",
scale = "relative"
)
formatted <- format_sequence_motif_positions(
positions,
position_units = "percent",
digits = 1
)
formatted$table
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.