run_interaction_analysis {scDiffCom} | R Documentation |
Run (differential) intercellular communication analysis
Description
Perform (differential) cell type to cell type communication analysis from a Seurat object, using an internal database of ligand-receptor interactions (LRIs). It infers biologically relevant cell-cell interactions (CCIs) and how they change between two conditions of interest. Over-representation analysis is automatically performed to determine dominant differential signals at the level of the genes, cell types, GO Terms and KEGG Pathways.
Usage
run_interaction_analysis(
seurat_object,
LRI_species,
seurat_celltype_id,
seurat_condition_id,
iterations = 1000,
scdiffcom_object_name = "scDiffCom_object",
seurat_assay = "RNA",
seurat_slot = "data",
log_scale = FALSE,
score_type = "geometric_mean",
threshold_min_cells = 5,
threshold_pct = 0.1,
threshold_quantile_score = 0.2,
threshold_p_value_specificity = 0.05,
threshold_p_value_de = 0.05,
threshold_logfc = log(1.5),
return_distributions = FALSE,
seed = 42,
verbose = TRUE
)
Arguments
seurat_object |
Seurat object that must contain normalized
data and relevant |
LRI_species |
Either |
seurat_celltype_id |
Name of the |
seurat_condition_id |
List that contains information regarding the two conditions on which to perform differential analysis. Must contain the following three named items:
Can also be set to |
iterations |
Number of permutations to perform the statistical
analysis. The default ( |
scdiffcom_object_name |
Name of the |
seurat_assay |
Assay of |
seurat_slot |
Slot of |
log_scale |
When |
score_type |
Metric used to compute cell-cell interaction (CCI) scores.
Can either be |
threshold_min_cells |
Minimal number of cells - of a given cell type
and condition - required to express a gene for this gene to be considered
expressed in the corresponding cell type. Incidentally, cell types with
less cells than this threshold are removed from the analysis.
Set to |
threshold_pct |
Minimal fraction of cells - of a given cell type
and condition - required to express a gene for this gene to be considered
expressed in the corresponding cell type. Set to |
threshold_quantile_score |
Threshold value used in conjunction with
|
threshold_p_value_specificity |
Threshold value used in conjunction
with |
threshold_p_value_de |
Threshold value used in conjunction
with |
threshold_logfc |
Threshold value used in conjunction with
|
return_distributions |
|
seed |
Set a random seed ( |
verbose |
If |
Details
The primary use of this function (and of the package) is to perform
differential intercellular communication analysis. However, it is also
possible to only perform a detection analysis (by setting
seurat_condition_id
to NULL
), e.g. if one wants to
infer cell-cell interactions from a dataset without having conditions on the cells.
By convention, when performing differential analysis, LOGFC are computed as
log(score(cond2_name)/score(cond1_name))
. In other words,
"UP"-regulated CCIs have a larger score in cond2_name
.
Parallel computing. If possible, it is recommended to
run this function in parallel in order to speed up the analysis for large
dataset and/or to obtain better accuracy on the p-values by setting a higher
number of iterations
. This is as simple as loading the
future
package and setting an appropriate plan
(see also our
vignette).
Data extraction. The UMI or read counts matrix is extracted from
the assay seurat_assay
and the slot seurat_slot
. By default,
it is assumed that seurat_object
contains log1p-transformed
normalized data in the slot "data" of its assay "RNA". If log_scale
is FALSE
(as recommended), the data are expm1()
transformed
in order to recover normalized values not in log scale.
Modifying filtering parameters (differential analysis only). As long as
the slot cci_table_raw
of
the returned scDiffCom object is not erased, filtering parameters can be
modified to recompute the slots cci_table_detected
and
ora_table
, without re-performing the time consuming permutation
analysis. This may be useful if one wants a fast way to analyze how the
results behave in function of, say, different LOGFC thresholds. In practice,
this can be done by calling the functions FilterCCI
or
RunORA
(see also our
vignette).
Value
An S4 object of class scDiffCom-class
.
Examples
## Not run:
run_interaction_analysis(
seurat_object = seurat_sample_tms_liver,
LRI_species = "mouse",
seurat_celltype_id = "cell_type",
seurat_condition_id = list(
column_name = "age_group",
cond1_name = "YOUNG",
cond2_name = "OLD"
)
)
## End(Not run)