copyAttr: Copy attributes to another object

Description Usage Arguments Details Author(s) Examples

Description

Copy attributes to another object

Usage

1
copyAttr(x, y)

Arguments

x

object 1

y

object 2

Details

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.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

Examples

 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)

eilslabs/EnrichedHeatmap documentation built on May 16, 2019, 1:22 a.m.