dynamo.pp.filter_genes_by_pattern

dynamo.pp.filter_genes_by_pattern(adata, patterns=('MT-', 'RPS', 'RPL', 'MRPS', 'MRPL', 'ERCC-'), drop_genes=False)[source]

Utility function to filter mitochondria, ribsome protein and ERCC spike-in genes, etc.

Parameters
  • adata (AnnData) – an AnnData object.

  • patterns (Tuple[str]) – the patterns used to filter genes. Defaults to (“MT-”, “RPS”, “RPL”, “MRPS”, “MRPL”, “ERCC-“).

  • drop_genes (bool) – whether inplace drop the genes from the AnnData object. Defaults to False.

Return type

Optional[List[bool]]

Returns

A list of indices of matched genes if drop_genes is False. Otherwise, returns none.