Closed nicolas-zimmermann closed 7 months ago
Hi @nicolas-zimmermann,
You got a ZeroDivisionError
, this means that when performing permutations to obtain the normalized score you sampled only zeros, try to increase the number of permutations, also maybe check that you have non-zero values in your input. Let me know how it goes.
Hi @PauBadiaM, Thank you for your reactivity ! Increasing the number of permutations (10 000 then 100 000) didn't had an effect. I have a few zero values in my input data, which is a pseudobulk obtained with the sum mode :
pdata = dc.get_pseudobulk(
adata,
sample_col='patient',
groups_col='condition.l1',
layer='counts',
mode='sum',
min_cells=20,
min_counts=300
)
What format of data does run_gsea exepect when given an AnnData object ? Best, Nicolas
Did you normalize your counts after pseudobulking? Maybe try that. It would also be good if you could share a small reproducible example so that I can debug it.
Yes I did normalize it after the pseudobulk. Also I ran gsva on the same input and it didn't returned me any error. For the example, where should I send you the data ?
Another thing you can try is to change the seed
parameter, maybe you are being very unlucky with the sampling. If you do not want to share it publicly you can send it to me via email at pau.badia {at} uni-heidelberg.de
Hi @nicolas-zimmermann ,
Thanks for sharing an example, I've localized where the error was coming from. In some cases, if there were a lot of 0s, a division by zero was happening and throwing the error. I've updated the code to handle this in 20764f09f5acfd85ee3bdb8414a30a552f1b53b6
You can update decoupler
and try again:
pip install --upgrade git+https://github.com/saezlab/decoupler-py.git
BTW, I saw that you had a remove_absent_genes
function, there is no need since decoupler
handles this already under the hood. Hope this is helpful! Let me know if it does not work.
Describe the bug Hello everyone, I tryed to execute the run_gsea() method doing the following :
dc.run_gsea(pdata, genesets, use_raw=False)
Doing so I obtain the following error message :
Expected behavior I do not understand the error, maybe the input I've given to the function is wrong ?
System I'm running this using a mamba environment on Ubuntu 20.04, my CPU is an Intel Xeon E5-2650 v2 and my softwares version are :
Thank you in advance for your time Best, Nicolas Zimmermann