View source: R/liana_wrapper.R
liana_wrap | R Documentation |
LIANA wrapper function
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,
...
)
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 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.
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
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.