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

Remove obsm #29

Closed
chriscainx opened this issue Jun 7, 2018 · 5 comments
Closed

Remove obsm #29

chriscainx opened this issue Jun 7, 2018 · 5 comments

Comments

@chriscainx
Copy link

Hey guys,

What's the easiest way to remove a field in adata.obsm?
for example, I have

AnnData object with n_obs × n_vars = 48011 × 25583 
    obs: 'n_genes', 'n_counts', 'percent_mito', 'Sample', 'Donor', 'Tissue', 'batch', 'DCA_split', 'size_factors'
    var: 'gene_ids', 'n_counts'
    uns: 'DCA_losses'
    obsm: 'X_dca', 'X_dca_mean', 'X_dca_hidden', 'X_dca_dropout', 'X_dca_dispersion'

and I just want to remove the items in obsm to reduce memory consumption.

@flying-sheep
Copy link
Member

del adata.obsm['X_dca'] doesn’t work?

@falexwolf
Copy link
Member

I fear it doesn't work. We could add __delete__ using the previous implementation, which I removed at some point for some reason...

https://github.com/theislab/anndata/blob/d1f28b84780ab782c788772031ac019beaadf7eb/anndata/ann_data.py#L211-L219

If you have the bandwidth to do so, Phil, than go ahead... I'll be basically offline on holidays for the next week.

@flying-sheep
Copy link
Member

flying-sheep commented Aug 27, 2018

You deleted it in 9ae684e, because you changed everything there 😉

@falexwolf
Copy link
Member

Oh so great that you restored it @flying-sheep!

@falexwolf
Copy link
Member

Ah, and regarding the commit you linked, @flying-sheep; this is the commit where I moved from BoundRecArrays to DataFrames for .obs. Just a bit later I reintroduced a minimal version of BoundRecArray (without the "manual" index) for .obsm, so that multi-dimensional annotations would be restored.

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