combineClusters {CAGEfightR} | R Documentation

## Combine two CAGE experiments.

### Description

This function can safely combine two CAGE experiments, for example TCs and enhancers, for later analysis, by making sure no ranges in the final object are overlapping.

### Usage

    combineClusters(object1, object2, ...)

    ## S4 method for signature
    ## 'RangedSummarizedExperiment,RangedSummarizedExperiment'
    combineClusters(object1, object2, removeIfOverlapping = "none")

### Arguments

`object1` | RangedSummarizedExperiment: First experiment to be combined.
`object2` | RangedSummarizedExperiment: First experiment to be combined.
`...` | arguments passed to methods.
`removeIfOverlapping` | character: Whether to keep overlapping ranges ('none') or discard from either the first ('object1') or second ('object2') experiment.

### Value

RangedSummarizedExperiment with merged and sorted ranges (colData and metadata are carried over unchanged).

### Examples

    data(exampleUnidirectional)
    data(exampleBidirectional)

    # Clusters must have identical colData to be combined:
    exampleUnidirectional$totalTags <- NULL

    # Combine, keeping potential overlaps
    combineClusters(object1=exampleUnidirectional, object2=exampleBidirectional)

    # If features overlap, keep only from object1
    combineClusters(object1=exampleUnidirectional, object2=exampleBidirectional,
       removeIfOverlapping='object2')

    # If features overlap, keep only from object2
    combineClusters(object1=exampleUnidirectional, object2=exampleBidirectional,
       removeIfOverlapping='object1')

[Package CAGEfightR version 1.10.0 Index]