# Cluster TSSs into tag clusters

`clusterTSS.Rd`

Clusters TSSs within small genomic regions into tag clusters (TCs) using "peakclu" method. "peakclu" method is an implementation of peak-based clustering. The minimum distance of two neighboring peaks can be specified.

    clusterTSS(object, method = "peakclu", peakDistance=100,extensionDistance=30
    , localThreshold = 0.02,clusterThreshold = 1, useMultiCore=FALSE, numCores=NULL)

    # S4 method for TSSr
    clusterTSS(
      object,
      method = "peakclu",
      peakDistance = 100,
      extensionDistance = 30,
      localThreshold = 0.02,
      clusterThreshold = 1,
      useMultiCore = FALSE,
      numCores = NULL
    )

## Arguments

object | A TSSr object
method | Clustering method to be used for clustering: "peakclu". Default is "peakclu".
peakDistance | Minimum distance of two neighboring peaks. Default value = 100.
extensionDistance | Maximal distance between peak and its neighboring TSS or two neighboring TSSs to be grouped in the same cluster. Default value = 30.
localThreshold | Ignore downstream TSSs with signal < localThreshold*peak within clusters, which is used to filter TSS signals brought from possible recapping events, or sequencing noise. Default value = 0.02.
clusterThreshold | Ignore clusters if signal < clusterThreshold. Default value = 1.
useMultiCore | Logical indicating whether multiple cores are used (TRUE) or not (FALSE). Default is FALSE.
numCores | Number of cores are used in clustering step. Used only if useMultiCore = TRUE. Default is NULL.

## Examples

    # \donttest{
    clusterTSS(exampleTSSr, method = "peakclu",clusterThreshold = 1, useMultiCore=TRUE, numCores = NULL)#>
    #> Clustering TSS data with peakclu method...#> [1] "process is running on 8 cores..."# }