opti_resolution_plot: Plot function to determine optimal resolution parameter of...

View source: R/AssessMe.R

opti_resolution_plotR Documentation

Plot function to determine optimal resolution parameter of community detection algorithms after cluster assessment.

Description

After cluster assessment, this function serves to optimize community detection clustering resolution parameter by highlighting resolution with maximal number of clusters with a user defined threshold and saturation point at which number increase of resolution only linearly decreases average number of detected outlier cells across clusters.

Usage

opti_resolution_plot(
  assesment_list,
  cex = 1,
  f1_thr = 0.5,
  max_leng = 3,
  lcol = "red",
  resolu = T,
  sat2 = F
)

Arguments

cex

numeric, graphical parameter indicating the amount by which the line connecting data points should be scaled. Default = 1.

f1_thr

numeric, threshold used to calculate how many clusters have at least 1 gene with F1-score above this threshold for different cluster partitions assessed. Default = 0.5.

max_leng

numeric, calculation of number of clusters with at least max_leng genes with minimal F1-score of f1_thr for the different cluster partitions assessed. Default = 3.

lcol

color used for highlighting the line connecting the data points. Default = “red”.

resolu

logical. If T. Calculates and highlights saturation point when number of average outlier cells decreases linear with increasing cluster number using two approaches:1) linear model of dependency of average number of outlier cells on the number of different clusters of the different assessed resolutions/cluster partitions. Resolution with the largest negative distance to the fit is highlighted as saturation point. 2) calculates saturation point using an elbow criterion. In addition, highlights the resolution with the maximal number of clusters with 1 gene and max_leng genes with F1-scores >= f1_thr. Default = T.

sat2

logical. If T, resolution is fulfilling saturation criterion, if one of the next 3 resolutions also fulfills the saturation criterion.

assessment_list

list of assessments for partitions of e.g. increasing resolution parameters of community detection methods.

Value

plot with 6 graphs, plotting information about cluster partition against number of clusters and number of clusters against average F1-score, average Entropy, average No. of outlier genes across clusters, number of clusters with F1-scores >= f1_thr and number of clusters with max_leng genes with F1-score >= f1_thr.

output_tab

data.frame with with different resolutions/cluster partitions as rows and the following columns: “No.cluster” = number of assessed clusters, “mean_F1” = mean F1_Score across genes, “mean_Entropy” = mean Entropy across genes, “mean_No.cell_outlg1” = mean number of cells with 1 outlier gene expression across clusters, “No.cluster_F1>=_f1thr”= number of clusters with at least 1 genes with F1 >= f1thr, “No._cluster_max_leng genes_w.F1>= f1thr “= number of clusters with at least max_leng genes with F1 >= f1thr, “F1_max_genes” = for every resolution, highest rank genes based on F1-score for clusters if F1>= f1thr.

Examples

opti_resolution_plot(assess_seuratRC, f1_thr = 0.5, max_leng = 3, lcol = "red", resolu = T)

PatZeis/AssessMe documentation built on Nov. 19, 2022, 6:03 a.m.