View source: R/intervals-to-mat.R
| gintervals.from_mat | R Documentation |
Inverse of gintervals.to_mat. Recovers intervals from
attr(mat, "intervals") if mat is an intervs_mat, or
from the explicit intervals argument if mat is a plain matrix.
Never parses rownames.
gintervals.from_mat(mat, intervals = NULL)
mat |
an |
intervals |
data.frame with |
A data.frame with chrom, start, end (plus
intervalID if it was present in the original input), followed by
the value columns.
gintervals.to_mat
df <- data.frame(
chrom = c("chr1", "chr2"),
start = c(100L, 200L),
end = c(200L, 400L),
t1 = c(1.0, 2.0)
)
mat <- gintervals.to_mat(df)
identical(gintervals.from_mat(mat)$t1, df$t1)
# plain matrix path:
plain <- unclass(mat)
attr(plain, "intervals") <- NULL
gintervals.from_mat(plain, intervals = df[, c("chrom", "start", "end")])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.