assignClusters {ComPrAn} | R Documentation

## Create a data frames with cluster assignment

### Description

This function creates a data frame with column specifying clusters assigned ot each protein using the table and distance matrix produced by clusterComp() function.

### Usage

    assignClusters(.listDf, sample, method = "complete", cutoff = 0.5)

### Arguments

`.listDf` | list of data frames produced by clusterComp() function
`sample` | which of the two samples you want to apply the function to (labeled/unlabeled).
`method` | character, One of 'average', 'single' or 'complete' (default), specifies the linkage method to be used inside R hclust() function
`cutoff` | numeric, specifies the h value in R cutree() function, height at which to 'cut the tree', everything with distance below this value is assigned into same cluster everything with larger distance is in a different cluster extreme possible values are 0 to 2 (might not be reached for all data sets)

### Value

dataframe

### See Also

`clusterComp`

### Examples

    ##Use example normalised proteins file
    inputFile <- system.file("extData", "dataNormProts.txt", package = "ComPrAn")
    #read file in and change structure of table to required format
    forAnalysis <- protImportForAnalysis(inputFile)
    # create components necessary for clustering
    clusteringDF <- clusterComp(forAnalysis,scenar = "A", PearsCor = "centered")
    #assign clusters
    labTab_clust <- assignClusters(.listDf = clusteringDF,sample = "labeled",
    method = 'complete', cutoff = 0.5)
    unlabTab_clust <- assignClusters(.listDf = clusteringDF,sample = "unlabeled",
                                   method = 'complete', cutoff = 0.5)

[Package ComPrAn version 1.2.0 Index]