clusterTranscripts {ballgown} | R Documentation

## group a gene's assembled transcripts into clusters

### Description

group a gene's assembled transcripts into clusters

### Usage

    clusterTranscripts(gene, gown, k = NULL, method = c("hclust", "kmeans"))

### Arguments

`gene` | name of gene whose transcripts will be clustered. When using Cufflinks output, usually of the form `"XLOC_######"`
`gown` | ballgown object containing experimental data
`k` | number of clusters to use
`method` | clustering method to use. Must be one of `"hclust"`, for hierarchical clustering, or `"kmeans"`, for k-means clustering.

### Value

list with elements `clusters` and `pctvar`. `clusters` contains columns "cluster" and "t_id", and denotes which transcripts belong to which clusters. `pctvar` is only non-NULL when using k-means clustering and is the percentage of variation explained by these clusters, defined as the ratio of the between-cluster sum of squares to the total sum of squares.

### Author(s)

Alyssa Frazee

### See Also

`hclust`, `kmeans`, `plotLatentTranscripts` for visualizing the transcript clusters

### Examples

    data(bg)
    clusterTranscripts('XLOC_000454', bg, k=2, method='kmeans')
    # transcripts 1294 and 1301 cluster together, 91% variation explained.

[Package ballgown version 2.12.0 Index]