pegasus.select_features
- pegasus.select_features(data, features='highly_variable_features', standardize=True, max_value=10.0)[source]
Subset the features and store the resulting matrix in dense format in data.uns with ‘_tmp_fmat_’ prefix, with the option of standardization and truncating based on max_value. ‘_tmp_fmat_*’ will be removed before writing out the disk. :type data:
Union
[MultimodalData
,UnimodalData
] :param data: Annotated data matrix with rows for cells and columns for genes. :type data:pegasusio.MultimodalData
:type features:str
:param features: a keyword indata.var
, which refers to a boolean array. IfNone
, all features will be selected. :type features:str
, optional, default:highly_variable_features
. :type standardize:bool
:param standardize: Whether to scale the data to unit variance and zero mean. :type standardize:bool
, optional, default:True
. :type max_value:float
:param max_value: The threshold to truncate data after scaling. IfNone
, do not truncate. :type max_value:float
, optional, default:10
.- Return type
str
- Returns
keyword (
str
) – The keyword indata.uns
referring to the features selected.Update
data.uns
if needed –data.uns[keyword]
: A submatrix of the data containing features selected.
Examples
>>> pg.select_features(data)