kmeansDesign: Apply k-means clustering to profile data

View source: R/util.R

kmeansDesignR Documentation

Apply k-means clustering to profile data

Description

This function performs k-means clustering on recoup generated profile matrices and stores the result as a factor in the design element. If no design is present, then one is created from the k-means result.

Usage

    kmeansDesign(input, design = NULL, kmParams)

Arguments

input

a list object created from recoup or partially processed by recoup or its data member. See the main input to recoup for further information.

design

See the respective argument in recoup for further information

kmParams

Contains parameters for k-means clustering on profiles. See the respective argument in recoup for further information.

Value

The design data frame, either created from scratch or augmented by k-means clustering.

Author(s)

Panagiotis Moulos

Examples

# Load some data
data("recoup_test_data",package="recoup")

# Calculate coverages
test.tss <- recoup(
    test.input,
    design=NULL,
    region="tss",
    type="chipseq",
    genome=test.genome,
    flank=c(1000,1000),
    selector=NULL,
    plotParams=list(plot=FALSE,profile=TRUE,
        heatmap=TRUE,device="x11"),
    rc=0.1
)

# Re-design based on k-means
kmParams=list(k=2,nstart=20,algorithm="MacQueen",iterMax=20,
    reference=NULL)
design <- kmeansDesign(test.tss$data,kmParams=kmParams)

pmoulos/recoup documentation built on May 20, 2024, 2:22 a.m.