seq_consensus {bioseq} | R Documentation |
Find a consensus sequence for a set of sequences.
Description
Find a consensus sequence for a set of sequences.
Usage
seq_consensus(x, method = "chr_majority", weights = NULL, gaps = TRUE)
Arguments
x |
a DNA, RNA or AA vector. |
method |
the consensus method (see Details). |
weights |
an optional numeric vector of same length
as |
gaps |
logical. Should the gaps ("-") taken into account. |
Details
"chr_majority", "chr_ambiguity", "seq_centrality", "seq_majority"
For chr_ambiguity gap character always override other characters. Use gaps = FALSE to ignore gaps.
Value
A consensus sequence
See Also
Other aggregation operations:
seq_cluster()
Examples
x <- c("-----TACGCAGTAAAAGCTACTGATG",
"CGTCATACGCAGTAAAAACTACTGATG",
"CTTCATACGCAGTAAAAACTACTGATG",
"CTTCATATGCAGTAAAAACTACTGATG",
"CTTCATACGCAGTAAAAACTACTGATG",
"CGTCATACGCAGTAAAAGCTACTGATG",
"CTTCATATGCAGTAAAAGCTACTGACG")
x <- dna(x)
seq_consensus(x)
[Package bioseq version 0.1.4 Index]