Open SoManyPepople opened 1 year ago
The strands of the "target regions" are taken into consideration. The strands of "signal regions" are ignored.
See the following examples:
load(system.file("extdata", "chr21_test_data.RData", package = "EnrichedHeatmap"))
tss = promoters(genes, upstream = 0, downstream = 1)
mat1 = normalizeToMatrix(H3K4me3, tss, value_column = "coverage",
extend = 5000, mean_mode = "w0", w = 50)
ht1 = EnrichedHeatmap(mat1, col = c("white", "red"), name = "H3K4me3", column_title = "normal strand")
tss2 = tss
strand(tss2) = ifelse(strand(tss) == "-", "+", "-")
mat2 = normalizeToMatrix(H3K4me3, tss2, value_column = "coverage",
extend = 5000, mean_mode = "w0", w = 50)
ht2 = EnrichedHeatmap(mat2, col = c("white", "red"), name = "H3K4me3", column_title = "reversed strand")
tss3 = tss
strand(tss3) = "*"
mat3 = normalizeToMatrix(H3K4me3, tss3, value_column = "coverage",
extend = 5000, mean_mode = "w0", w = 50)
ht3 = EnrichedHeatmap(mat3, col = c("white", "red"), name = "H3K4me3", column_title = "ignore strand")
ht1 + ht2 + ht3
Hi, Thanks for development of this nice tool. I found no parameter to set strandness in the function "normalizeToMatrix", so I try a test to know whether the strandness of the input GRange objects were adopted in the calculation.
Briefly, I switch the strandness of target GRanges object (GR.utr3), and found the results seem just reversed (window 1 = window20, window2 = window18).
save the original GR
GR.utr3_back <- GR.utr3
set the strand of GR to the opposite
strand(GR.utr3) <- if_else(as.character(strand(GR.utr3))=="+","-","+")
obtain the normalized matrix for new GR
obtain the normalized matrix for original GR
The only solution seems to seperate the signal and target GRanges by their strandness and perform normalizeToMatrix speperately and merged together.