xCell2Train | R Documentation |
This function creates a custom reference object for xCell2Analysis
, enabling cell type enrichment analysis.
It supports references derived from RNA-Seq, microarray, and scRNA-Seq data and can be derived from various tissues and organisms.
xCell2Train(
ref,
mix = NULL,
labels = NULL,
refType,
lineageFile = NULL,
BPPARAM = BiocParallel::SerialParam(),
useOntology = TRUE,
returnSignatures = FALSE,
returnAnalysis = FALSE,
useSpillover = TRUE,
spilloverAlpha = 0.5,
minPbCells = 30,
minPbSamples = 10,
minScGenes = 10000
)
ref |
A reference gene expression matrix (genes in rows, samples/cells in columns) or a SummarizedExperiment/SingleCellExperiment object with expression data in the assays slot. Valid Assays:
Notes:
|
mix |
A bulk mixture of gene expression matrix (genes in rows, samples in columns) (optional).
This parameter is required if |
labels |
A data frame with the following columns:
This parameter is unnecessary if |
refType |
The type of reference data: |
lineageFile |
Path to a manually curated cell type lineage file generated with |
BPPARAM |
A BiocParallelParam instance that determines the parallelization strategy (more in "Details").
Default is |
useOntology |
A Boolean indicating whether to use ontological integration for cell type dependencies (default: |
returnSignatures |
A Boolean to return only cell type signatures (default: |
returnAnalysis |
A Boolean to return |
useSpillover |
A Boolean to use spillover correction during analysis when |
spilloverAlpha |
Numeric value controlling spillover correction strength (default: |
minPbCells |
Minimum number of cells in a pseudo-bulk sample for scRNA-Seq references (default: |
minPbSamples |
Minimum number of pseudo-bulk samples for scRNA-Seq references (default: |
minScGenes |
Minimum number of genes for pseudo-bulk samples for scRNA-Seq references (default: |
Ontological Integration:
Ontological integration (useOntology
) leverages hierarchical cell type relationships to ensure biologically meaningful signatures.
Dependencies can be refined using xCell2GetLineage
, which generates lineage files for manual review.
Spillover Correction:
Spillover correction enhances the specificity of enrichment scores by reducing overlaps between related cell types.
Use the spilloverAlpha
parameter to tune the strength of correction.
Contribute Your xCell2 Reference Object: Users are encouraged to share their reference objects via the xCell2 Reference Repository.
An xCell2Object
containing:
signatures: Cell type-specific gene signatures.
dependencies: Lineage-based dependencies.
params: Linear transformation parameters.
spill_mat: A spillover correction matrix.
genes_used: Genes used for training.
Almog Angel and Dvir Aran
xCell2Analysis
, for enrichment analysis.
xCell2GetLineage
, for refining cell type dependencies.
library(xCell2)
data(dice_demo_ref, package = "xCell2")
dice_ref <- SummarizedExperiment::assay(dice_demo_ref, "logcounts")
colnames(dice_ref) <- make.unique(colnames(dice_ref))
dice_labels <- as.data.frame(SummarizedExperiment::colData(dice_demo_ref))
dice_labels$ont <- NA
dice_labels$sample <- colnames(dice_ref)
dice_labels$dataset <- "DICE"
DICE.xCell2Ref <- xCell2::xCell2Train(ref = dice_ref, labels = dice_labels, refType = "rnaseq")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.