swiftcnv.get_cell_order

Contents

swiftcnv.get_cell_order#

get_cell_order(df, counts, cell_names, column='reference', vals=None, sample_col=None, sep='\t')#

Build cell_order dataframe and filter matrix to the common cells.

Parameters:
  • df (str or pandas.DataFrame) – Dataframe to get cell names, reference status and sample values

  • counts (numpy.ndarray or scipy.sparse matrix) – Input matrix (cells x genes)

  • cell_names (list-like) – Cell names of counts (rows).

  • column (str) – column from df to get reference status.

  • vals (str or list) – Value(s) of column to consider a cell to be reference. Default treats column as boolean.

  • sample_col (str) – If defined, will be added to column ‘sample’

  • sep (str) – Column separator to read df from file.

Returns:

Filtered count matrix and cell_order dataframe

Return type:

tuple[(numpy.ndarray|scipy.sparse matrix), pandas.DataFrame]