Closed ycl6 closed 8 years ago
Your tss
is from mouse which doesn't have chr21.
Thanks! I must have mixed up the test data with my own dataset.
I encounter an error while running normalizeToMatrix()
. It seems my dataset is too large for locfit to handle when smooth = TRUE
, but no error when smooth is turned off.
Error in t(apply(mat, 1, function(x) { :
error in evaluating the argument 'x' in selecting a method for function 't': Error in lfproc(x, y, weights = weights, cens = cens, base = base, geth = geth, :
newsplit: out of vertex space
Methylation: GRanges object with 18728638 ranges and 1 metadata column:
Gene: GRanges object with 22012 ranges and 9 metadata columns:
Searching the net I found many suggest increasing the maxk param of locfit
, but I don't see a way to pass this param from normalizeToMatrix
to locfit
Yes, I also met such kind of error with the old version of the package. It is because for some TSS, there are very few CpG sites upstream and downstream. normalizeToMatrix()
returns a matrix in which each individual value corresponds to mean methylation for 50bp window by default. If there are only very few CpG sites, there may be too many NA values in corresponding rows. And if you perform smoothing on rows afterwards, it may cause errors.
In the old version, smoothing is only performed by locfit()
method, in the newest version, I added some additional check for the fit. If there are too many NA values in some rows, loess()
method will be used as an optional fit.
I am not 100% sure it fixed this problem, but at least for my projects, it's fixed.
Thanks! I didn't realized there's an updated version of the package. I used v1.1.2 and I don't encounter this error now.
One other thing I notice, when I tried to plot 2 EnrichedHeatmap() together, one with fixed position (i.e. TSS) ± 5 Kb, and one with specified region (i.e. Gene body) ± 10 Kb, the X-axis labels of both plots will be the same as the latter plot (i..e -10Kb, Start, End, 10Kb), even though I specify different axis_name.
Is there a way to set order manually, such as using row_order, same as that in Heatmap()
of ComplexHeatmap?
Thanks for the comments.
row_order
is added into the arguments of EnrichedHeatmap()
.Following code is what I used to test:
library(EnrichedHeatmap)
load(paste0(system.file("extdata", "chr21_test_data.RData", package = "EnrichedHeatmap")))
tss = promoters(genes, upstream = 0, downstream = 1)
tss2 = tss
start(tss2) = start(tss) - 1000
end(tss2) = end(tss) + 1000
mat1 = normalizeToMatrix(H3K4me3, tss, value_column = "coverage",
extend = 5000, mean_mode = "w0", w = 50)
mat2 = normalizeToMatrix(H3K4me3, tss2, value_column = "coverage",
extend = 2000, mean_mode = "w0", w = 50)
EnrichedHeatmap(mat1, axis_name_rot = 90) + EnrichedHeatmap(mat2)
# test row_order
od = hclust(dist(mat1))$order
EnrichedHeatmap(mat1, row_order = od)
Trying the normalizeToMatrix() example using data provided with the package