Description Usage Arguments Details Author(s) Examples
Copy Attributes to Another Object
1 | copyAttr(x, y)
|
x |
Object 1. |
y |
Object 2. |
The normalizeToMatrix
object is actually a matrix but with more additional attributes attached.
When manipulating such matrix, there are some circumstances that the attributes are lost.
This function is used to copy these specific attributes when dealing with the matrix.
Zuguang Gu <z.gu@dkfz.de>
1 2 3 4 5 6 7 8 9 10 11 | gr = GRanges(seqnames = c("chr5", "chr5"),
ranges = IRanges(start = c(98, 98),
end = c(104, 104)))
target = GRanges(seqnames = "chr5",
ranges = IRanges(start = 100,
end = 100))
mat1 = normalizeToMatrix(gr, target, extend = 6, w = 1)
# attributes removed and you cannot use it for EnrichedHeatmap()
mat2 = mat1[]
# copy attributes to mat2 and now mat3 can be used for EnrichedHeatmap()
mat3 = copyAttr(mat1, mat2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.