calc_PDDmatrix: Calculate Pairwise Distance Deviation Matrix

View source: R/rec_plots.R

calc_PDDmatrixR Documentation

Calculate Pairwise Distance Deviation Matrix

Description

Returns pairwise distance deviation matrix. To build such matrix, the sliding window is moved along the alignment, and for each window the pairwise genetic distances between sequences are calculated. Then for each pair of windows the linear regression for pairwise genetic distances is built and the root mean square error of linear regression is estimated.

Usage

calc_PDDmatrix(dna_object, step, window, method, modification = NA)

Arguments

dna_object

list of DNA sequences produced by read.dna function of ape package (as.character = TRUE mode)

step

step size for sliding process

window

window size (length of genomic regions)

method

method of calculation distances ("pdist", "JC", "Kimura", "TN")

modification

pairwise deletion of positions with gaps (modification='pairwise') or not (modification='NA')

Value

matrix

Examples

## Not run: 
library(colorRamps)
library(gplots)
alignment = read.dna(path/to/file, format="fasta", as.character=TRUE)
alignment[alignment=='-'] <- NA
pddmatrix = calc_PDDmatrix(alignment, 1, 500, 600, 1000)
heatmap.2(as.matrix(pddmatrix), Rowv = FALSE, Colv = "Rowv",
dendrogram = 'none', col=matlab.like, main="PDD matrix", tracecol=NA)
## End(Not run)

v-julia/recDplot documentation built on Feb. 20, 2024, 1:59 p.m.