View source: R/Probability_parameter.R
| Parameter_Calculate | R Documentation |
This function uses machine learning to automatically determine optimal min_expression and specificity_weight parameters for single-cell data analysis based on dataset characteristics.
Parameter_Calculate(
seurat_obj,
features,
assay = NULL,
cluster_col = NULL,
method = "ensemble",
n_models = 3,
return_model = FALSE,
verbose = TRUE
)
seurat_obj |
A Seurat object containing single-cell data |
features |
Character vector of feature names (genes) to analyze |
assay |
Name of assay to use (default: default assay) |
cluster_col |
Column name in metadata containing cluster information |
method |
Machine learning method: "rf" (random forest), "gbm" (gradient boosting), "svm" (support vector machine), or "ensemble" (default) |
n_models |
Number of models for ensemble learning (default: 3) |
return_model |
Whether to return trained model (default: FALSE) |
verbose |
Whether to print progress messages (default: TRUE) |
A list containing:
min_expression: Recommended expression threshold
specificity_weight: Recommended specificity weight
performance: Model performance metric (R-squared)
dataset_features: Extracted dataset characteristics
model: Trained model (if return_model = TRUE)
Other Section_3_Automated_Annotation:
Celltype_Annotation(),
Celltype_Calculate(),
Celltype_Verification()
## Not run:
# Basic usage
SlimR_params <- Parameter_Calculate(
seurat_obj = sce,
features = c("CD3E", "CD4", "CD8A"),
assay = "RNA",
cluster_col = "seurat_clusters",
method = "ensemble",
n_models = 3,
return_model = FALSE,
verbose = TRUE
)
# Use with custom method
SlimR_params <- Parameter_Calculate(
seurat_obj = sce,
features = unique(Markers_list_Cellmarker2$`B cell`$marker),
assay = "RNA",
cluster_col = "seurat_clusters",
method = "rf",
return_model = FALSE,
verbose = TRUE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.