Cophenetic: Compute cophenetic distances on dendrogram objects

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Cophenetic.R

Description

Calculates the matrix of cophenetic distances represented by a dendrogram object.

Usage

1

Arguments

x

A dendrogram object.

Details

The cophenetic distance between two observations is defined as the branch length separating them on a dendrogram. This function differs from the cophenetic function in that it does not assume the tree is ultrametric and outputs the branch length separating pairs of observations rather than the height of their merger. A dendrogram that better preserves a distance matrix will show higher correlation between the distance matrix and it cophenetic distances.

Value

An object of class 'dist'.

Author(s)

Erik Wright eswright@pitt.edu

See Also

IdClusters

Examples

1
2
3
4
5
6
fas <- system.file("extdata", "Bacteria_175seqs.fas", package="DECIPHER")
dna <- readDNAStringSet(fas)
d1 <- DistanceMatrix(dna, type="dist")
dend <- IdClusters(d1, method="NJ", type="dendrogram")
d2 <- Cophenetic(dend)
cor(d1, d2)

Example output

Loading required package: Biostrings
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package:BiocGenericsThe following objects are masked frompackage:parallel:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked frompackage:stats:

    IQR, mad, sd, var, xtabs

The following objects are masked frompackage:base:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which.max, which.min

Loading required package: S4Vectors
Loading required package: stats4

Attaching package:S4VectorsThe following object is masked frompackage:base:

    expand.grid

Loading required package: IRanges
Loading required package: XVector

Attaching package:BiostringsThe following object is masked frompackage:base:

    strsplit

Loading required package: RSQLite
================================================================================

Time difference of 0.15 secs

================================================================================

Time difference of 0.09 secs

[1] 0.9864114

DECIPHER documentation built on Nov. 8, 2020, 8:30 p.m.