Get ligand-target links of interest
Source:R/application_visualization.R
get_ligand_target_links_oi.RdFilter 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_typeandligand, from the functionassign_ligands_to_celltype- active_ligand_target_links_df
Dataframe with weighted ligand-target links from the function
get_ligand_target_links, and an additional columntarget_typethat 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
if (FALSE) { # \dontrun{
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
} # }