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

Warn if AnnDataWrapper options are empty as it would result in empty list for vc['datasets']['files'] #356

Open
falexwolf opened this issue Aug 7, 2024 · 4 comments

Comments

@falexwolf
Copy link

falexwolf commented Aug 7, 2024

I didn't find a unit test for this, but I found a notebook in the repo:

image

When I run it and look at the dict I get an empty list for the files key under datasets.

image

I might be wrong, but I'm pretty sure this wasn't empty a few months ago. I tried to understand whether something might have changed, upgraded and downgraded vitessce to the latest and older versions, and played with different environments.

Before I continue debugging: Is 'files' supposed to be populated with the storage path? And if not, where did the storage path go?

Complete json

{'version': '1.0.15',
 'name': 'Test dataset',
 'description': 'Test description',
 'datasets': [{'uid': 'A', 'name': 'test1', 'files': []}],
 'coordinationSpace': {'dataset': {'A': 'A'}, 'embeddingType': {'A': 'UMAP'}},
 'layout': [{'component': 'obsSets',
   'coordinationScopes': {'dataset': 'A'},
   'x': 3.0,
   'y': 0.0,
   'w': 3.0,
   'h': 6.0},
  {'component': 'obsSetSizes',
   'coordinationScopes': {'dataset': 'A'},
   'x': 6.0,
   'y': 0.0,
   'w': 6.0,
   'h': 6.0},
  {'component': 'scatterplot',
   'coordinationScopes': {'dataset': 'A', 'embeddingType': 'A'},
   'x': 0.0,
   'y': 0.0,
   'w': 3.0,
   'h': 6.0},
  {'component': 'heatmap',
   'coordinationScopes': {'dataset': 'A'},
   'x': 0.0,
   'y': 6.0,
   'w': 6.0,
   'h': 6.0},
  {'component': 'featureList',
   'coordinationScopes': {'dataset': 'A'},
   'x': 6.0,
   'y': 6.0,
   'w': 6.0,
   'h': 6.0}],
 'initStrategy': 'auto'}

Context: I ran into this working on the below

@keller-mark
Copy link
Member

keller-mark commented Aug 7, 2024

This if statement may be the issue

if len(options.keys()) > 0:
- it only appends the file if there is at least one option specified. This restriction is not exactly necessary but in most cases Vitessce needs more details about keys/paths within the AnnData object to load data

I have started a pull request here #357 with a test

@falexwolf
Copy link
Author

Oh, thanks! That would make sense! I also have an integration test that populated paths. Will try it.

@falexwolf
Copy link
Author

Yes, this was it! As soon as I add another parameter, it's back:
image

Could you print a warning if there is no additional parameter? It was hard for me to find out what's going on as the function was so silent. Otherwise, feel free to close this issue.

@keller-mark
Copy link
Member

Ah that is a good idea, I will update the title

@keller-mark keller-mark changed the title Empty list for vc['datasets']['files'] Warn if AnnDataWrapper options are empty as it would result in empty list for vc['datasets']['files'] Aug 7, 2024
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

2 participants