jaleesr / TrendCatcher

TrendCatcher is an open source R-package that allows users to systematically analyze and visualize time course data. Please cite "Temporal transcriptomic analysis using TrendCatcher identifies early and persistent neutrophil activation in severe COVID-19" by Xinge Wang et al published in JCI Insight (2022) - https://insight.jci.org/articles/view/157255
9 stars 3 forks source link

draw_TimeHeatmap_GO function #10

Closed m03077yhtnt closed 7 months ago

m03077yhtnt commented 7 months ago

I performed the function of "draw_TimeHeatmap_GO function" using my own "master.list" data. The following error comes back; "Error in is.na(t.arr) || is.na(t.unit) : 'length = 4' in coercion to 'logical(1)'"

I also tried it using your demo.master.list as the follows. Then, I got the similar error message. I would be happy if you could let me know how to solve it.

demo.master.list.path<-system.file("extdata", "BrainMasterList_Symbol.rda", package = "TrendCatcher")
load(demo.master.list.path)
time_heatmap=draw_TimeHeatmap_GO(
  master.list,
  logFC.thres = 0,
  top.n = 10,
  dyn.gene.p.thres = 0.05,
  keyType = "SYMBOL",
  OrgDb = "org.Mm.eg.db",
  ont = "BP",
  term.width = 80,
  GO.enrich.p = 0.05,
  figure.title = "",
  save.tiff.path = NA,
  tiff.res = 100,
  tiff.width = 1500,
  tiff.height = 1500
)

Error in is.na(t.arr) || is.na(t.unit) :   'length = 6' in coercion to 'logical(1)'
wangxinge commented 7 months ago

Hi @m03077yhtnt , I don't have this error on my end. Please share your sessionInfo() with me. This error normally coming from the R version update, and when a if () statement includes a logical with length greater than one.

m03077yhtnt commented 7 months ago

Thank you very much for your swift response. My R version is 4.3.0.

> sessionInfo()
R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22621)

Matrix products: default
wangxinge commented 7 months ago

Hi @m03077yhtnt, thanks for pointing this out. Turns out R version 4.2.0 is doesn't have this issue. I added some code on the draw_TimeHeatmap_GO() and draw_TimeHeatmap_enrichR() to handle the version problem. You can update your R package and run it without issue.

m03077yhtnt commented 7 months ago

Thank you so much for your support. Thanks to your help, I have achieved the issue.