singlet.dataset.feature_selection¶
-
class
singlet.dataset.feature_selection.FeatureSelection(dataset)[source]¶ Bases:
objectPlot gene expression and phenotype in single cells
-
expressed(n_samples, exp_min, inplace=False)[source]¶ Select features that are expressed in at least some samples.
Parameters: - n_samples (int) – Minimum number of samples the features should be expressed in.
- exp_min (float) – Minimum level of expression of the features.
- inplace (bool) – Whether to change the feature list in place.
Returns: pd.Index of selected features if not inplace, else None.
-
overdispersed_strata(bins=10, n_features_per_stratum=50, inplace=False)[source]¶ Select overdispersed features in strata of increasing expression.
Parameters: - bins (int or list) – Bin edges determining the strata. If this is a number, use that number of quantiles.
- n_features_per_stratum (int) – Number of features per stratum to select.
Returns: pd.Index of selected features if not inplace, else None.
Notice that the number of selected features may be smaller than expected if some strata have no dispersion (e.g. only dropouts). Because of this, it is recommended you restrict the counts to expressed features before using this function.
-