seq_consensus: Find a consensus sequence for a set of sequences.

View source: R/seq_summarize_operations.R

seq_consensusR 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 x giving a weight for each input sequence.

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)

bioseq documentation built on Sept. 6, 2022, 5:07 p.m.