commot.pp.filter_lr_database
- commot.pp.filter_lr_database(df_ligrec, adata, heteromeric=True, heteromeric_delimiter='_', heteromeric_rule='min', filter_criteria='min_cell_pct', min_cell=100, min_cell_pct=0.05)
Filter ligand-receptor pairs.
- Parameters
df_ligrec (
DataFrame
) – The pandas dataframe of ligand-receptor database with three columns being ligand, receptor, and pathway name respectively.adata (
AnnData
) – The AnnData object of gene expression. Unscaled data (minimum being zero) is expected.heteromeric (
bool
) – Whether the ligands and receptors are described as heteromeric.heteromeric_delimiter (
str
) – If heteromeric notations are used for ligands and receptors, the character separating the heteromeric units.heteromeric_rule (
str
) – When heteromeric is True, the rule to quantify the level of a heteromeric ligand or receptor. Choose from mimnimum (‘min’) and average (‘ave’).filter_criteria (
str
) – Use either cell percentage (‘min_cell_pct’) or cell numbers (min_cell) to filter genes.min_cell (
int
) – If filter_criteria is ‘min_cell’, the LR-pairs with both ligand and receptor detected in greater than or equal to min_cell cells are kept.min_cell_pct (
float
) – If filter_criteria is ‘min_cell_pct’, the LR-pairs with both ligand and receptor detected in greater than or equal to min_cell_pct percentage of cells are kepts.
- Returns
df_ligrec_filtered – A pandas DataFrame of the filtered ligand-receptor pairs.
- Return type
pd.DataFrame