NathanSkene / EWCE

Expression Weighted Celltype Enrichment. See the package website for up-to-date instructions on usage.
https://nathanskene.github.io/EWCE/index.html
53 stars 25 forks source link

generate_bootstrap_plots gives error "in check_ewce_genelist_inputs" #82

Closed SuMi300 closed 1 year ago

SuMi300 commented 1 year ago

Hi EWCE team,

I have been using EWCE package since 2019 and it has always worked well in my hands. However, since you made some of the latest changes, the function 'generate_bootstrap_plots' keep giving me this error: "Error in check_ewce_genelist_inputs(sct_data = sct_data, hits = hits, : At least four genes which are present in the single cell dataset & background gene set are required to test for enrichment."

When I use the sct_data, my background list and my list of hits as input for the bootstrap_enrichment_test it works, no errors But with the exact same parameters as input for generate_bootstrap_plots, it gives the error.

I can't seem to figure out where the issue is, but I guess somehow either the background or the ctd_data get modified during processing and don't have comparable gene names anymore. Maybe by this part of what happens in the package?: _Standardising sct_data. Converting to sparse matrix. Aligning celltype names with standardisectd format.

Hope you can point me to a solution! BW

Code example `load("CellTypeData_Hippocampus_Linnarsson_L1.rda")

bg.Eva.EV <- read_excel("data_in/DIA-NN_output_EVs_proteins_list_MGI.xlsx", sheet="R_input") hits.Eva.EV.TG.chABC.vs.WT.chABC.UP <- read_excel("data_in/new_significant_UP_chABC_TG(comparedtoWT)_MGI.xlsx", sheet="R_input")

res.Eva.EV.TG.chABC.vs.WT.chABC.UP.L1 <- bootstrap_enrichment_test(sct_data=ctd, hits=hits.Eva.EV.TG.chABC.vs.WT.chABC.UP$Genes_ONLYFIRST_MGI, annotLevel=1, bg=bg.Eva.EV$Genes_ONLYFIRST_MGI, genelistSpecies="mouse", sctSpecies="mouse", output_species = "mouse", reps=20000)

generate_bootstrap_plots(sct_data=ctd, hits=hits.Eva.EV.TG.chABC.vs.WT.chABC.UP$Genes_ONLYFIRST_MGI, bg=bg.Eva.EV$Genes_ONLYFIRST_MGI, annotLevel=1, genelistSpecies="mouse", sctSpecies="mouse", output_species = "mouse", reps=20000, full_results=res.Eva.EV.TG.chABC.vs.WT.chABC.UP.L1, listFileName="VignetteGraphs_TG_chABC_vsWT_UP_L1") `

bschilder commented 1 year ago

Hi @SuMi300, could you resubmit the issue by filling out a reproducible example using the bug template? (including all versioning info, and ideally with data included). https://github.com/NathanSkene/EWCE/issues/new?assignees=&labels=bug&projects=&template=bug_report.md&title=

We can't really assess the issue without that info.