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 ‘fmat_’ prefix, with the option of standardization and truncating based on max_value. ‘fmat_*’ will be removed before writing out the disk.

Parameters
  • data (pegasusio.MultimodalData) – Annotated data matrix with rows for cells and columns for genes.

  • features (str, optional, default: None.) – a keyword in data.var, which refers to a boolean array. If None, all features will be selected.

  • standardize (bool, optional, default: True.) – Whether to scale the data to unit variance and zero mean.

  • max_value (float, optional, default: 10.) – The threshold to truncate data after scaling. If None, do not truncate.

Return type

str

Returns

  • keyword (str) – The keyword in data.uns referring to the features selected.

  • Update data.uns

    • data.uns[keyword]: A submatrix of the data containing features selected.

Examples

>>> pg.select_features(data)