pairot.pp.filter_genes_ava

pairot.pp.filter_genes_ava#

pairot.pp.filter_genes_ava(de_res, logfc_threshold=1.0, aucroc_threshold=0.6, adj_pval_threshold=0.05, gene_filtering=True)#

Sort and filter DEGs for the AVA (all vs all) setting.

Sort differentially expressed genes (DEGs) by logFC and filter them based on logFC, AUROC, and adjusted p-value thresholds. Additionally, uninformative genes can be filtered out. This functions processes the DE results from the AVA (all vs. all) setting from pairot.pp.rank_genes_limma().

Parameters:
  • de_res (dict[str, dict[str, DataFrame]]) – AVA (all vs. all) DE results from pairot.pp.rank_genes_limma().

  • logfc_threshold (float (default: 1.0)) – Minimum logFC threshold to consider a gene as differentially expressed. Genes with a smaller logFC will be filtered out.

  • aucroc_threshold (float (default: 0.6)) – Minimum AUROC threshold. Genes with a smaller AUROC will be filtered out.

  • adj_pval_threshold (float (default: 0.05)) – Maximum adjusted p-value threshold to consider a gene as differentially expressed. Genes with a larger adjusted p-value will be filtered out.

  • gene_filtering (bool (default: True)) – If true, remove uninformative genes, e.g., mitochondrial, ribosomal, IncRNA, TCR and BCR genes.

Return type:

dict[str, dict[str, DataFrame]]

Returns:

top_de_genes_ava Dictionary containing the filtered and sorted (by logFC) DE results for each cluster pair.

Examples

>>> import pairot as pr
>>>
>>> de_res_ova, de_res_ava = pr.pp.rank_genes_limma(
>>>     adata,
>>>     cluster_label="cell_type_col",
>>>     sample_label="sample_col",
>>> )
>>> de_res_ava_sorted_and_filtered = pr.pp.filter_genes_ava(
>>>     de_res_ava,
>>>     logfc_threshold=1.0,
>>>     aucroc_threshold=0.6,
>>>     adj_pval_threshold=0.05,
>>>     gene_filtering=True,
>>> )
>>> de_res_ava_sorted_and_filtered