anndata.AnnData.layers

AnnData.layers

Dictionary-like object with values of the same dimensions as X.

Layers in AnnData have API similar to loompy Layers. Return the layer named "unspliced":

adata.layers["unspliced"]

Create or replace the "spliced" layer:

adata.layers["spliced"] = ...

Assign the 10th column of layer "spliced" to the variable a:

a = adata.layers["spliced"][:, 10]

Delete the "spliced" layer:

del adata.layers["spliced"]

Return layers’ names:

adata.layers.keys()

Warning

If AnnData is a view, setting subsets of layers modifies the original data.

Return type:LayersBaseLayersBase