Store raw version of .X and .var as .raw.X and .raw.var.

The .raw attribute is initialized with the current content of an object by setting:

adata.raw = adata

Its content can be deleted by setting it back to None:

adata.raw = None

Upon slicing an AnnData object along the observations (row) axis, .raw is also sliced. Slicing an AnnData object along the variables (columns) axis, leaves .raw unaffected. Note that you can call:

adata.raw[:, 'orig_variable_name'].X

to retrieve the data associated with a variable that might have been filtered out or “compressed away” in .X.