specimen.frequencies: Specimen Nucleotide Frequencies

View source: R/specimen.frequencies.R

specimen.frequenciesR Documentation

Specimen Nucleotide Frequencies

Description

Converts a matrix of sequences into a matrix of nucleotide frequencies.

Usage

specimen.frequencies(freq, seq.matrix, no.spec, spec.names, seqlength)

Arguments

freq

Frequency matrix for nucleotides.

seq.matrix

Matrix of specimen sequences, where the sequence starts in the third position of the matrix and the first and second position contain the unique specimen identifier and the species name, respectively.

no.spec

The number of specimen in seq.matrix.

spec.names

A vector containing the names of the specimen in the seq.matrix, in the order they appear in the matrix.

seqlength

The length of the nucleotide sequence.

Details

The argument freq can be calculated using the function ffrequency.matrix.function. The number of specimen can be calculated by using the nrow() function on seq.matrix.

Value

A matrix containing the unique specimen identifer in the first position, the species name in the second position, and the frequencies for each nucleotide in the sequences starting at the third position.

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)
## End(Not run)

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