broadinstitute / wot

A software package for analyzing snapshots of developmental processes
https://broadinstitute.github.io/wot/
BSD 3-Clause "New" or "Revised" License
140 stars 34 forks source link

diff_exp not working after updating wot #72

Open rosshandler opened 5 years ago

rosshandler commented 5 years ago

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 commented 5 years ago

What version of anndata do you have? Thanks.

On Thu, Oct 24, 2019 at 3:18 PM rosshandler notifications@github.com wrote:

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.

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 correspond 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.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/broadinstitute/wot/issues/72?email_source=notifications&email_token=ABH6TH4FGVYLME6I47VSLSDQQHYIPA5CNFSM4JEZBOK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HUGQR7A, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH6TH7XKOLP4TEOD5EB62DQQHYIPANCNFSM4JEZBOKQ .

rosshandler commented 5 years ago

print(anndata.version) 0.6.22.post1

Thank you.

joshua-gould commented 5 years ago

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 commented 5 years ago

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

Thanks so much for the quick reply!

joshua-gould commented 5 years ago

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 commented 5 years ago

See https://github.com/theislab/anndata/issues/239

rosshandler commented 5 years ago

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

I appreciate the quick fix.

alyosama commented 4 years ago

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 commented 4 years ago

Please add compare='all' to diff_exp:

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