business-science / anomalize

Tidy anomaly detection
https://business-science.github.io/anomalize/
338 stars 60 forks source link

MetaVolcanoR: Error: Error in FUN(X[[i]], ...) : object 'Regulation' not found #60

Open Tayyaba82 opened 3 years ago

Tayyaba82 commented 3 years ago

Hello, I have the following errors while using MetaVolcanoR Pacakge. Error 1:

meta_degs_vote <- votecountmv(diffexp=lst, pcriteria='pvalue', foldchangecol='log2FC', genenamecol='Symbol', geneidcol=NULL, pvalue=0.05, foldchange=0, metathr=0.01, collaps=FALSE, jobname="MetaVolcano", outputfolder=".", draw='HTML') Error in FUN(X[[i]], ...) : object 'Regulation' not found In addition: Warning message: Continuous limits supplied to discrete scale. Did you mean limits = factor(...) or `scale*_continuous()`?

Error 2:

meta_degs_rem <- rem_mv(diffexp=lst, pcriteria="pvalue", foldchangecol='log2FC', genenamecol='Symbol', geneidcol=NULL, collaps=FALSE, llcol='CI.L', rlcol='CI.R', vcol=NULL, cvar=TRUE, metathr=0.01, jobname="MetaVolcano", outputfolder=".", draw='HTML', ncores=1) index Symbol log2FC_1 CI.L_1 CI.R_1 vi_1 log2FC_2 CI.L_2 CI.R_2 vi_2 signcon ntimes randomSummary 1 25 7A5 10.38867 10.21447 10.56288 0.007899838 9.951994 9.803474 10.10051 0.005741962 2 2 10.16786 2 26 8-Mar 10.38867 10.21447 10.56288 0.007899838 9.951994 9.803474 10.10051 0.005741962 2 2 10.16786 3 28 9-Mar 10.38867 10.21447 10.56288 0.007899838 9.951994 9.803474 10.10051 0.005741962 2 2 10.16786 4 30 A1BG 10.38867 10.21447 10.56288 0.007899838 9.951994 9.803474 10.10051 0.005741962 2 2 10.16786 5 36 A26C1B 10.38867 10.21447 10.56288 0.007899838 9.951994 9.803474 10.10051 0.005741962 2 2 10.16786 6 50 AADACL1 10.38867 10.21447 10.56288 0.007899838 9.951994 9.803474 10.10051 0.005741962 2 2 10.16786 randomCi.lb randomCi.ub randomP het_QE het_QEp het_QM het_QMp error se rank 1 9.739952 10.59577 0 13.9783 0.0001849328 2168.947 0 FALSE 0.2183219 1 2 9.739952 10.59577 0 13.9783 0.0001849328 2168.947 0 FALSE 0.2183219 2 3 9.739952 10.59577 0 13.9783 0.0001849328 2168.947 0 FALSE 0.2183219 3 4 9.739952 10.59577 0 13.9783 0.0001849328 2168.947 0 FALSE 0.2183219 4 5 9.739952 10.59577 0 13.9783 0.0001849328 2168.947 0 FALSE 0.2183219 5 6 9.739952 10.59577 0 13.9783 0.0001849328 2168.947 0 FALSE 0.2183219 6 Error in validObject(.Object) : invalid class “MetaVolcano” object: invalid object for slot "inputnames" in class "MetaVolcano": got class "NULL", should be or extend class "character"

The data list used: head(lst) [[1]] Symbol log2FC pvalue CI.L CI.R 1 PRG2 9.821447 3.661549e-31 9.665207 9.977687 2 PTPRV 9.712034 4.291667e-31 9.556318 9.867750 3 A1BG 10.388674 1.064347e-30 10.214467 10.562881 4 A2M 9.760377 1.341346e-30 9.594825 9.925928 5 NAT1 8.521256 2.061779e-30 8.373620 8.668892 6 NAT2 8.711021 3.669413e-30 8.555737 8.866305 [[2]] Symbol log2FC pvalue CI.L CI.R 1 PRG2 9.463524 1.941380e-47 9.323093 9.603955 2 PTPRV 9.032391 2.149754e-47 8.897946 9.166836 3 A1BG 9.951994 2.345057e-47 9.803474 10.100515 4 A2M 10.724779 8.015122e-47 10.558701 10.890857 5 NAT1 9.541660 1.505059e-46 9.391078 9.692243 6 NAT2 10.023478 4.089614e-46 9.860465 10.186491

Judemt commented 2 years ago

Hi Tayyaba82, I could reproduce error 2 when each list in the 'lst' list object were NOT named. You must name them, e.g: lst=lst(data1=data1, data2=data2) I am not sure about error1, please check the format of your gene tables for formatting errors, these may be difficult to spot.

vinesh9727 commented 1 year ago

Hi Tayyaba82, I could reproduce error 2 when each list in the 'lst' list object were NOT named. You must name them, e.g: lst=lst(data1=data1, data2=data2) I am not sure about error1, please check the format of your gene tables for formatting errors, these may be difficult to spot.

Hello Judemt, can you please elaborate on how you solved this error?

Judemt commented 1 year ago

Hi vinesh9727,

Error2: I table the entire output from fit2 in limma using the 'topTable' function, with confint=T and add a column of gene symbols that must have the same column name for each data set.

The input for 'rem_mv' requires a list of the topTable data frames for each data set in the meta-analysis, and these list objects must be named, hence; ListDatasets=list(data1=topTable1, data2=topTable2, etc...add the additional data set data frames)

Error1:

I have not used the 'votecount_mv' function, it seems the Regulation object was not added to the parameters and continuous limits were supplied to input data with a discrete scale but please check the vignette for this.

Sometimes errors can arise if there is a formatting problem with the input data, for example a gene symbol may have a hyphen (-) instead of an underscore (_). This is just meant as an example, I can't remember the specifics but I have had errors due to a formatting problem in a data frame and once corrected that solved the problem. So the root cause can be cryptic occasionally.

I hope this helps, please message if you need further clarification.

vinesh9727 commented 1 year ago

Hi vinesh9727,

Error2: I table the entire output from fit2 in limma using the 'topTable' function, with confint=T and add a column of gene symbols that must have the same column name for each data set.

The input for 'rem_mv' requires a list of the topTable data frames for each data set in the meta-analysis, and these list objects must be named, hence; ListDatasets=list(data1=topTable1, data2=topTable2, etc...add the additional data set data frames)

Error1:

I have not used the 'votecount_mv' function, it seems the Regulation object was not added to the parameters and continuous limits were supplied to input data with a discrete scale but please check the vignette for this.

Sometimes errors can arise if there is a formatting problem with the input data, for example a gene symbol may have a hyphen (-) instead of an underscore (_). This is just meant as an example, I can't remember the specifics but I have had errors due to a formatting problem in a data frame and once corrected that solved the problem. So the root cause can be cryptic occasionally.

I hope this helps, please message if you need further clarification.

Hello Judemt, Thank you so much for the response. I did the same error and now after naming each object I was able to get the results. I have one more question if you can help me with it, I would be extremely grateful. I tried to plot a forest plot after this where it considers the FC of a particular gene across studies. I am attaching the script of the tutorial which I have tried. So I wanted to ask can I add the summary p-value of that particular gene in the forest plot as I am unable to do so. Link for the tutorial :- https://rdrr.io/bioc/MetaVolcanoR/f/vignettes/MetaVolcano.Rmd The command for the forest plot function :- draw_forest(remres=meta_degs_rem, gene="MMP9", genecol="Symbol", foldchangecol="Log2FC", llcol="CI.L", rlcol="CI.R", jobname="MetaVolcano", outputfolder=".", draw="HTML")