nichenet_seuratobj_aggregate: Perform NicheNet analysis on Seurat object: explain DE...

View source: R/application_prediction.R

nichenet_seuratobj_aggregateR Documentation

Perform NicheNet analysis on Seurat object: explain DE between conditions

Description

nichenet_seuratobj_aggregate Perform NicheNet analysis on Seurat object: explain differential expression (DE) in a receiver celltype between two different conditions by ligands expressed by sender cells

Usage

nichenet_seuratobj_aggregate(
  receiver,
  seurat_obj,
  condition_colname,
  condition_oi,
  condition_reference,
  sender = "all",
  ligand_target_matrix,
  lr_network,
  weighted_networks,
  assay_oi = NULL,
  expression_pct = 0.1,
  lfc_cutoff = 0.25,
  geneset = "DE",
  filter_top_ligands = TRUE,
  top_n_ligands = 30,
  top_n_targets = 200,
  cutoff_visualization = 0.33,
  verbose = TRUE
)

Arguments

receiver

Name of cluster identity/identities of cells that are presumably affected by intercellular communication with other cells

seurat_obj

Single-cell expression dataset as Seurat object https://satijalab.org/seurat/.

condition_colname

Name of the column in the meta data dataframe that indicates which condition/sample cells were coming from.

condition_oi

Condition of interest in which receiver cells were presumably affected by other cells. Should be a name present in the 'condition_colname' column of the metadata.

condition_reference

The second condition (e.g. reference or steady-state condition). Should be a name present in the 'condition_colname' column of the metadata.

sender

Determine the potential sender cells. Name of cluster identity/identities of cells that presumably affect expression in the receiver cell type. In case you want to look at all possible sender cell types in the data, you can give this argument the value "all". "all" indicates thus that all cell types in the dataset will be considered as possible sender cells. As final option, you could give this argument the value "undefined"."undefined" won't look at ligands expressed by sender cells, but at all ligands for which a corresponding receptor is expressed. This could be useful if the presumably active sender cell is not profiled. Default: "all".

ligand_target_matrix

The NicheNet ligand-target matrix of the organism of interest denoting regulatory potential scores between ligands and targets (ligands in columns).

lr_network

The ligand-receptor network (columns that should be present: $from, $to) of the organism of interest.

weighted_networks

The NicheNet weighted networks of the organism of interest denoting interactions and their weights/confidences in the ligand-signaling and gene regulatory network.

assay_oi

The assay to be used for calculating expressed genes and the DE analysis. If NULL, the default assay of the Seurat object will be used.

expression_pct

To determine ligands and receptors expressed by sender and receiver cells, we consider genes expressed if they are expressed in at least a specific fraction of cells of a cluster. This number indicates this fraction. Default: 0.10

lfc_cutoff

Cutoff on log fold change in the wilcoxon differential expression test. Default: 0.25.

geneset

Indicate whether to consider all DE genes between condition 1 and 2 ("DE"), or only genes upregulated in condition 1 ("up"), or only genes downregulad in condition 1 ("down").

filter_top_ligands

Indicate whether output tables for ligand-target and ligand-receptor networks should be done for a filtered set of top ligands (TRUE) or for all ligands (FALSE). Default: TRUE.

top_n_ligands

Indicate how many ligands should be extracted as top-ligands after ligand activity analysis. Only for these ligands, target genes and receptors will be returned. Default: 30.

top_n_targets

To predict active, affected targets of the prioritized ligands, consider only DE genes if they also belong to the a priori top n ("top_n_targets") targets of a ligand. Default = 200.

cutoff_visualization

Because almost no ligand-target scores have a regulatory potential score of 0, we clarify the heatmap visualization by giving the links with the lowest scores a score of 0. The cutoff_visualization paramter indicates this fraction of links that are given a score of zero. Default = 0.33.

verbose

Print out the current analysis stage. Default: TRUE.

Value

A list with the following elements: $ligand_activities: data frame with output ligand activity analysis; $top_ligands: top_n ligands based on ligand activity; $top_targets: active, affected target genes of these ligands; $top_receptors: receptors of these ligands; $ligand_target_matrix: matrix indicating regulatory potential scores between active ligands and their predicted targets; $ligand_target_heatmap: heatmap of ligand-target regulatory potential; $ligand_target_df: data frame showing regulatory potential scores of predicted active ligand-target network; $ligand_activity_target_heatmap: heatmap showing both ligand activity scores and target genes of these top ligands; $ligand_expression_dotplot: expression dotplot of the top ligands; $ligand_differential_expression_heatmap = differential expression heatmap of the top ligands; $ligand_receptor_matrix: matrix of ligand-receptor interactions; $ligand_receptor_heatmap: heatmap showing ligand-receptor interactions; $ligand_receptor_df: data frame of ligand-receptor interactions; $geneset_oi: a vector containing the set of genes used as input for the ligand activity analysis; $background_expressed_genes: the background of genes to which the geneset will be compared in the ligand activity analysis.

Examples

## Not run: 
seuratObj = readRDS(url("https://zenodo.org/record/3531889/files/seuratObj_test.rds"))
lr_network = readRDS(url("https://zenodo.org/record/7074291/files/lr_network_mouse_21122021.rds"))
ligand_target_matrix = readRDS(url("https://zenodo.org/record/7074291/files/ligand_target_matrix_nsga2r_final_mouse.rds"))
weighted_networks = readRDS(url("https://zenodo.org/record/7074291/files/weighted_networks_nsga2r_final_mouse.rds"))
nichenet_seuratobj_aggregate(receiver = "CD8 T", seurat_obj = seuratObj, condition_colname = "aggregate", condition_oi = "LCMV", condition_reference = "SS", sender = "Mono", ligand_target_matrix = ligand_target_matrix, lr_network = lr_network, weighted_networks = weighted_networks)

## End(Not run)


saeyslab/nichenetr documentation built on March 26, 2024, 9:22 a.m.