consensusSequence {deepSNV} | R Documentation

## 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, ...)

    ## S4 method for signature 'matrix'
    consensusSequence(x, vector=FALSE, haploid=TRUE, het.cut = .333)

    ## S4 method for signature 'deepSNV'
    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.
`...` | Additional arguments passed to methods.
`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.

### Value

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

### Author(s)

Moritz Gerstung

### Examples

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

[Package deepSNV version 1.38.0 Index]