Learn R Programming

VLF (version 1.1)

specimen.frequencies: 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)

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.

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.

Author

Taryn B. T. Athey and Paul D. McNicholas

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.

Examples

Run this code
if (FALSE) 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)

Run the code above in your browser using DataLab