MutationFreq: Mutation frequency with respect to the dominant haplotype

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/MutationFreq.R

Description

MutationFreq computes the mutation frequency given a vector of counts, and the genetic distances of each haplotype to the dominant haplotype. MutationFreqVar returns the variance of the mutation frequency.

Usage

1
2
MutationFreq(dst=NULL,nm=NULL,nr=NULL,len=1)
MutationFreqVar(nm,nr=NULL,len=1)

Arguments

dst

A "dist" object or a symmetric matrix with pairwise distances.

nm

Vector of distances or differences with respect to the dominant haplotype including itself (eg, nm[1] is 0 if w[1]==max(w)).

nr

An optional numeric vector with the haplotype counts.

len

The alignment width when nm is the number of differences, otherwise 1. Defaults to 1.

Value

A value corresponding to the mutation frequency for MutationFreq or its variance for MutationFreqVar. When nr is NULL, the same weight is given to each haplotype and the computed value corresponds to the mutation frequency by entity.

Author(s)

Mercedes Guerrero-Murillo and Josep Gregori

References

Gregori J, Perales C, Rodriguez-Frias F, Esteban JI, Quer J, Domingo E. Viral quasispecies complexity measures. Virology. 2016 Jun;493:227-37. doi: 10.1016/j.virol.2016.03.017. Epub 2016 Apr 6. Review. PubMed PMID: 27060566.

Gregori J, Salicrú M, Domingo E, Sanchez A, Esteban JI, Rodríguez-Frías F, Quer J. Inference with viral quasispecies diversity indices: clonal and NGS approaches. Bioinformatics. 2014 Apr 15;30(8):1104-1111. Epub 2014 Jan 2. PubMed PMID: 24389655.

See Also

DNA.dist, GetQSData, ReadAmplSeqs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Load alignment with abundances.
filepath<-system.file("extdata","ToyData_10_50_1000.fna", package="QSutils")
lst <- GetQSData(filepath,type="DNA")

# Mutation frequency. 
dst <- DNA.dist(lst$seqs,model="raw")
MutationFreq(dst=dst,len=width(lst$seqs)[1])

# Mutation frequency with abundances.
MutationFreq(nm=lst$nm,nr=lst$nr,len=width(lst$seqs)[1])

# Variance of the mutation frequency.
MutationFreqVar(nm=lst$nm,nr=lst$nr,len=width(lst$seqs)[1])

QSutils documentation built on Nov. 8, 2020, 7:42 p.m.