get_sample_covariates#

SingleCell.get_sample_covariates(*, ID_column, QC_column='passed_QC')[source]#

Get a DataFrame of sample-level covariates, i.e. the columns of obs that are the same for all cells within each sample.

Parameters:
  • ID_column: SingleCellColumn

    a String, Enum, Categorical, or integer column of obs containing sample IDs. Can be a column name, a polars expression, a polars Series, a 1D NumPy array, or a function that takes in this SingleCell dataset and returns a polars Series or 1D NumPy array.

  • QC_column: SingleCellColumn | None

    an optional Boolean column of obs indicating which cells passed QC. Can be a column name, a polars expression, a polars Series, a 1D NumPy array, or a function that takes in this SingleCell dataset and returns a polars Series or 1D NumPy array. Set to None to include all cells. Cells failing QC will be ignored.

Returns:

A DataFrame of the sample-level covariates, with ID_column (sorted) as the first column.

Return type:

DataFrame