View source: R/xCell2GetLineage.R
xCell2GetLineage | R Documentation |
Identifies cell type dependencies based on the Cell Ontology, including both descendants and ancestors for each cell type.
Enables manual inspection and refinement of lineage relationships to improve biological accuracy in xCell2
analyses.
xCell2GetLineage(labels, outFile = NULL)
labels |
A data frame with the following required columns:
|
outFile |
Optional. Output file name for saving dependencies as a TSV file.
The file includes columns for |
The xCell2GetLineage
function generates lineage relationships for cell types based on the Cell Ontology.
These relationships refine lineage-based dependencies, improving the biological relevance of gene signatures.
Users can:
Use the generated TSV file for manual adjustments before training custom references via xCell2Train
.
Skip this step entirely, allowing xCell2Train
to infer dependencies automatically.
If no ontology IDs ("ont"
) are provided, the function outputs empty dependencies with a message for user guidance.
Relationship with Other Functions:
xCell2Train
: Incorporates lineage relationships during reference training.
xCell2Analysis
: Uses trained references for enrichment analysis.
If outFile
is:
NULL
: Returns a list of dependencies for each cell type, with descendants and ancestors as components.
Specified: Writes a TSV file and warns the user to inspect and validate results manually.
Almog Angel and Dvir Aran
xCell2Train
for training custom references with lineage data.
xCell2Analysis
for enrichment analysis using trained references.
AnnotationHub
to access ontology data.
ontologyIndex
to programmatically explore ontologies.
# For detailed examples, see the xCell2 vignette.
library(xCell2)
# Load demo reference object
data(dice_demo_ref, package = "xCell2")
# Prepare labels data frame
dice_labels <- SummarizedExperiment::colData(dice_demo_ref)
dice_labels <- as.data.frame(dice_labels)
dice_labels$ont <- NA
dice_labels$sample <- colnames(dice_demo_ref)
dice_labels$dataset <- "DICE"
# Assign ontology IDs
dice_labels[dice_labels$label == "B cells", ]$ont <- "CL:0000236"
dice_labels[dice_labels$label == "Monocytes", ]$ont <- "CL:0000576"
dice_labels[dice_labels$label == "NK cells", ]$ont <- "CL:0000623"
dice_labels[dice_labels$label == "T cells, CD8+", ]$ont <- "CL:0000625"
dice_labels[dice_labels$label == "T cells, CD4+", ]$ont <- "CL:0000624"
dice_labels[dice_labels$label == "T cells, CD4+, memory", ]$ont <- "CL:0000897"
# Generate cell type lineage dependencies
xCell2::xCell2GetLineage(labels = dice_labels)
# Manually inspect and adjust saved dependencies for refined lineage relationships
# Use the adjusted file as input to xCell2Train via the `lineageFile` parameter.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.