Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diff_exp not working after updating wot #72

Open
rosshandler opened this issue Oct 24, 2019 · 9 comments
Open

diff_exp not working after updating wot #72

rosshandler opened this issue Oct 24, 2019 · 9 comments

Comments

@rosshandler
Copy link

rosshandler commented Oct 24, 2019

Hi WOT developers,

I am experiencing some problems with diff_exp after updating wot. I am able to compute the transport maps and the fates matrices but I now get an error regarding data dimensions that I think is related to changes in the anndata object but I just don't know how to fix it.

The error message is:

9 days
BP1 vs BP2, day 6.5, day 6.5
Trying to set attribute .X of view, making a copy.
Traceback (most recent call last):
File "/homes/iimaz/miniconda3/bin/wot", line 8, in
sys.exit(main())
File "/homes/iimaz/miniconda3/lib/python3.6/site-packages/wot/main.py", line 23, in main
cmd.main(args)
File "/homes/iimaz/miniconda3/lib/python3.6/site-packages/wot/commands/diff_exp.py", line 71, in main
compare=compare, delta_days=delta_days)
File "/homes/iimaz/miniconda3/lib/python3.6/site-packages/wot/tmap/diff_exp.py", line 77, in diff_exp
features=features)
File "/homes/iimaz/miniconda3/lib/python3.6/site-packages/wot/tmap/diff_exp.py", line 114, in __do_comparison
scores[np.isnan(scores)] = 0
File "/homes/iimaz/miniconda3/lib/python3.6/site-packages/anndata/core/views.py", line 29, in setitem
container[idx] = value
IndexError: boolean index did not match indexed array along dimension 0; dimension is 2661 but corresponding boolean dimension is 5469

The number 5469 corresponds to the number of genes in my matrix but I have no idea what is the 2661 number. I tried different gene sets and the same error is produced.

Do you have any clue about what might be happening? is the latest version of anndata likely the problem?

Is there any other information I could share with you to help you to figure out this issue?

Many thanks,
Ivan

PS. I am really happy with this tool. It has helped me a lot in my project.

@joshua-gould
Copy link
Contributor

joshua-gould commented Oct 25, 2019 via email

@rosshandler
Copy link
Author

print(anndata.version)
0.6.22.post1

Thank you.

@joshua-gould
Copy link
Contributor

I'm unable to reproduce an error with my data. Can you please send me your command line and all files used in the command to wot at broadinstitute.org?

@rosshandler
Copy link
Author

Sure. I will send it to your broad email as soon as possible.

Thanks so much for the quick reply!

@joshua-gould
Copy link
Contributor

I fixed the issue which was indeed an issue with anndata. It seems we've found a bug with indexing anndata.core.views.ArrayView. I will try to make a reproducible example of the bug for the anndata team.

@joshua-gould
Copy link
Contributor

See scverse/anndata#239

@rosshandler
Copy link
Author

Thanks! I just ran the code with the corresponding patch and worked fine.

I appreciate the quick fix.

@alyosama
Copy link

Hi @joshua-gould ,

I had the same error but it was fixed when I updated wot installation and I got a new error.
The below code returns a NoneType object. I checked adata and fate_ds and they are okay so it might be a problem in diff_exp function.

# Find differentially expressed genes at day 14 
day14 = wot.tmap.diff_exp(adata[adata.obs['day']==14], fate_ds)

@joshua-gould
Copy link
Contributor

Please add compare='all' to diff_exp:

day14 = wot.tmap.diff_exp(adata[adata.obs['day']==14], fate_ds, compare='all')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants