Error.Rate: Error Rate

View source: R/Error.Rate.R

Error.RateR Documentation

Error Rate

Description

Calculates shared, singleton, and total second codon position error rate in a matrix of sequences.

Usage

Error.Rate(single, shared, spec, seqlength)

Arguments

single

A vector of singleton very low frequency variant (VLF) counts for each position in the sequence.

shared

A vector of shared very low frequenct variant (VLF) counts for each position in the sequence.

spec

The number of specimen being considered in the dataset.

seqlength

The length of the barcode sequence.

Details

The arguments single and shared can be calculated simultaneously using the find.singles function. The spec argument can be calculated by using the nrow() function on the sequence matrix.

Value

A vector containing the single, shared, and total error rate based on the number of second position VLFs.

Author(s)

Taryn B. T. Athey and Paul D. McNicholas

Examples

## Not run: data(birds)
species.names <- birds[,2]
specimen.Number <- nrow(birds)
rownames(birds) <- species.names
Nuc.count <- count.function(birds, specimen.Number, 648)
frequency.matrix <- ffrequency.matrix.function(Nuc.count, 648)
birdSpec.freq <- specimen.frequencies(frequency.matrix, birds, specimen.Number, species.names, 648)
Bird_specimen_VLFcount <- VLF.count.spec(birdSpec.freq, 0.001, 648)
Bird_position_VLFcount <- VLF.count.pos(birdSpec.freq, 0.001, 648)
bird_VLFconvert <- VLF.convert.matrix(birds, birdSpec.freq, 0.001, 648)
bird_VLFnuc <- VLF.nucleotides(bird_VLFconvert, birds, 648)
bird_VLFreduced <- VLF.reduced(bird_VLFnuc, Bird_specimen_VLFcount, 648)
bird_species <- separate(bird_VLFreduced)
birds_singleAndShared <- find.singles(bird_species, 648)
Bird_error <- Error.Rate(birds_singleAndShared[1,], birds_singleAndShared[2,], specimen.Number, 648)
## End(Not run)

VLF documentation built on Aug. 18, 2022, 5:06 p.m.