R/seq_summarize_operations.R
seq_consensus.Rd
Find a consensus sequence for a set of sequences.
seq_consensus(x, method = "chr_majority", weights = NULL, gaps = TRUE)
a DNA, RNA or AA vector.
the consensus method (see Details).
an optional numeric vector of same length
as x
giving a weight for each input sequence.
logical. Should the gaps ("-") taken into account.
A consensus sequence
"chr_majority", "chr_ambiguity", "seq_centrality", "seq_majority"
For chr_ambiguity gap character always override other characters. Use gaps = FALSE to ignore gaps.
Other aggregation operations:
seq_cluster()
x <- c("-----TACGCAGTAAAAGCTACTGATG",
"CGTCATACGCAGTAAAAACTACTGATG",
"CTTCATACGCAGTAAAAACTACTGATG",
"CTTCATATGCAGTAAAAACTACTGATG",
"CTTCATACGCAGTAAAAACTACTGATG",
"CGTCATACGCAGTAAAAGCTACTGATG",
"CTTCATATGCAGTAAAAGCTACTGACG")
x <- dna(x)
seq_consensus(x)
#> DNA vector of 1 sequences
#> > CTTCATACGCAGTAAAAACTACTGATG