| Title: | LIANA: a LIgand-receptor ANalysis frAmework |
|---|---|
| Description: | LIANA provides a number of methods and resources for ligand-receptor interaction inference from scRNA-seq data. This version is specifically designed for Seurat v4 and SeuratObject v4 compatibility. It includes improved Python environment handling and better integration with existing workflows. |
| Authors: | Zaoqu Liu [cre, ctb] (ORCID: <https://orcid.org/0000-0002-0452-742X>), Daniel Dimitrov [aut] (ORCID: <https://orcid.org/0000-0002-5197-2112>), Charlotte Boys [aut] (ORCID: <https://orcid.org/0000-0003-3955-5110>), Martin Garrido Rodriguez [aut] (ORCID: <https://orcid.org/0000-0003-4125-5643>), Denes Turei [aut] (ORCID: <https://orcid.org/0000-0002-7249-9379>), James Nagai [aut] (ORCID: <https://orcid.org/0000-0002-7655-7206>) |
| Maintainer: | Zaoqu Liu <[email protected]> |
| License: | GPL-3 + file LICENSE |
| Version: | 0.1.14.9000 |
| Built: | 2026-05-30 09:17:02 UTC |
| Source: | https://github.com/Zaoqu-Liu/liana |
Helper function to assign weights
assign_lr_weights(lrs, resource, entity = "ligand")assign_lr_weights(lrs, resource, entity = "ligand")
lrs |
ligand_receptor tibble |
resource |
resource |
entity |
name of the entity |
Run CellChat with OmniPath function [[DEPRECATED]]
call_cellchat( sce, op_resource, .format = TRUE, exclude_anns = c(), nboot = 100, assay = "RNA", .seed = 1004, .normalize = FALSE, .do_parallel = FALSE, .raw_use = TRUE, expr_prop = 0, organism = "human", thresh = 1, de_thresh = 0.05, ... )call_cellchat( sce, op_resource, .format = TRUE, exclude_anns = c(), nboot = 100, assay = "RNA", .seed = 1004, .normalize = FALSE, .do_parallel = FALSE, .raw_use = TRUE, expr_prop = 0, organism = "human", thresh = 1, de_thresh = 0.05, ... )
sce |
Seurat object as input |
op_resource |
OmniPath Intercell Resource DN |
.format |
bool whether to format output |
exclude_anns |
Annotation criteria to be excluded |
nboot |
number of bootstraps to calculate p-value |
assay |
assay name (RNA by default) |
.seed |
random seed |
.normalize |
# bool whether to normalize non-normalized data with |
.do_parallel |
whether to parallelize or not |
.raw_use |
whether use the raw data or gene expression data projectected to a ppi (should be kept to TRUE) |
expr_prop |
minimum proportion of gene expression per cell type (0 by default), yet perhaps one should consider setting this to an appropriate value between 0 and 1, as an assumptions of these method is that communication is coordinated at the cluster level. |
organism |
Obtain CellChatDB for which organism ('mouse' or 'human') |
thresh |
p-value threshold (1 by default) |
de_thresh |
diff expression of genes p-value |
... |
Arguments passed on to
|
CellChat's objects are not lazily documented/exported thus the whole package has to be imported.
A DF of intercellular communication network
Function to call connectome with databases from OmniPath [[DEPRECATED]]
call_connectome(sce, op_resource = NULL, .format = TRUE, assay, ...)call_connectome(sce, op_resource = NULL, .format = TRUE, assay, ...)
sce |
Seurat object as input |
op_resource |
OmniPath Intercell Resource DN |
.format |
bool whether to format output |
assay |
assay name |
... |
dot params passed to connectome |
Stats: 1) The ‘weight_norm’ edge attribute is derived from the normalized expression of the ligand and the receptor in the single-cell data. 2) The ‘weight_scale’ edge attribute is derived from the z-scores of the ligand and the receptor in each edge, and is of higher value when the ligand and receptor are more specific to a given pair of cell types 3) DEG p-values for L and R
An unfiltered connectome results df
Run iTALK with OmniPath data [[DEPRECATED]]
call_italk(sce, op_resource, assay = "RNA", .format = TRUE, ...)call_italk(sce, op_resource, assay = "RNA", .format = TRUE, ...)
sce |
Seurat object or SingleCellExperiment as input |
op_resource |
OmniPath Intercell Resource DN |
assay |
assay to use from Seurat object |
.format |
bool: whether to format output |
... |
Parameters passed to Seurat FindMarkers (ref requires import) |
In order to be comparable with the remainder of the methods, we calculate the mean of the ligand and receptor logFC. The original implementation only uses the DE genes above a certain logFC threshold.
An unfiltered iTALK df sorted by relevance
In this case, we use the product of the logFC rather than thresholding, as in the original implementation.
Call NATMI Pipeline from R with Resources Querried from OmniPath [[DEPRECATED]]
call_natmi( sce, op_resource, expr_file = "em.csv", meta_file = "metadata.csv", output_dir = "NATMI_test", reso_name = "placeholder", assay = "RNA", num_cor = 4, conda_env = NULL, assay.type = "logcounts", .format = TRUE, .overwrite_data = TRUE, .seed = 1004, .natmi_path = NULL, .delete_input_output = FALSE, layer = NULL )call_natmi( sce, op_resource, expr_file = "em.csv", meta_file = "metadata.csv", output_dir = "NATMI_test", reso_name = "placeholder", assay = "RNA", num_cor = 4, conda_env = NULL, assay.type = "logcounts", .format = TRUE, .overwrite_data = TRUE, .seed = 1004, .natmi_path = NULL, .delete_input_output = FALSE, layer = NULL )
sce |
Seurat or SingleCellExperiment object |
op_resource |
List of OmniPath resources |
expr_file |
expression matrix file name |
meta_file |
annotations (i.e. clusters) file name |
output_dir |
NATMI output directory |
reso_name |
name of the resource usually in the format list(name = op_resource) |
assay |
Seurat assay to be used |
num_cor |
number of cores to be used |
conda_env |
name of the conda environment via which NATMI is called |
assay.type |
logcounts by default, but it's converted back into counts as suggested by the authors |
.format |
bool whether to format output |
.overwrite_data |
bool whether Extract and overwrite csv with data from Seurat Object |
.seed |
random seed |
.natmi_path |
path of NATMI code and dbs (by default set to liana path) |
.delete_input_output |
logical whether to delete input and output after run. |
This function will save NATMI dbs folder, then it will call the NATMI Python from the NATMI dir and save the output into a specified directory in NATMI's path. It will then load the csvs and format the output to a list of lists.
By default, NATMI's path is set to that of LIANA, but any alternative path can be passed
============================================================================== NATMI Arguments: –interDB INTERDB lrc2p (default) has literature supported ligand-receptor pairs | lrc2a has putative and literature supported ligand-receptor pairs | the user-supplied interaction database can also be used by calling the name of database file without extension –interSpecies INTERSPECIES human (default) | mouse | expandp | expanda –emFile EMFILE the path to the normalised expression matrix file with row names (gene identifiers) and column names (cell-type/single-cell identifiers) –annFile ANNFILE the path to the metafile in which column one has single-cell identifiers and column two has corresponding cluster IDs (see file 'toy.sc.ann.txt' as an example) –species SPECIES human (default) | mouse | rat | zebrafish | fruitfly | chimpanzee | dog | monkey | cattle | chicken | frog | mosquito | nematode | thalecress | rice | riceblastfungus | bakeryeast | neurosporacrassa | fissionyeast | eremotheciumgossypii | kluyveromyceslactis, 21 species are supported –idType IDTYPE symbol (default) | entrez(https://www.ncbi.nlm.nih.gov/gene) | ensembl(https://www.ensembl.org/) | uniprot(https://www.uniprot.org/) | hgnc(https://www.genenames.org/) | mgi(http://www.informatics.jax.org/mgihome/nomen/index.shtml) | custom(gene identifier used in the expression matrix) –coreNum CORENUM the number of CPU cores used, default is one –out OUT the path to save the analysis results (Taken From NATMI's GitHub Page)
Stats: 1) The mean-expression edge weights 2) The specificity-based edge weights * a weight of 1 means both the ligand and receptor are only expressed in one cell type
Note that 'call_natmi' will write the expression matrix to CSV each time its called, unless .overwrite_data is set to FALSE! This can be an extremely time consuming step when working with large datasets
Also, NATMI will sometimes create duplicate files, so please consider saving each run in a new folder. An easy fix would be to simply delete the output, but I am reluctant to automatically delete files via an R script.
DF with NATMI results
Function to call SingleCellSignalR with databases from OmniPath [[DEPRECATED]]
call_sca( sce, op_resource, .format = TRUE, assay = "RNA", assay.type = "logcounts", layer = NULL, ... )call_sca( sce, op_resource, .format = TRUE, assay = "RNA", assay.type = "logcounts", layer = NULL, ... )
sce |
SingleCellExperiment or SeuratObject as input |
op_resource |
OmniPath Intercell Resource DN |
.format |
bool whether to format output |
assay |
Seurat assay data to use |
assay.type |
count slot (logcounts by default) |
... |
arguments passed to 'SCAomni::cell_signaling' |
Stats: LRScore = sqrt(LR product)/mean(raw counts) * sqrt(LR product) where expression of l > 0 and r > 0 LRScore = 1 is the highest (~ most likely hit), 0 is the lowest.
An unfiltered SCA tibble
Call Squidpy Pipeline via reticulate with OmniPath and format results
call_squidpy( sce, op_resource, seed = 1004, conda_env = NULL, use_active_env = TRUE, assay = "RNA", assay.type = "logcounts", layer = NULL, ... )call_squidpy( sce, op_resource, seed = 1004, conda_env = NULL, use_active_env = TRUE, assay = "RNA", assay.type = "logcounts", layer = NULL, ... )
sce |
SingleCellExperiment or Seurat Object as input |
op_resource |
Tibble or list of OmniPath resources, typically obtained via
|
seed |
seed passed to squidpy's ligrec function |
conda_env |
python conda environment to run Squidpy. If NULL, will try: 1. Currently active reticulate environment 2. Environment from RETICULATE_PYTHON_ENV environment variable 3. Fall back to "liana_env" for backward compatibility |
use_active_env |
logical. If TRUE and a Python environment is already active, use it instead of switching. Default: TRUE |
assay |
assay name |
assay.type |
count slot (logcounts by default) |
... |
kwargs passed to Squidpy; For more information see: https://squidpy.readthedocs.io/en/latest/api/squidpy.gr.ligrec.html |
CellPhoneDBv2 algorithm re-implementation in Python.
Note that 'cluster_key' is a parameter passed to the Squidpy function, by default this will be set to the default Ident of the Seurat object.
A list of Squidpy results for each resource
Frequency ChordDiagram
chord_freq( liana_res, source_groups = NULL, target_groups = NULL, cex = 1, transparency = 0.4, facing = "clockwise", adj = c(-0.5, 0.05), ... )chord_freq( liana_res, source_groups = NULL, target_groups = NULL, cex = 1, transparency = 0.4, facing = "clockwise", adj = c(-0.5, 0.05), ... )
liana_res |
aggregated 'liana_wrap' results from multiple methods, or alternatively results from running 'liana_wrap' with a single method. Should be filtered by some condition (e.g. preferential consesus ranking, specific interactions, etc). |
source_groups |
names of the source (sender) cell types (NULL = no filter) |
target_groups |
names of the target cell types (NULL = no filter) |
cex |
label relative font size |
transparency |
transparency |
facing |
axis label rotation (check 'circlize::circos.text' for options) |
... |
other paramters passed to 'circlize::chordDiagram' |
offset |
for text. |
Helper Function to 'decomplexify' ligands and receptors into individual subunits
decomplexify(resource, columns = c("source_genesymbol", "target_genesymbol"))decomplexify(resource, columns = c("source_genesymbol", "target_genesymbol"))
resource |
a ligrec resource |
columns |
columns to separate and pivot long (e.g. genesymbol or uniprot), 'source_genesymbol' and 'target_genesymbol' by default |
takes any number of columns, and assumes '_' as sep.
returns a longer tibble with complex subunits on seperate rows
Wrapper function to run 'cell2cell_tensor' decomposition on a prebuilt tensor.
decompose_tensor( tensor, rank = NULL, tf_optimization = "robust", seed = 1337, upper_rank = 25, elbow_metric = "error", smooth_elbow = FALSE, init = "svd", svd = "numpy_svd", factors_only = TRUE, verbose = TRUE, ... )decompose_tensor( tensor, rank = NULL, tf_optimization = "robust", seed = 1337, upper_rank = 25, elbow_metric = "error", smooth_elbow = FALSE, init = "svd", svd = "numpy_svd", factors_only = TRUE, verbose = TRUE, ... )
tensor |
Tensor-cell2cell Prebuilt.Tensor class instance |
rank |
Ranks for the Tensor Factorization (number of factors to deconvolve the original tensor). If NULL, then rank selection is performed using the 'elbow_rank_selection' function. |
tf_optimization |
indicates whether running the analysis in the ''regular'‘ or the '’robust'' way. The regular way means that the tensor decomposition is run 10 times per rank evaluated in the elbow analysis, and 1 time in the final decomposition. Additionally, the optimization algorithm has less number of iterations in the regular than the robust case (100 vs 500) and less precision (tolerance of 1e-7 vs 1e-8). The robust case runs the tensor decomposition 20 times per rank evaluated in the elbow analysis, and 100 times in the final decomposition. Here we could use the ‘tf_optimization=’regular'', which is faster but generates less robust results. We recommend using ‘tf_optimization=’robust', which takes longer to run (more iteractions and more precise too). |
seed |
Random seed integer |
upper_rank |
Upper bound of ranks to explore with the elbow analysis. |
init |
Initialization method for computing the Tensor Factorization. ‘svd’, ‘random’ |
factors_only |
whether to return only the factors after factorization |
verbose |
verbosity logical |
... |
Dictionary containing keyword arguments for the c2c.compute_tensor_factorization function. The function deals with 'random_state' (seed) and 'rank' internally. |
an instance of the cell2cell.tensor.BaseTensor class (via reticulate). If build_only is TRUE, then no rank selection or tensor decomposition is returned. Otherwise, returns a tensor with factorization results.
Filter nun-abundant cell types
filter_nonabundant_celltypes( sce, sample_col, idents_col, min_cells = 10, min_samples = 3, min_prop = 0.2, ctqc = NULL )filter_nonabundant_celltypes( sce, sample_col, idents_col, min_cells = 10, min_samples = 3, min_prop = 0.2, ctqc = NULL )
sce |
SingleCellExperiment Object |
sample_col |
column with sample ids |
idents_col |
column with cell identity (cell type) ids |
min_cells |
minimum cells per identity in each sample |
min_samples |
minimum samples per cell identity |
min_prop |
minimum proportion of samples in which a cell identity is present (with at least 'min_cells') |
ctqc |
cell type quality control summary obtained from 'get_abundance_summary' |
a filtered SingleCellExperiment Object
Helper function to filter and format connectome
FormatConnectome(conn)FormatConnectome(conn)
conn |
connectome object |
Helper Function to Filter and format iTalk results
FormatiTALK(italk_res, remove.na = TRUE)FormatiTALK(italk_res, remove.na = TRUE)
italk_res |
iTalk results object |
remove.na |
bool whether to filter NA |
Load NATMI results from folder and format appropriately
FormatNatmi(output_path, resource_names, .format = TRUE)FormatNatmi(output_path, resource_names, .format = TRUE)
output_path |
NATMI output path |
resource_names |
results for which resources to load |
.format |
bool whether to format output |
A list of NATMI results per resource loaded from the output directory.
Helper function to format SingleCellSignalR results
FormatSCA(sca_res, remove.na = TRUE)FormatSCA(sca_res, remove.na = TRUE)
sca_res |
Unformatted SCA results |
remove.na |
bool whether to filter SCA output |
Function to generate a homologous OmniPath resource
generate_homologs( op_resource, target_organism, max_homologs = 5, .missing_fun = NULL, symbols_dict = NULL, columns = c("source_genesymbol", "target_genesymbol"), verbose = TRUE )generate_homologs( op_resource, target_organism, max_homologs = 5, .missing_fun = NULL, symbols_dict = NULL, columns = c("source_genesymbol", "target_genesymbol"), verbose = TRUE )
op_resource |
a resource in the format of OmniPath/LIANA |
target_organism |
'ncbi_taxid' or 'name' of the target organism. See ‘show_homologene' for available organisms via OmnipathR’s 'HomoloGene' |
max_homologs |
Determines the max number of homologs to be translated. Certain genes will have multiple homolog matches, with some having also certain isoforms considered. To exclude cases in which the number of matched homologs is too high, one can adjust the homologs parameter. Setting this to '1' would mean that one-to-many homolog matches are discarded |
.missing_fun |
approach to handle missing interactions. By default set to 'NULL' which would mean that any interactions without a homology match will be filtered. This can be set to e.g. 'str_to_title' when working with murine symbols. Then if a gene has no matched homolog, instead of discarding it, the '.missing_fun' will be used to format the name from human. Hence, increasing the number of matches, but likely introducing some mismatches. |
symbols_dict |
'NULL' by default, then 'get_homologene_dict' is called to generate a dictionary from OmniPathR's homologene resource. Alternatively, one can pass their own symbols_dictionary. |
verbose |
logical for verbosity |
source |
name of the source (ligand) column |
target |
name of the target (receptor) column |
a converted ligand-receptor resource
Generate a geneset resource for each LR
generate_lr_geneset(sce, resource, lr_sep = "^")generate_lr_geneset(sce, resource, lr_sep = "^")
sce |
SingleCellExperiment object with liana_tensor_c2c computed |
resource |
resource with 'source', 'target', 'weight' columns |
a tibble in decoupleR format
Deprecated call to generate_homologs
generate_orthologs(...)generate_orthologs(...)
... |
Arguments passed on to |
Returns tensor cell2cell results
get_c2c_factors(sce, group_col = NULL, sample_col)get_c2c_factors(sce, group_col = NULL, sample_col)
sce |
SingleCellExperiment with factors output from tensor-cell2cell |
group_col |
context descriptor - to be obtained from 'colData(sce)' |
sample_col |
context/sample names - obtained from 'colData(sce)' |
Function to obtain connectome-like weights
get_connectome(lr_res, ...)get_connectome(lr_res, ...)
lr_res |
ligand-receptor DE results and other stats between clusters |
... |
Arguments passed on to
|
Returns a tibble with specificity weights ('weight_sc') as calculated by Connectome
Function to Generate the Curated (Default) LIANA resource
get_curated_omni( curated_resources = c("CellPhoneDB", "CellChatDB", "ICELLNET", "connectomeDB2020", "CellTalkDB") )get_curated_omni( curated_resources = c("CellPhoneDB", "CellChatDB", "ICELLNET", "connectomeDB2020", "CellTalkDB") )
curated_resources |
the curated resources from which we wish to obtain interactions. By default, it includes interactions curated in the context of CCC from CellPhoneDB, CellChat, ICELLNET, connectomeDB, CellTalkDB, and SignaLink. |
Here, we define the curated resources as those that are defined as manually or expert curated in the context of cell-cell communication. Albeit, "Guide2Pharma", "HPMR", and "Kirouac2010" are also such resources the remainder of the resources used to generate Omnipath, use those as sources. Hence, we assume that the second round of manual curation done in subsequent, more recently published resources would already contain the high quality interactions of the aforementioned 3. We also omit Cellinker, as it results in a large mount of ambigous interactions, but one could consider adding it to the list of curated resources.
a curated OmniPath resource formatted for LIANA
Function to obtain logFC weights
get_logfc(lr_res, ...)get_logfc(lr_res, ...)
lr_res |
ligand-receptor DE results and other stats between clusters |
... |
Arguments passed on to
|
Returns a tibble with a logFC metric ('logfc_comb'). 'logfc_comb' is calculated as the product of the (1 vs the rest) log2FC for each ligand and receptor gene
Helper function that returns the name of each intercell resource in OmniPath
get_lr_resources()get_lr_resources()
A list of strings for each intercell resource in OmniPath
Function to obtain NATMI-like weights
get_natmi(lr_res, ...)get_natmi(lr_res, ...)
lr_res |
ligand-receptor DE results and other stats between clusters |
... |
Arguments passed on to
|
Returns a tibble with specificity weights ('edge_specificity') as calculated by NATMI
Retrieves intercellular communication partners (ligands or receptors) from one ligand-receptor resource.
get_partners(side, resource, ...)get_partners(side, resource, ...)
side |
'ligand' (trans), 'receptor' (rec) or 'both' (both short or long notation can be used) |
resource |
Name of current resource (taken from get_lr_resources) |
... |
Inherit dot params from |
Helper Function to generate shuffled means
get_permutations( lr_res, sce, nperms = 1000, seed = 1234, parallelize = FALSE, workers = 4, assay.type = "logcounts", verbose = TRUE )get_permutations( lr_res, sce, nperms = 1000, seed = 1234, parallelize = FALSE, workers = 4, assay.type = "logcounts", verbose = TRUE )
lr_res |
liana_pipe results |
sce |
SingleCellExperiment Object |
nperms |
number of permutations |
seed |
number used to set random seed |
parallelize |
logical whether to parallelize |
workers |
Number of workers to be used in parallelization |
assay.type |
- the type of data to be used to calculate the means (logcounts by default), available options are: "counts" and "logcounts" |
verbose |
logical for verbosity |
This function could be made generalizable to any set of genes, depending on the set (currently lr_res genes) that is used to filter - i.e. it could be replaced with e.g. genes from TF regulons
Returns a list of shuffled gene means by cluster
Function to obtain SingleCellSignalR-like scores
get_sca(lr_res, ...)get_sca(lr_res, ...)
lr_res |
ligand-receptor DE results and other stats between clusters |
... |
Arguments passed on to
|
Returns a tibble with specificity weights ('LRscore') as calculated by SingleCellSignalR
Communication Frequency heatmap plot
heat_freq(liana_res, ...)heat_freq(liana_res, ...)
liana_res |
aggregated liana results (preferably truncated to some threshold) |
... |
Arguments passed on to
|
This plot was inspired by CellPhoneDB and also CellChat's heatmap design. It makes the assumption that the number of interactions inferred between cell types is informative of the communication events occurring in the system as a whole. This is a rather strong assumption limited by the arbitrarily filtered interactions Thus, I suggest that one limits any conclusions, unless supported by complimentary information, such as biological prior knowledge.
Function to Aggregate CCC Method Results
liana_aggregate( liana_res, aggregate_how = NULL, resource = NULL, set_cap = "max", cap = NULL, get_ranks = TRUE, get_agrank = TRUE, .score_mode = .score_specs, verbose = TRUE, join_cols = NULL, ... )liana_aggregate( liana_res, aggregate_how = NULL, resource = NULL, set_cap = "max", cap = NULL, get_ranks = TRUE, get_agrank = TRUE, .score_mode = .score_specs, verbose = TRUE, join_cols = NULL, ... )
liana_res |
LIANA results |
aggregate_how |
way to aggregate, by default (NULL) will aggregate all passed methods with the approach specified in 'liana:::.score_specs'. Alternative options are 'magnitude' and 'specificity'. |
resource |
If methods are ran with multiple resources, the name of the resource of interest needs to be provided *Note* if a name is not provided, the first results based on the first resource in the list will be returned |
set_cap |
Function used to set ranked cap (i.e. the value that is assigned to interactions with NA for scores); By default, this is set to "max", which is the maximum number of interactions obtained by the methods; Some methods return all possible ligand-receptor combinations for each possible source and target cell pair - i.e. the known universe of all possible interactions (based on the CCC resource) |
cap |
A cap can for all methods can also be manually set, then the top X interactions, based on the 'specificity' scores for each method will be returned and the ranking will be carried out solely on them |
get_ranks |
boolean, whether to return consensus ranks for methods |
get_agrank |
boolean, whether to return aggregate rank using the 'RobustRankAggreg' package. |
.score_mode |
defines the way that the methods would be aggragate. By default, we use the score of each method which reflects specificity (if available), if not e.g. the case of SCA we use it's sole scoring function. This aggregation is by default done on the basis of the list returns by '.score_mode'. Alternatively, one could pass '.score_housekeep' to obtain an aggragate of the housekeeping interactions of each method. |
join_cols |
columns by which different method results will be joined. NULL by default, and automatically will handle the columns depending on the methods used. |
... |
Additional parameters (currently unused, reserved for future extensions) |
set_cap is the name of the name of a function that is to be executed
on a vector representing the number of rows in the results for each method,
by default this is set to max, but any other function that
works with vectors could be passed - e.g. min, mean, etc.
This function also decomplexifies any complex present in the CellChat results which returns complexes by default
Tibble with the interaction results and ranking for each method
liana_path <- system.file(package = "liana") # load testdata testdata <- readRDS(file.path(liana_path, "testdata", "input", "testdata.rds")) # run liana liana_res <- liana_wrap(testdata, method = c("sca", "natmi")) # aggregate results from multiple methods liana_res <- liana_aggregate(liana_res)liana_path <- system.file(package = "liana") # load testdata testdata <- readRDS(file.path(liana_path, "testdata", "input", "testdata.rds")) # run liana liana_res <- liana_wrap(testdata, method = c("sca", "natmi")) # aggregate results from multiple methods liana_res <- liana_aggregate(liana_res)
Wrapper around 'liana_wrap' to run liana for each sample.
liana_bysample( sce, idents_col, sample_col, verbose = TRUE, inplace = TRUE, aggregate_how = NULL, ... )liana_bysample( sce, idents_col, sample_col, verbose = TRUE, inplace = TRUE, aggregate_how = NULL, ... )
idents_col |
name of the cluster column |
sample_col |
name of the sample/context column |
verbose |
verbosity logical |
inplace |
logical (TRUE by default) if liana results are to be saved to the SingleCellExperiment object ('sce@metadata$liana_res') |
aggregate_how |
if running multiple methods (default), then one cal also choose to aggregate the CCC results by sample. |
... |
Arguments passed on to
|
takes a Seurat/SCE object and runs LIANA by sample/condition. The key by which the samples are separated is build from the 'condition_col' and 'sample_col', separated by the 'key_sep'.
If inplace is true returns a sce object with 'liana_res' in 'sce@metadata', else it returns a named list of tibble with liana results per sample.
Wrapper Function to obtain scores via liana_pipe
liana_call(method, lr_res, ...)liana_call(method, lr_res, ...)
method |
name of the method to be called |
lr_res |
ligand-receptor DE results and other stats between clusters |
... |
Arguments passed on to
|
lr_res modified to be method-specific
Function to pass Default Arguments for each method
liana_defaults( assay = "RNA", assay.type = "logcounts", expr_prop = 0.1, seed = 1004, complex_policy = "mean0", parallelize = FALSE, workers = 8, permutation.params = NULL, liana_pipe.params = NULL, liana_call.params = NULL, cellphonedb.params = NULL, natmi.params = NULL, sca.params = NULL, connectome.params = NULL, cytotalk.params = NULL, logfc.params = NULL, cellchat.params = NULL, squidpy.params = NULL, call_sca.params = NULL, call_natmi.params = NULL, call_connectome.params = NULL, call_italk.params = NULL, ... )liana_defaults( assay = "RNA", assay.type = "logcounts", expr_prop = 0.1, seed = 1004, complex_policy = "mean0", parallelize = FALSE, workers = 8, permutation.params = NULL, liana_pipe.params = NULL, liana_call.params = NULL, cellphonedb.params = NULL, natmi.params = NULL, sca.params = NULL, connectome.params = NULL, cytotalk.params = NULL, logfc.params = NULL, cellchat.params = NULL, squidpy.params = NULL, call_sca.params = NULL, call_natmi.params = NULL, call_connectome.params = NULL, call_italk.params = NULL, ... )
assay |
Assay name passed to 'call_italk', 'call_sca', 'call_cellchat', and 'call_connectome' |
assay.type |
- the type of data to be used to calculate the means (logcounts by default), available options are: "counts" and "logcounts" |
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. |
seed |
random seed integer |
complex_policy |
policy how to account for the presence of complexes. |
parallelize |
whether to parallelize cellphonedb-like |
workers |
number of workers to be called |
permutation.params |
list of parameters passed to permutation methods |
liana_pipe.params |
list of Parameters passed to NATMI |
liana_call.params |
list of Parameters passed to NATMI |
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) |
cellchat.params |
list of Parameters passed to CellChat |
squidpy.params |
list of Parameters passed to Squidpy |
call_sca.params |
list of Parameters passed to SingleCellSignalR |
call_natmi.params |
list of Parameters passed to NATMI |
call_connectome.params |
list of Parameters passed to Connectome |
call_italk.params |
list of Parameters passed to iTALK |
The default parameters for each method can also be overwritten by
manually passing a list of parameters for the appropraite method
liana_wrap
Further, each 'get_*' method will by default obtain the default params passed
via liana_pipe and liana_call. This is done so that most steps
required for the calculation of these methods are undertaken only once.
NB! LIANA's internal methods are made consistent. There is no reason to pass specific parameters to any of them. Thus, it is best that one sticks to the non-nested parameters of this function (i.e. excluding '.params'), unless a very specific reason requires any of LIANA's internal parameters to be changed.
A list of the default parameters for each method
liana_path <- system.file(package = "liana") # load testdata testdata <- readRDS(file.path(liana_path, "testdata", "input", "testdata.rds")) # get a `named` list with all default parameters passed to liana. def_params <- liana_defaults() # any of these can then be overwritten and passed to `...` in `liana_wrap` # with the `.params` suffix to the parameter name type. For example, liana_res <- liana_wrap(testdata, permutation.params = list(nperms = 2), liana_pipe.params = list(test.type = "wilcox") )liana_path <- system.file(package = "liana") # load testdata testdata <- readRDS(file.path(liana_path, "testdata", "input", "testdata.rds")) # get a `named` list with all default parameters passed to liana. def_params <- liana_defaults() # any of these can then be overwritten and passed to `...` in `liana_wrap` # with the `.params` suffix to the parameter name type. For example, liana_res <- liana_wrap(testdata, permutation.params = list(nperms = 2), liana_pipe.params = list(test.type = "wilcox") )
Liana dotplot interactions by source and target cells
liana_dotplot( liana_res, source_groups = NULL, target_groups = NULL, ntop = NULL, specificity = "natmi.edge_specificity", magnitude = "sca.LRscore", y.label = "Interactions (Ligand -> Receptor)", size.label = "Interaction\nSpecificity", colour.label = "Expression\nMagnitude", show_complex = TRUE, size_range = c(2, 10), invert_specificity = FALSE, invert_magnitude = FALSE, invert_function = function(x) -log10(x + 1e-10) )liana_dotplot( liana_res, source_groups = NULL, target_groups = NULL, ntop = NULL, specificity = "natmi.edge_specificity", magnitude = "sca.LRscore", y.label = "Interactions (Ligand -> Receptor)", size.label = "Interaction\nSpecificity", colour.label = "Expression\nMagnitude", show_complex = TRUE, size_range = c(2, 10), invert_specificity = FALSE, invert_magnitude = FALSE, invert_function = function(x) -log10(x + 1e-10) )
liana_res |
aggregated 'liana_wrap' results from multiple methods, or alternatively results from running 'liana_wrap' with a single method. Should be filtered by some condition (e.g. preferential consesus ranking, specific interactions, etc). |
source_groups |
names of the source (sender) cell types (NULL = no filter) |
target_groups |
names of the target cell types (NULL = no filter) |
ntop |
number of interactions to return. Note that this assumes that the tibble is sorted in descending order of interaction importance! |
specificity |
column to represent the dot-size of the interaction (by default 'natmi.edge_specificity') |
magnitude |
column to represent interactions expression magnitude (by default 'sca.LRscore') |
y.label |
y label name |
size.label |
size (~specificty) label name |
colour.label |
colour (~magnitude) label name |
show_complex |
logical whether to show complexes (default - TRUE) or only the subunit with minimum expression. |
Here, we refer to 'specificity' as how specific this interaction is to a cell type pair regards to the rest of the cell type pairs ( e.g. CellPhoneDB's p-values, NATMI's specificity edges, Connectome's scaled weights, etc)
'magnitude' on the other hand is a direct measure of the expression alone, by default we use SingleCellSignalR's dataset indepent LRscore (bound between 0 and 1). Yet, one could also use CellChat's probabilities or CellPhoneDB's means, etc.
a ggplot2 object
Communication by cell type Heatmap
liana_heatmap( mat, font_size = 12, grid_text = FALSE, name = "Frequency", pallette = c("white", "violetred2"), row_title = "Sender (Cell types)", column_title = "Receiver (Cell types)", ... )liana_heatmap( mat, font_size = 12, grid_text = FALSE, name = "Frequency", pallette = c("white", "violetred2"), row_title = "Sender (Cell types)", column_title = "Receiver (Cell types)", ... )
mat |
Diagonal celltype-celltype matrix to be plotted. In theory, any metric deemed meaningful between cell pairs can be plotted. |
font_size |
base font_size - other fontsizes are relative to this one |
grid_text |
logical whether to display grid text or not |
name |
name of the heatmap. By default the heatmap name is used as the title of the heatmap legend. |
row_title |
Row tittle |
column_title |
Column tittle |
... |
parameters passed to 'ComplexHeatmap::Heatmap' |
Heatmap function inspired by CellPhoneDBv3 and CellChat's designs on communication heatmaps.
LIANA message/warning helper function to allow for verbosity
liana_message(..., output = "message", verbose = TRUE)liana_message(..., output = "message", verbose = TRUE)
... |
zero or more objects which can be coerced to character (and which are pasted together with no separator) or a single condition object. |
output |
type of output - message, warning, or stop |
verbose |
logical for verbosity |
Liana Pipe which runs DE analysis and merges needed information for LR inference
liana_pipe( sce, op_resource, test.type = "wilcox", pval.type = "all", assay = "RNA", assay.type = "logcounts", verbose = TRUE, base, cell.adj = NULL )liana_pipe( sce, op_resource, test.type = "wilcox", pval.type = "all", assay = "RNA", assay.type = "logcounts", verbose = TRUE, base, cell.adj = NULL )
sce |
SingleCellExperiment Object |
op_resource |
resource tibble obtained via |
test.type |
String specifying the type of pairwise test to perform -
a t-test with |
pval.type |
A string specifying how p-values are to be combined across pairwise comparisons for a given group/cluster. |
assay |
assay to be used ("RNA" by default) |
assay.type |
- the type of data to be used to calculate the means (logcounts by default), available options are: "counts" and "logcounts" |
verbose |
logical for verbosity |
base |
base for conversion from log-tranformed ~CPM back to ~CPM. |
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. |
Returns a tibble with information required for LR calculations downstream
Function to handle different types of object as input and do basic quality checks
liana_prep(sce, ...)liana_prep(sce, ...)
sce |
SingleCellExperiment or Seurat object |
... |
dot dot dot bucket - not passed to anything, handles issues with passing non-existing arguments |
Function to obtain different scoring schemes
liana_scores(score_object, lr_res, ...)liana_scores(score_object, lr_res, ...)
score_object |
score_object specific to the test obtained from score_specs |
lr_res |
ligand-receptor DE results and other stats between clusters |
... |
dot params passed to '*_score' functions |
lr_res modified to be method-specific
Wrapper function to run 'cell2cell_tensor' with LIANA output.
liana_tensor_c2c( sce = NULL, context_df_dict = NULL, score_col = "LRscore", how = "inner", lr_fill = NaN, cell_fill = NaN, lr_sep = "^", context_order = NULL, sort_elements = TRUE, device = NULL, rank = NULL, seed = 1337, upper_rank = 25, runs = 3, init = "svd", build_only = FALSE, factors_only = TRUE, conda_env = NULL, use_available = FALSE, verbose = TRUE, inplace = TRUE, sender_col = "source", receiver_col = "target", ligand_col = "ligand.complex", receptor_col = "receptor.complex", ... )liana_tensor_c2c( sce = NULL, context_df_dict = NULL, score_col = "LRscore", how = "inner", lr_fill = NaN, cell_fill = NaN, lr_sep = "^", context_order = NULL, sort_elements = TRUE, device = NULL, rank = NULL, seed = 1337, upper_rank = 25, runs = 3, init = "svd", build_only = FALSE, factors_only = TRUE, conda_env = NULL, use_available = FALSE, verbose = TRUE, inplace = TRUE, sender_col = "source", receiver_col = "target", ligand_col = "ligand.complex", receptor_col = "receptor.complex", ... )
sce |
SingleCellExperiment with 'context_df_dict' - i.e. liana results per context (sample) stored at 'sce@metadata$liana_res' |
context_df_dict |
Dictionary (named list) containing a dataframe for each context. The dataframe must contain columns containing sender (source) cells, receiver (target) cells, ligands, receptors, and communication scores, separately. Keys are context names and values are dataframes. NULL by default. If not NULL will be used instead of 'sce@metadata$liana_res'. |
score_col |
Name of the column containing the communication scores in all context dataframes. |
how |
Approach to consider cell types and genes present across multiple contexts. - 'inner' : Considers only cell types and LR pairs that are present in all contexts (intersection). - 'outer' : Considers all cell types and LR pairs that are present across contexts (union). - 'outer_lr' : Considers only cell types that are present in all contexts (intersection), while all LR pairs that are present across contexts (union). - 'outer_cells' : Considers only LR pairs that are present in all contexts (intersection), while all cell types that are present across contexts (union). |
lr_fill |
Value to fill communication scores when a ligand-receptor pair is not present across all contexts. (NaN by default) |
cell_fill |
Value to fill communication scores when a cell is not present across all ligand-receptor pairs or all contexts. (NaN by default) |
lr_sep |
Separation character to join ligands and receptors into a LR pair name. ('^' by Default) |
context_order |
List used to sort the contexts when building the tensor. Elements must be all elements in 'names(context_df_dict)'. (NULL by default) |
sort_elements |
Whether alphabetically sorting elements in the InteractionTensor. The Context Dimension is not sorted if a 'context_order' list is provided. (TRUE by default). |
device |
Device to use when backend is pytorch. Options are: ['cpu', 'cuda:0', None]. NULL by Default |
rank |
Ranks for the Tensor Factorization (number of factors to deconvolve the original tensor). If NULL, then rank selection is performed using the 'elbow_rank_selection' function. |
seed |
Random seed integer |
upper_rank |
Upper bound of ranks to explore with the elbow analysis. |
runs |
Number of tensor factorization performed for a given rank. Each factorization varies in the seed of initialization. Consider increasing the number of runs, in order to obtain a more robust rank estimate. |
init |
Initialization method for computing the Tensor Factorization. ‘svd’, ‘random’ |
build_only |
Whether to only return a tensor instance, without rank selection and no factorization. |
factors_only |
whether to return only the factors after factorization |
conda_env |
name of existing conda environment |
use_available |
whether to use c2c if available in current env. False by default. |
verbose |
verbosity logical |
inplace |
logical (TRUE by default) if liana results are to be saved to the SingleCellExperiment object ('sce@metadata$liana_res') |
sender_col |
Name of the column containing the sender cells in all context dataframes. |
receiver_col |
Name of the column containing the receiver cells in all context dataframes. |
ligand_col |
Name of the column containing the ligands in all context dataframes. |
receptor_col |
Name of the column containing the receptors in all context dataframes. |
... |
Dictionary containing keyword arguments for the c2c.compute_tensor_factorization function. The function deals with 'random_state' (seed) and 'rank' internally. |
This function servers as a one-liner wrapper to the tensor factorisation method described in tensor_cell2cell. We refer the user to the publication and tensor_cell2cell tutorial page made by the authors. Logically, one should cite cell2cell's paper if their method was used via LIANA.
an instance of the cell2cell.tensor.BaseTensor class (via reticulate). If build_only is TRUE, then no rank selection or tensor decomposition is returned. Otherwise, returns a tensor with factorization results.
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, layer = NULL, ... )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, layer = 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) )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) )
Helper Function which returns the value closest to 0
min0(vec)min0(vec)
vec |
numeric vector |
value closest to 0
Helper min-max normalization function
minmax(x, ...)minmax(x, ...)
x |
numeric vector |
... |
Arguments passed on to |
normalized vector scaled to [0, 1]
Plot the product of loadings between the source and target loadings within a factor
plot_c2c_cells(sce, factor_of_int, ...)plot_c2c_cells(sce, factor_of_int, ...)
factor_of_int |
factor of interest e.g. Factor.8 |
... |
Arguments passed on to
|
factors |
factors as formatted by 'format_c2c_factors' |
Function to plot an Overview of tensor-c2c results
plot_c2c_overview(sce, group_col, sample_col)plot_c2c_overview(sce, group_col, sample_col)
sce |
SingleCellExperiment with factors output from tensor-cell2cell |
group_col |
context descriptor - to be obtained from 'colData(sce)' |
sample_col |
context/sample names - obtained from 'colData(sce)' |
Generate boxplots with significance
plot_context_boxplot(sce, sample_col, group_col, test = "t.test", ...)plot_context_boxplot(sce, sample_col, group_col, test = "t.test", ...)
sce |
SingleCellExperiment with factors output from tensor-cell2cell |
sample_col |
context/sample names - obtained from 'colData(sce)' |
group_col |
context descriptor - to be obtained from 'colData(sce)' |
... |
arguments passed to the test used. |
Plot a Heatmap of context loadings
plot_context_heat(sce, sample_col, group_col, ...)plot_context_heat(sce, sample_col, group_col, ...)
sce |
SingleCellExperiment with factors output from tensor-cell2cell |
sample_col |
context/sample names - obtained from 'colData(sce)' |
group_col |
context descriptor - to be obtained from 'colData(sce)' |
... |
Arguments passed on to
|
a ComplexHeatmap object
Function to plot a UMAP of context loadings
plot_lr_heatmap(sce, lr_sep = "^", n = 5, ...)plot_lr_heatmap(sce, lr_sep = "^", n = 5, ...)
sce |
SingleCellExperiment with factors output from tensor-cell2cell |
n |
Number of rows to return for |
... |
Arguments passed on to
|
a ComplexHeatmap object
Helper function to deal with tensor sparsity and liana's scores as in Python
preprocess_scores( context_df_dict, score_col = "magnitude_rank", sender_col = "source", receiver_col = "target", ligand_col = "ligand.complex", receptor_col = "receptor.complex", outer_fraction = 0, invert = TRUE, invert_fun = function(x) 1 - x, non_negative = TRUE, non_negative_fill = 0, lr_sep = "^", verbose = TRUE )preprocess_scores( context_df_dict, score_col = "magnitude_rank", sender_col = "source", receiver_col = "target", ligand_col = "ligand.complex", receptor_col = "receptor.complex", outer_fraction = 0, invert = TRUE, invert_fun = function(x) 1 - x, non_negative = TRUE, non_negative_fill = 0, lr_sep = "^", verbose = TRUE )
context_df_dict |
Dictionary (named list) containing a dataframe for each context. The dataframe must contain columns containing sender (source) cells, receiver (target) cells, ligands, receptors, and communication scores, separately. Keys are context names and values are dataframes. NULL by default. If not NULL will be used instead of 'sce@metadata$liana_res'. |
score_col |
Name of the column containing the communication scores in all context dataframes. |
sender_col |
Name of the column containing the sender cells in all context dataframes. |
receiver_col |
Name of the column containing the receiver cells in all context dataframes. |
ligand_col |
Name of the column containing the ligands in all context dataframes. |
receptor_col |
Name of the column containing the receptors in all context dataframes. |
outer_fraction |
controls the elements to include in the union scenario of the 'how' options. Only elements that are present at least in this fraction of samples/contexts will be included. When this value is 0, considers all elements across the samples. When this value is 1, it acts as using ‘how=’inner'' |
invert |
boolean wheter to invert the score (TRUE by defeault) |
invert_fun |
function used to invert scores |
non_negative |
whether to set negative scores to 0 |
non_negative_fill |
the value to be used to fill negative values |
lr_sep |
ligand-receptor separator; '^' by default. |
verbose |
verbosity logical |
Aggregate CCC Method results and by both magnitude and specificity ranks
rank_aggregate(liana_res, ...)rank_aggregate(liana_res, ...)
liana_res |
LIANA results |
... |
Arguments passed on to
|
liana_path <- system.file(package = "liana") # load testdata testdata <- readRDS(file.path(liana_path, "testdata", "input", "testdata.rds")) # run liana liana_res <- liana_wrap(testdata, method = c("sca", "natmi")) # aggregate results from multiple methods liana_res <- rank_aggregate(liana_res)liana_path <- system.file(package = "liana") # load testdata testdata <- readRDS(file.path(liana_path, "testdata", "input", "testdata.rds")) # run liana liana_res <- liana_wrap(testdata, method = c("sca", "natmi")) # aggregate results from multiple methods liana_res <- rank_aggregate(liana_res)
Helper function to rank each method
rank_method(liana_res, method_name, mode = "specificity")rank_method(liana_res, method_name, mode = "specificity")
liana_res |
liana_results for a single method |
method_name |
name of the method |
mode |
ranking to be carried out. Accepted modes are 'specificity' and 'magnitude'. The first is meant to reflect the specificity of interactions across all cell types, while the latter typically reflects how highly expressed is a given interaction. |
this function makes use of liana's 'liana:::.score_specs' and 'liana:::.score_housekeep' functions.
Helper Function to Handle resource choices
select_resource(resource)select_resource(resource)
resource |
names of the resources. Passing 'all' will return all human resources (i.e. all resources, except MouseConsensus) |
This function simply reads omni_resources.rds and returns the resources. Any of the resources can also be obtained via the same file. or the 'compile_ligrec' function, which querries and assmelbes the resources via 'OmniPathR'.
'Default' - The Default (inbuilt) resource for each of the methods; if using the 'call_*' functions, the default resource is used by passing *NULL* to the resource parameter. 'Reshuffled' - a reshuffled (randomized control) version of ConnectomeDB
Helper function to show available organisms via OmnipathR's homologene resource
show_homologene()show_homologene()
Helper Function to return the methods in LIANA
show_methods()show_methods()
methods starting with 'call_*' were re-implemented in liana and albeit their original pipelines (and packages are still supported), we recommend using the liana re-implementations for efficiency
Helper Function to return the Resources in LIANA
show_resources()show_resources()