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
dfto get reference status.vals (str or list) – Value(s) of
columnto consider a cell to be reference. Default treatscolumnas boolean.sample_col (str) – If defined, will be added to column ‘sample’
sep (str) – Column separator to read
dffrom file.
- Returns:
Filtered count matrix and cell_order dataframe
- Return type:
tuple[(numpy.ndarray|scipy.sparse matrix), pandas.DataFrame]