MutationFreq | R Documentation |
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.
MutationFreq(dst=NULL,nm=NULL,nr=NULL,len=1)
MutationFreqVar(nm,nr=NULL,len=1)
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. |
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.
Mercedes Guerrero-Murillo and Josep Gregori
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.
DNA.dist
, GetQSData
, ReadAmplSeqs
# 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])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.