Acluster: A-clustering

Description Usage Arguments Value Examples

Description

An algorithm for clustering of adjacent clusters

Usage

1
Acluster(ordr.vec, thresh.dist, which.clust = NULL, location.vec = NULL, max.dist = Inf, type = "single", dist.type = "spearman")

Arguments

ordr.vec

An (n by m) matrix of n measurements of m random variables (methylations). The columns are ordered.

thresh.dist

A distance threshold. Two neighboring clusters are merged to a single cluster if the distance between them is above thresh.dist.

which.clust

A vector of initial clusters assignments of the m variables. If it is not provided, it is taken that each site is a unique cluster.

location.vec

An m vector specifying the locations (e.g. chromosomal locations) of the variables measured in the matrix ordr.vec.

max.dist

Optional maximum length between neighboring variables permitting to cluster them together.

type

Type of clustering function. "single", "complete" or "average".

dist.type

Type of distance function "spearman", "pearson", or "euclid".

Value

An m vector of cluster assignments of the m ordered variables.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(betas.7)
data(annot.7)

dat.7.ord <- order.betas.by.chrom.location(betas.7, annot = annot.7)
cluster.vec <- Acluster(ordr.vec = dat.7.ord$betas.by.chrom[[1]], 
thresh.dist = 0.2, 
location.vec = dat.7.ord$sites.locations.by.chrom[[1]]$Coordinate_37, 
max.dist = 1000, type = "average")

cluster.vec[1:10] ## sites 1 to 6 are clustered together, but 7,8,9 are singletons. 

## alternatively, the function assign.to.clusters calls this function. 
 

ftyu1234/Aclust documentation built on May 16, 2019, 3:37 p.m.