Learn R Programming

spider (version 1.2-0)

slideNucDiag: Sliding nucleotide diagnostics

Description

Calculates the number of diagnostic nucleotides in sliding windows.

Usage

slideNucDiag(DNAbin, sppVector, width, interval = 1)

Arguments

DNAbin
A DNA alignment of class `DNAbin'.
sppVector
Species vector (see sppVector).
width
Desired width of windows in number of base pairs.
interval
Distance between each window in number of base pairs. Default of 1. Giving the option of "codons" sets the size to 3.

Value

  • A matrix giving the number of diagnostic nucleotides for each species (rows) in each window (columns).

Details

Determines the number of diagnostic nucleotides for each species in each window.

See Also

slideAnalyses, slideBoxplots, slidingWindow.

Examples

Run this code
data(dolomedes)
doloSpp <- substr(dimnames(dolomedes)[[1]], 1, 5)

slideNucDiag(dolomedes, doloSpp, 200, interval = 3)

slidND <- slideNucDiag(dolomedes, doloSpp, 200, interval = 3)

#Number of basepairs for each species
matplot(t(slidND), type = "l")

#Number of basepairs for a single species
plot(slidND[4, ], type = "l")

#Total number of basepairs per window
plot(colSums(slidND), type = "l")

Run the code above in your browser using DataLab