ConsSeq {QSutils} | R Documentation

## Consensus sequence given an alignment and frequencies

### Description

ConsSeq determines the consensus sequence from a set of haplotypes.

### Usage

    ConsSeq(seqs, w=NULL)

### Arguments

`seqs` | DNAStringSet or AAStringSet object with the haplotype sequences.
`w` | An optional numeric vector with the haplotype counts.

### Details

The most frequent nucleotide or amino acid at each position is taken. No IUPAC ambiguity codes are considered; in the case of ties, the consensus nucleotide is decided randomly.

### Value

Character vector with the consensus sequence.

### Author(s)

Mercedes Guerrero-Murillo and Josep Gregori

### See Also

`ReadAmplSeqs`

### Examples

    filepath<-system.file("extdata","ToyData_10_50_1000.fna", package="QSutils")
    lst <- ReadAmplSeqs(filepath,type="DNA")

    ConsSeq(lst$hseqs,lst$nr)

[Package QSutils version 1.2.0 Index]