merge_cluster: Merges a number of clusters around the target

Description Usage Arguments Value Examples

View source: R/model.R

Description

The purpose of the function merge_cluster is to define an enlarged window of SNPs which are in linkage disequilibrium with the target. It replaces the indices of neighbor clusters with center, the target cluster index. The neighborhood is defined according to the parameter k (see Arguments for more details). Subsequently, we filter them out for the estimate of the propensity scores.

Usage

1
merge_cluster(clusters, center, k = 3)

Arguments

clusters

vector of cluster memberships. Typically, the output of cutree

center

the target variant cluster

k

vector or integer. if k is given as a vector, it corresponds to the cluster indices to be updated. Otherwise, if k is an integer, the cluster indices to be updated lie between center-k and center+k.

Value

The updated cluster membership vector. The cluster indexing is also updated so that the maximum cluster index is equal to the total number of clusters after merging.

Examples

1
2
3
hc <- hclust(dist(USArrests))
clusters <- cutree(hc, k = 10)
merge_cluster(clusters, center=5, k=2)

epiGWAS documentation built on Sept. 8, 2019, 5:02 p.m.