dynamo.pp.filter_genes

dynamo.pp.filter_genes(adata, filter_bool=None, layer='all', min_cell_s=1, min_cell_u=1, min_cell_p=1, min_avg_exp_s=1e-10, min_avg_exp_u=0, min_avg_exp_p=0, max_avg_exp=inf, min_count_s=0, min_count_u=0, min_count_p=0, shared_count=30, inplace=False)

Basic filter of genes based a collection of expression filters.

Parameters
  • adata (AnnData) – an AnnData object.

  • filter_bool (Optional[ndarray]) – A boolean array from the user to select genes for downstream analysis. Defaults to None.

  • layer (str) – the data from a particular layer (include X) used for feature selection. Defaults to “all”.

  • min_cell_s (int) – minimal number of cells with expression for the data in the spliced layer (also used for X). Defaults to 1.

  • min_cell_u (int) – minimal number of cells with expression for the data in the unspliced layer. Defaults to 1.

  • min_cell_p (int) – minimal number of cells with expression for the data in the protein layer. Defaults to 1.

  • min_avg_exp_s (float) – minimal average expression across cells for the data in the spliced layer (also used for X). Defaults to 1e-10.

  • min_avg_exp_u (float) – minimal average expression across cells for the data in the unspliced layer. Defaults to 0.

  • min_avg_exp_p (float) – minimal average expression across cells for the data in the protein layer. Defaults to 0.

  • max_avg_exp (float) – maximal average expression across cells for the data in all layers (also used for X). Defaults to np.inf.

  • min_count_s (int) – minimal number of counts (UMI/expression) for the data in the spliced layer (also used for X). Defaults to 0.

  • min_count_u (int) – minimal number of counts (UMI/expression) for the data in the unspliced layer. Defaults to 0.

  • min_count_p (int) – minimal number of counts (UMI/expression) for the data in the protein layer. Defaults to 0.

  • shared_count (int) – the minimal shared number of counts for each genes across cell between layers. Defaults to 30.

  • inplace (bool) – whether to update the layer inplace. Defaults to False.

Return type

Union[AnnData, DataFrame]

Returns

An updated AnnData object with genes filtered if inplace is true. Otherwise, an array containing filtered genes.