FreqMat {QSutils} | R Documentation

## Matrix of nucleotide or amino acid frequencies in alignment by position

### Description

Computes the nucleotide or amino acid frequency at each position in the alignment.

### Usage

    FreqMat(seqs,nr=NULL)

### Arguments

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

### Value

Matrix with the frequency of each nucleotide or amino acid in each position. A (4 x n) or (20 x n) matrix, where n is the alignment length.

### Author(s)

Mercedes Guerrero-Murillo and Josep Gregori

### Examples

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

    # Frequencies only in the alignment.
    FreqMat(lst$hseqs)
    # Also taking into account haplotype frequencies.
    FreqMat(lst$hseqs,lst$nr)

[Package QSutils version 1.5.0 Index]