Skip to contents

LIANA wrapper function

Usage

liana_wrap(
  sce,
  method = c("natmi", "connectome", "logfc", "sca", "cellphonedb"),
  resource = c("Consensus"),
  idents_col = NULL,
  external_resource,
  min_cells = 5,
  return_all = FALSE,
  supp_columns = NULL,
  verbose = TRUE,
  assay = NULL,
  .simplify = TRUE,
  cell.adj = NULL,
  base = NULL,
  ...
)

Arguments

sce

`SingleCellExperiment` object or `SeuratObject`

method

method(s) to be run via liana

resource

resource(s) to be used by the methods (`Consensus` by default), Use `all` to run all `human` resources in one go), or `custom` to run liana_wrap with an appropriately formatted custom resource, passed via `exernal_resource`

idents_col

the cell identities/labels to be used. By default set to NULL, and will used the active Idents or colLabels from the seurat_object or SCE, respectively.

external_resource

external resource in OmniPath tibble format

min_cells

minimum cell per cell identity to be considered for analysis

return_all

whether to return all possible interactions. Any interaction with `expr_prop` below the specific threshold will be assigned to the *worst* possible score in those that pass the threshold. For example, p-values from CellPhoneDB will be assigned to max(pvalue) - likely 1, and lr_means will be assigned to min(lr_means). Note that this applies only to the internal methods of liana.

supp_columns

any supplementary/additional columns which are to be returned by liana. Possibilities include: c("ligand.expr", "receptor.expr" "ligand.stat", "receptor.stat", "ligand.pval", "receptor.pval", "ligand.FDR", "receptor.FDR", etc)

verbose

logical whether to output messages and warnings (`TRUE` by default)

assay

assay to be used by Seurat, by default set to `NULL` and will use the DefaultAssay.

.simplify

if methods are run with only 1 resource, return a list of tibbles for each method (default), rather than a list of lists with method-resource combinations

cell.adj

cell adjacency tibble/dataframe /w weights by which we will `multiply` the relevant columns. Any cell pairs with a weights of 0 will be filtered out. Note that if working with LIANA's default methods, we suggest weights >= 0 & =< 1. This ensure that all methods' score will be meaningfully weighed without changing the interpretation of their scores, thus allow one to filter SCA, rank NATMI, etc.

base

Default to NULL (i.e. log2-transformation is assumed for SCE, and log-tranformation for Seurat). This is a requred step for the calculation of the logFC method - ensures that any other preprocessing of the counts is preserved. One could also pass `NaN` if they wish to use the counts stored in the counts assay/slot, or any other number according to the base that was used for log-tranformation.

...

Arguments passed on to liana_defaults

expr_prop

minimum proportion of gene expression per cell type (0.1 by default). Note that when working with complexes, the minimum subunit proportion will be used for filtering.

complex_policy

policy how to account for the presence of complexes.

seed

random seed integer

parallelize

whether to parallelize cellphonedb-like

workers

number of workers to be called

liana_pipe.params

list of Parameters passed to NATMI liana_pipe

liana_call.params

list of Parameters passed to NATMI liana_call

cellchat.params

list of Parameters passed to CellChat call_cellchat

squidpy.params

list of Parameters passed to Squidpy call_squidpy

call_connectome.params

list of Parameters passed to Connectome call_connectome

call_italk.params

list of Parameters passed to iTALK call_italk

call_natmi.params

list of Parameters passed to NATMI call_natmi

call_sca.params

list of Parameters passed to SingleCellSignalR call_sca

cellphonedb.params

list of Parameters passed to liana's internal cellphonedb implementation cellphonedb_score

natmi.params

list of Parameters passed to liana's internal edge_specificity implementation natmi_score

sca.params

list of Parameters passed to liana's internal LRScore implementation sca_score

connectome.params

list of Parameters passed to liana's internal connectome's weight_sc implementation connectome_score

cytotalk.params

list of Parameters passed to liana's internal crosstalk scores implementation cytotalk_score

logfc.params

list of Parameters passed to liana's internal logFC implementation logfc_score

permutation.params

list of parameters passed to permutation methods

assay.type

- the type of data to be used to calculate the means (logcounts by default), available options are: "counts" and "logcounts"

Value

A list of method-resource results - i.e. provided resources are run with each method If only one resource is selected, a single tibble (with results for that resource) will be returned for each of the selected methods

Details

LIANA wrapper method that can be used to call each method with a given set of intercellular resources from the OmniPath universe. Please see `liana_defaults()` for more information about the default parameters passed used by `liana_wrap`, if you wish to modify them.

Examples

liana_path <- system.file(package = "liana")
# load testdata
testdata <- readRDS(file.path(liana_path , "testdata", "input", "testdata.rds"))
# run only 2 methods from liana
liana_res <- liana_wrap(testdata, method = c('cellphonedb', 'sca'),
                        resource = 'Consensus', # default resource
                        # example run with *only* 2 permutations for cpdb
                        permutation.params = list(nperms = 2))
#> Expression from the `RNA` assay will be used
#> Running LIANA with `seurat_annotations` as labels!
#> Warning: 3465 genes and/or 0 cells were removed as they had no counts!
#> LIANA: LR summary stats calculated!
#> Now Running: Cellphonedb
#> Now Running: Sca