Learn R Programming

SlimR (version 1.0.7)

Celltype_Calculate: Uses "marker_list" to calculate probability, prediction results, AUC and generate heatmap for cell annotation

Description

Uses "marker_list" to calculate probability, prediction results, AUC and generate heatmap for cell annotation

Usage

Celltype_Calculate(
  seurat_obj,
  gene_list,
  species,
  cluster_col = "seurat_clusters",
  assay = "RNA",
  min_expression = 0.1,
  specificity_weight = 3,
  threshold = 0.8,
  compute_AUC = TRUE,
  plot_AUC = TRUE,
  AUC_correction = TRUE,
  colour_low = "navy",
  colour_high = "firebrick3"
)

Value

A list containing:

  • Expression_list: List of expression matrices for each cell type

  • Proportion_list: List of proportion of expression for each cell type

  • Expression_scores_matrix: Matrix of expression scores

  • Probability_matrix: Matrix of normalized probabilities

  • Prediction_results: Data frame with cluster annotations including:

    • cluster_col: Cluster identifier

    • Predicted_cell_type: Primary predicted cell type

    • AUC: Area Under the Curve value (when compute_AUC = TRUE)

    • Alternative_cell_types: Semi-colon separated alternative cell types

  • Heatmap_plot: Heatmap visualization of probability matrix

  • AUC_plot: AUC visualization of Predicted cell type

Arguments

seurat_obj

Enter the Seurat object with annotation columns such as "seurat_cluster" in meta.data to be annotated.

gene_list

A list of cells and corresponding gene controls, the name of the list is cell type, and the first column of the list corresponds to markers. Lists can be generated using functions such as "Markers_filter_Cellmarker2 ()", "Markers_filter_PanglaoDB ()", "read_excel_markers ()", "read_seurat_markers ()", etc.

species

This parameter selects the species "Human" or "Mouse" for standard gene format correction of markers entered by "Marker_list".

cluster_col

Enter annotation columns such as "seurat_cluster" in meta.data of the Seurat object to be annotated. Default parameters use "cluster_col = 'seurat_clusters'".

assay

Enter the assay used by the Seurat object, such as "RNA". Default parameters use "assay = 'RNA'".

min_expression

The min_expression parameter defines a threshold value to determine whether a cell's expression of a feature is considered "expressed" or not. It is used to filter out low-expression cells that may contribute noise to the analysis. Default parameters use "min_expression = 0.1".

specificity_weight

The specificity_weight parameter controls how much the expression variability (standard deviation) of a feature within a cluster contributes to its "specificity score." It amplifies or suppresses the impact of variability in the final score calculation.Default parameters use "specificity_weight = 3".

threshold

This parameter refers to the normalized similarity between the "alternative cell type" and the "predicted cell type" in the returned results. (the default parameter is 0.8)

compute_AUC

Logical indicating whether to calculate AUC values for predicted cell types. AUC measures how well the marker genes distinguish the cluster from others. When TRUE, adds an AUC column to the prediction results. (default: TRUE)

plot_AUC

The logic indicates whether to draw an AUC curve for the predicted cell type. When TRUE, add an AUC_plot to result. (default: TRUE)

AUC_correction

Logical value controlling AUC-based correction. (default = TRUE) When set to TRUE: 1.Computes AUC values for candidate cell types. (probability > threshold) 2.Selects the cell type with the highest AUC as the final predicted type. 3.Records the selected type's AUC value in the "AUC" column.

colour_low

Color for lowest probability level in Heatmap visualization of probability matrix. (default = "navy")

colour_high

Color for highest probability level Heatmap visualization of probability matrix. (default = "firebrick3")

See Also

Other Automated_Annotation_Workflow: Celltype_Annotation(), Celltype_Verification()

Examples

Run this code
if (FALSE) {
SlimR_anno_result <- Celltype_Calculate(seurat_obj = sce,
    gene_list = Markers_list,
    species = "Human",
    cluster_col = "seurat_clusters",
    assay = "RNA",
    min_expression = 0.1,
    specificity_weight = 3,
    threshold = 0.8,
    compute_AUC = TRUE,
    plot_AUC = TRUE,
    AUC_correction = TRUE,
    colour_low = "navy",
    colour_high = "firebrick3"
    )
    }

Run the code above in your browser using DataLab