liana.resource.filter_reassemble_complexes#
- liana.resource.filter_reassemble_complexes(lr_res, _key_cols, complex_cols, expr_prop, return_all_lrs=False, complex_policy='min')#
Reassemble complexes from exploded long-format pandas Dataframe.
- Parameters:
lr_res (
DataFrame) – long-format pandas dataframe with exploded complex subunits_key_cols (
list[str]) – primary key for lr_res, typically a list with the following elements - [‘source’, ‘target’, ‘ligand_complex’, ‘receptor_complex’]expr_prop (
float) – Minimum expression proportion for the ligands and receptors (+ their subunits) in the corresponding cell identities. Set to 0 to return unfiltered results.return_all_lrs (
bool(default:False)) – Bool whether to return all ligand-receptor pairs, or only those that surpass theexpr_propthreshold. Ligand-receptor pairs that do not pass theexpr_propthreshold will be assigned to the worst score of the ones that do.Falseby default.complex_policy (
str(default:'min')) – approach by which the complexes are reassembled
- Return type:
DataFrame- Returns:
lr_res: a reduced long-format pandas dataframe