Learn R Programming

deepSNV (version 1.18.3)

consensusSequence: Calculate the consensus sequence.

Description

This function computes the consensus sequence from a matrix of nucleotide counts, or the control slot of a deepSNV object.

Usage

consensusSequence(x, ...)
"consensusSequence"(x, vector=FALSE, haploid=TRUE, het.cut = .333)
"consensusSequence"(x, vector=FALSE, haploid=TRUE, het.cut = .333)

Arguments

x
An object. Either an deepSNV-class object, or a named matrix with nucleotide counts.
vector
Boolean where TRUE indicates that a character vector should be returned.
haploid
Should the consensus be called for a haploid control? Otherwise, also all bases larger than het.cut are rerported. Default haploid = TRUE.
het.cut
Heterozygous cutoff. If haploid = FALSE, report all nucleotides with relative frequency larger than het.cut. Default = 0.333.
...
Additional arguments passed to methods.

Value

A DNAString with the consensus sequence, or if vector = TRUE, a character vector.

Examples

Run this code
data(HIVmix)
seq = consensusSequence(HIVmix)
consensusSequence(HIVmix, vector=TRUE)[1:10]

Run the code above in your browser using DataLab