get_ligand_target_links_oi: Get ligand-target links of interest

get_ligand_target_links_oiR Documentation

Description

Filter ligand-target links based on a cutoff

Usage

get_ligand_target_links_oi(ligand_type_indication_df, active_ligand_target_links_df, cutoff = 0.40)

Arguments

ligand_type_indication_df

Dataframe with column names ligand_type and ligand, from the function assign_ligands_to_celltype

active_ligand_target_links_df

Dataframe with weighted ligand-target links from the function get_ligand_target_links, and an additional column target_type that indicates the grouping of target genes

cutoff

Quantile to filter ligand-target links (default = 0.40, meaning 40% of the lowest weighted ligand-target links are removed)

Value

A dataframe with ligand-target links with weights above a certain cutoff. This dataframe also contains the attribute cutoff_include_all_ligands, which is the cutoff value of regulatory potential used at cutoff quantile.

Examples

## Not run: 
active_ligand_target_links_df <- lapply(best_upstream_ligands, get_weighted_ligand_target_links,
                                         geneset = geneset_oi,
                                         ligand_target_matrix = ligand_target_matrix,
                                         n = 200)
active_ligand_target_links_df <- drop_na(bind_rows(active_ligand_target_links_df))
ligand_type_indication_df <- assign_ligands_to_celltype(seuratObj = seuratObj, ligands = best_upstream_ligands[1:20])
circos_links <- get_ligand_target_links_oi(ligand_type_indication_df,
                                           active_ligand_target_links_df %>% mutate(target_type = "LCMV-DE"),
                                           cutoff = 0.40)
attr(circos_links, "cutoff_include_all_ligands") # This is the cutoff value of regulatory potential used

## End(Not run)


browaeysrobin/nichenetr documentation built on Sept. 9, 2024, 11:25 a.m.