swiftcnv.get_gene_order

Contents

swiftcnv.get_gene_order#

get_gene_order(counts, genes, annotations, **kwargs)#

Build gene_order dataframe and filter matrix to the common genes.

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

  • genes (list-like) – Order of genes in counts (columns).

  • annotations (str or pandas.DataFrame) – Path to GTF or dataframe with gene annotations. If a path, it will be opened with read_gtf.

  • **kwargs (additional kwargs are passed to read_gtf.)

Returns:

Filtered count matrix and gene_order dataframe

Return type:

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