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 #6

Closed MusculusMus closed 8 months ago

MusculusMus commented 8 months ago

Hi, My data went through the run_TrendCatcher step.

However, I came across the following error when I executed the draw_TimeHeatmap_GO. It seems a mistake due to the gene symbol and ENSEMBL. I tried to add different columns using the same gene symbol value, such as Symbol or SYMBOL.

Can you help me look at my data(master.list)? What's wrong with the gene name?

DG_master.list.rds.zip

Processing up-regulated genes for time window 2month-6month Processing up-regulated genes for time window 6month-8month Processing up-regulated pathways for time window 2month-6month --> No gene can be mapped.... --> Expected input gene ID: Paqr8,Prl8a1,Tssk5,Morn2,Mapk15,Ascl2 --> return NULL... Processing up-regulated pathways for time window 6month-8month --> No gene can be mapped.... --> Expected input gene ID: Piwil2,Prm1,Clgn,Cfap73,T,Mrm2 --> return NULL... Error in act.go.list[[i]] : subscript out of bounds

Shuai

wangxinge commented 8 months ago

Dear MusculusMus, thanks for using TrendCatcher! I just tried to run your data from my end and it went through with no error. Here is my function: ht<-draw_TimeHeatmap_GO(master.list = master.list)

and here is the output: Processing up-regulated genes for time window 2month-6month Processing up-regulated genes for time window 6month-8month Processing up-regulated pathways for time window 2month-6month Processing up-regulated pathways for time window 6month-8month Processing down-regulated genes for time window 2month-6month Processing down-regulated genes for time window 6month-8month Processing down-regulated pathways for time window 2month-6month Processing down-regulated pathways for time window 6month-8month

The error you see coming from the ClusterProfiler enrichment function embedded within TrendCatcher, this can be caused when you put the wrong species. If you are using mouse model, set OrgDb parameter to "org.Mm.eg.db", if human model, set it to "org.Hs.eg.db".

Please let me know if it helped to solve your question. If possible you can also send me the whole function with detailed parameters from your end.

MusculusMus commented 8 months ago

I repeat the draw_TimeHeatmap_GO(master.list = master.list) with the same data, and it works again without any gene ID or name issues.

ht <- TimeHeatmap_GO(master.list = DG.ls, logFC.thres = 0.2, top.n = 10, dyn.gene.p.thres = 0.05, ont = "BP", keyType = "SYMBOL", OrgDb = "org.Mm.eg.db", term.width = 50, GO.enrich.p = 0.05, figure.title = "DG TimeHeatmap") Processing up-regulated genes for time window 2month-6month Processing up-regulated genes for time window 6month-8month Processing up-regulated pathways for time window 2month-6month Processing up-regulated pathways for time window 6month-8month Processing down-regulated genes for time window 2month-6month Processing down-regulated genes for time window 6month-8month Processing down-regulated pathways for time window 2month-6month Processing down-regulated pathways for time window 6month-8month

I want to report another issue when I upgrade my R to 4.3:

ht <- draw_TimeHeatmap_GO(master.list = master.list) Error in is.na(t.arr) || is.na(t.unit) : 'length = 6' in coercion to 'logical(1)'

https://stackoverflow.com/questions/72848442/r-warning-lengthx-2-1-in-coercion-to-logical1/72848495#72848495 image

I customized the 'TimeHeatmap_GO' function and modified the following line.

if (is.na(t.arr[1]) || is.na(t.unit))

Shuai