ehrapy.plot.pca_loadings#
- ehrapy.plot.pca_loadings(adata, components=None, include_lowest=True, show=None, save=None)[source]#
Rank features according to contributions to PCs.
- Parameters:
adata (
AnnData
) –AnnData
object object containing all observations.components (
Union
[str
,Sequence
[int
],None
]) – For example,'1,2,3'
means[1, 2, 3]
, first, second, third principal component.include_lowest (
bool
) – Whether to show the features with both highest and lowest loadings.save (
Union
[bool
,str
,None
]) – If True or a str, save the figure. A string is appended to the default filename. Infer the filetype if ending on {‘.pdf’, ‘.png’, ‘.svg’}.
- Returns:
If show==False a
Axes
or a list of it.
Examples
>>> import ehrapy as ep >>> adata = ep.data.mimic_2(encoded=True) >>> ep.pp.knn_impute(adata) >>> ep.pp.log_norm(adata, offset=1) >>> ep.pp.neighbors(adata) >>> ep.pp.pca(adata) >>> ep.pl.pca_loadings(adata, components='1,2,3')
- Preview: