nichenet_ligand_activities {OmnipathR} | R Documentation

## Calls the NicheNet ligand activity analysis

### Description

Calls the NicheNet ligand activity analysis

### Usage

    nichenet_ligand_activities(
      ligand_target_matrix,
      lr_network,
      expressed_genes_transmitter,
      expressed_genes_receiver,
      genes_of_interest,
      background_genes = NULL,
      n_top_ligands = 42,
      n_top_targets = 250
    )

### Arguments

`ligand_target_matrix` | A matrix with rows and columns corresponding to ligands and targets, respectively. Produced by `nichenet_ligand_target_matrix` or `nichenetr::construct_ligand_target_matrix`.
`lr_network` | A data frame with ligand-receptor interactions, as produced by `nichenet_lr_network`.
`expressed_genes_transmitter` | Character vector with the gene symbols of the genes expressed in the cells transmitting the signal.
`expressed_genes_receiver` | Character vector with the gene symbols of the genes expressed in the cells receiving the signal.
`genes_of_interest` | Character vector with the gene symbols of the genes of interest. These are the genes in the receiver cell population that are potentially affected by ligands expressed by interacting cells (e.g. genes differentially expressed upon cell-cell interaction).
`background_genes` | Character vector with the gene symbols of the genes to be used as background.
`n_top_ligands` | How many of the top ligands to include in the ligand-target table.
`n_top_targets` | For each ligand, how many of the top targets to include in the ligand-target table.

### Value

A named list with 'ligand_activities' (a tibble giving several ligand activity scores; following columns in the tibble: $test_ligand, $auroc, $aupr and $pearson) and 'ligand_target_links' (a tibble with columns ligand, target and weight (i.e. regulatory potential score)).

### Examples

    networks <- nichenet_networks()
    expression <- nichenet_expression_data()
    optimization_results <- nichenet_optimization(networks, expression)
    nichenet_model <- nichenet_build_model(optimization_results, networks)
    lt_matrix <- nichenet_ligand_target_matrix(
        nichenet_model$weighted_networks,
        networks$lr_network,
        nichenet_model$optimized_parameters
    )
    ligand_activities <- nichenet_ligand_activities(
        ligand_target_matrix = lt_matrix,
        lr_network = networks$lr_network,
        # the rest of the parameters should come
        # from your transcriptomics data:
        expressed_genes_transmitter = expressed_genes_transmitter,
        expressed_genes_receiver = expressed_genes_receiver,
        genes_of_interest = genes_of_interest
    )

[Package OmnipathR version 3.0.0 Index]