summarise_consensus_agreement: Summarise consensus agreement

View source: R/sequence-consensus-groups.R

summarise_consensus_agreementR Documentation

Summarise consensus agreement

Description

Summarise consensus agreement

Usage

summarise_consensus_agreement(
  consensus,
  by = c("overall", "group", "position"),
  threshold = 0.5
)

Arguments

consensus

A result from create_consensus_sequence().

by

Summary level: "overall", "group", or "position".

threshold

Agreement threshold used to count low-agreement positions.

Value

A data frame with position counts, mean, median, minimum and maximum agreement, weighted agreement, tie counts, and low-agreement counts.

Examples

sequences <- data.frame(
  sequence_id = rep(c("s1", "s2", "s3", "s4"), each = 4L),
  sequence_order = rep(1:4, times = 4L),
  state = c("A", "B", "C", "D", "A", "B", "C", "C",
            "D", "C", "B", "A", "D", "C", "A", "A"),
  group = rep(c("g1", "g2"), each = 8L),
  stringsAsFactors = FALSE
)
consensus <- create_consensus_sequence(sequences)
summarise_consensus_agreement(consensus)


gp3sequences documentation built on Aug. 23, 2026, 5:10 p.m.