Skip to content

Conversation

@sgratiy
Copy link
Contributor

@sgratiy sgratiy commented Jul 23, 2021

Problem:
View of backed data does not allow adding annotations.
For example something like this would work for AnnData and View of AnnData in memory:
normalized_adata.uns['hvg']={"flavour":"hicat"}
but this fails for a View of backed data

Solution:
Explain users how to use AnnData when working with the subset of backed data by adding to the notebook the following:

# if wanting to work with a subset of data in backed mode (here choosing the first 1000 cells):
normalized_adata = normalized_adata[:1000,:].copy(filename='./data/normalized_subset.h5ad')
print(normalized_adata)

apparently this is by design. See the very end of the anndata blog post.
Validation:
HVG on a subset done this way does not fail:
image

Note:
if we follow this route, we should also add nice exception message if users do pass View to functions. Not sure how many modules are affected by this.

@sgratiy sgratiy requested review from JakeSAI and MatthewAitken July 23, 2021 23:32
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

Successfully merging this pull request may close these issues.

2 participants