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

Why does .raw exist? #762

Closed
sjfleming opened this issue Apr 21, 2022 · 4 comments
Closed

Why does .raw exist? #762

sjfleming opened this issue Apr 21, 2022 · 4 comments
Labels

Comments

@sjfleming
Copy link

With the adata.layers construct being so useful, and potentially being unified with the adata.X construct (#706), I am wondering why adata.raw exists at all? Perhaps there is a great reason I just don't understand.

But it seems to me that raw data can (and should) be stored as a layer, maybe adata.layers['raw'] (up to the user). But all the annotations in adata.obs and adata.var still apply to .raw, and so why is there the need for adata.raw at all? I always wondered if it was kind of a legacy thing that would be deprecated after layers came around.

@LuckyMD
Copy link

LuckyMD commented Apr 21, 2022

Hey! adata.raw is matched on .obs, but not .var so you can store unfiltered data with all genes in there. It is somewhat legacy code, and there have been discussions about deprecating this... but I still quite like it ;).

@ivirshup
Copy link
Member

raw largely exists due to dense storage of X being prohibitive back when people centered, imputed, or used other densifying transforms their single cell expression data. This way you could just densify a smaller set of features, but keep the full expression around in raw.

Now we don't need to do that as much, and it was always a bit poorly supported.

But it seems to me that raw data can (and should) be stored as a layer, maybe adata.layers['raw']

Maybe something based on the "processing" fields from the FOM schema?

@sjfleming
Copy link
Author

Okay thanks very much! I guess having some way to store things with different numbers of features could be useful… and if people use it, then yeah. (I usually end up confusing myself when I use .raw, but I guess for someone like me, layers are perfect, and I can use that.) 😄

@sjfleming
Copy link
Author

Yes thanks for that link @ivirshup , that’s the kind of thing I like doing with layers.

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

No branches or pull requests

3 participants