jokergoo / jokergoo.github.io

Personal website
https://jokergoo.github.io
4 stars 0 forks source link

Presistent error even on example data: Error in split.default(seq_len(nrow(mat)), split) : group length is 0 but data length > 0 #9

Open Rob-murphys opened 2 years ago

Rob-murphys commented 2 years ago

I am getting the following error even on example data from your help docs:

Error in split.default(seq_len(nrow(mat)), split) : 
  group length is 0 but data length > 0

My version is 0.4.14 directly from the github. I know this issue was raided in #5 and mentioned as maybe a bug. Those experiencing it solved by updating to v0.4.14. However the bug seems to persist.

circos.heatmap(pre_wide_micro, col = cols, split = FALSE)

Below is the session info:

- Session info -----------------------------------------------------------------------------------------------
 setting  value
 version  R version 4.1.2 (2021-11-01)
 os       Windows 10 x64 (build 19044)
 system   x86_64, mingw32
 ui       RStudio
 language (EN)
 collate  English_United Kingdom.1252
 ctype    English_United Kingdom.1252
 tz       Europe/Paris
 date     2022-02-17
 rstudio  1.4.1106 Tiger Daylily (desktop)
 pandoc   NA
jokergoo commented 2 years ago

Please provide me the two objects pre_wide_micro and cols so that I can test.

spatz018 commented 2 years ago

Not sure if the issue has been solved. But today I ran into the same error. I struggled with the example provided when running

circos.heatmap(mat1, split = split, col = col_fun1)

Most hints on other websites fail. At the end I installed in R Studio BiocManager and run:

BiocManager::install("ComplexHeatmap")

In the following options asked during Installation I chose "Install these from source" "Yes" and for "... Updates ..." "a".

Afterwards, the error disappeared, luckily.

jokergoo commented 2 years ago

No it has not been solved yet. I cannot reproduce it on my laptop. I will wait until one day I can see this error.

shannjiang commented 1 year ago

I got the same issue. I can only resolve it by shutting down Rstudio or R session and start from scratch.

jokergoo commented 1 year ago

The function depends a cached value and it seems when a new heatmap is initialized, the cached value is not rest.

I made some changes in the package, hope this bug is solved.

MADscientist314 commented 1 year ago

I received the same error while trying to import a series of CPG beta values into granges and was able to resolve it by annotating chr in front of my chromosome numbers. Hope this helps!

prasathbalaji commented 1 year ago

I have been trying to make circular heatmap in R version 4.3.0 but I keep getting this error message even with the example code. How can this be resolved? Error in split.default(seq_len(nrow(mat)), split) : group length is 0 but data length > 0

ayeTown commented 4 months ago

^I also obtain the same error message. even with the examples.

woscience commented 2 months ago

Pls has this been fixed,?I am also having the same issue

jokergoo commented 2 months ago

Sorry everyone, I haven't touched the code and issues here for a long time.

@ayeTown @woscience let's try to make a reproducible example here. Can you run the following code? or where do you see the error in your code?

set.seed(123)
mat1 = rbind(cbind(matrix(rnorm(50*5, mean = 1), nr = 50), 
                   matrix(rnorm(50*5, mean = -1), nr = 50)),
             cbind(matrix(rnorm(50*5, mean = -1), nr = 50), 
                   matrix(rnorm(50*5, mean = 1), nr = 50))
            )
rownames(mat1) = paste0("R", 1:100)
colnames(mat1) = paste0("C", 1:10)
mat1 = mat1[sample(100, 100), ] # randomly permute rows
split = sample(letters[1:5], 100, replace = TRUE)
split = factor(split, levels = letters[1:5])

library(circlize)
circos.clear()

col_fun1 = colorRamp2(c(-2, 0, 2), c("blue", "white", "red"))
circos.heatmap(mat1, split = split, col = col_fun1)
woscience commented 2 months ago

@jokergoo Tk you, it‘s ok now, I just reduced the hyperparameters in circos.heatmap() ,it's amazing

ayeTown commented 1 month ago

I was able to fix my example. thanks for responding!