tagClusterConvertors {CAGEr} | R Documentation

## Private functions to convert TC formats

### Description

Interconvert tag clusters (TC) formats used in classes CAGEset (`data.frame`) and CAGEexp (`GRanges`).

### Usage

    TCgranges2dataframe(gr)

    TCdataframe2granges(df)

### Arguments

`gr` | Consensus clusters in `GRanges` format.
`df` | Consensus clusters in `data.frame` format.

### Details

The original format used in `CAGEset` objects follows BED ("0-based") conventsion for the start and end coordinates. On the other hand, the GRanges objects used in `CAGEexp` objects follow the "1-based" convention. Therefore a value of 1 has to be added or subtracted to the start positions when converting between both formats.

### See Also

Other df2granges converters: `consensusClusterConvertors`

### Examples

    df <- tagClusters(exampleCAGEset, 1)
    head(df)
    gr <- CAGEr:::TCdataframe2granges(df)
    gr
    head(CAGEr:::TCgranges2dataframe(gr))
    # No exact round-trip because start and end were not integer in df.
    identical(df, CAGEr:::TCgranges2dataframe(gr))
    if (! all(df == CAGEr:::TCgranges2dataframe(gr)))
      stop("No round-trip between TCdataframe2granges and TCgranges2dataframe")

    tagClustersGR(exampleCAGEexp)
    head(CAGEr:::TCgranges2dataframe(CAGEr:::tagClustersGR(exampleCAGEexp, 1)))

[Package CAGEr version 1.30.3 Index]