| tagClusterConvertors {CAGEr} | R Documentation |
Interconvert tag clusters (TC) formats used in classes CAGEset
(data.frame) and CAGEexp (GRanges).
TCgranges2dataframe(gr) TCdataframe2granges(df)
gr |
Consensus clusters in |
df |
Consensus clusters in |
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.
Other df2granges converters: consensusClusterConvertors
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)))