tagClusterConvertors: Private functions to convert TC formats

Description Usage Arguments Details See Also Examples

Description

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

Usage

1
2
3

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)))

CAGEr documentation built on Jan. 17, 2021, 2 a.m.