Identify marker feats for selected clusters based on gini detection and expression scores.
findGiniMarkers(
gobject,
feat_type = NULL,
spat_unit = NULL,
expression_values = c("normalized", "scaled", "custom"),
cluster_column,
subset_clusters = NULL,
group_1 = NULL,
group_1_name = NULL,
group_2 = NULL,
group_2_name = NULL,
min_expr_gini_score = 0.2,
min_det_gini_score = 0.2,
detection_threshold = 0,
rank_score = 1,
min_feats = 5,
min_genes = NULL
)
giotto object
feature type
spatial unit
feat expression values to use
clusters to use
selection of clusters to compare
group 1 cluster IDs from cluster_column for pairwise comparison
custom name for group_1 clusters
group 2 cluster IDs from cluster_column for pairwise comparison
custom name for group_2 clusters
filter on minimum gini coefficient for expression
filter on minimum gini coefficient for detection
detection threshold for feat expression
rank scores for both detection and expression to include
minimum number of top feats to return
deprecated, use min_feats
data.table with marker feats
Detection of marker feats using the gini coefficient is based on the following steps/principles per feat:
calculate average expression per cluster
calculate detection fraction per cluster
calculate gini-coefficient for av. expression values over all clusters
calculate gini-coefficient for detection fractions over all clusters
convert gini-scores to rank scores
for each feat create combined score = detection rank x expression rank x expr gini-coefficient x detection gini-coefficient
for each feat sort on expression and detection rank and combined score
As a results "top gini" feats are feats that are very selectivily expressed in a specific cluster, however not always expressed in all cells of that cluster. In other words highly specific, but not necessarily sensitive at the single-cell level.
To perform differential expression between custom selected groups of cells you need to specify the cell_ID column to parameter cluster_column and provide the individual cell IDs to the parameters group_1 and group_2
By default group names will be created by pasting the different id names within each selected group. When you have many different ids in a single group it is recommend to provide names for both groups to group_1_name and group_2_name
g <- GiottoData::loadGiottoMini("visium")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 3.1 read Giotto spatial shape information
#> 3.2 read Giotto spatial centroid information
#> 3.3 read Giotto spatial overlap information
#> 4. read Giotto image information
#> python already initialized in this session
#> active environment : '/usr/bin/python3'
#> python version : 3.10
#> checking default envname 'giotto_env'
#> a system default python environment was found
#> Using python path:
#> "/usr/bin/python3"
findGiniMarkers(g, cluster_column = "leiden_clus")
#> feats cluster expression expression_gini detection
#> <char> <char> <num> <num> <num>
#> 1: Mustn1 2 0.2675877 0.48429164 0.09836066
#> 2: Inmt 2 0.1386324 0.45249410 0.04918033
#> 3: 1700001C02Rik 2 0.1892710 0.42740432 0.05737705
#> 4: Nid1 2 0.2155386 0.42306445 0.07377049
#> 5: Slc13a4 2 0.3299290 0.34576465 0.11475410
#> ---
#> 3467: Hbb-bt 4 5.3661664 0.01907350 0.96774194
#> 3468: Plekhb1 4 5.0305237 0.01466618 0.97849462
#> 3469: Hba-a2 4 5.9526050 0.01088350 1.00000000
#> 3470: Hba-a1 4 6.4266566 0.01066553 1.00000000
#> 3471: Mobp 4 6.1045819 0.01621459 0.97849462
#> detection_gini expression_rank detection_rank comb_score comb_rank
#> <num> <num> <num> <num> <int>
#> 1: 0.480512956 1.00 1.00 2.327084e-01 1
#> 2: 0.462963624 1.00 1.00 2.094883e-01 2
#> 3: 0.395271870 1.00 0.85 1.435998e-01 3
#> 4: 0.396825403 0.85 0.85 1.212953e-01 4
#> 5: 0.324223187 1.00 1.00 1.121049e-01 5
#> ---
#> 3467: 0.008635794 0.10 0.25 4.117870e-06 630
#> 3468: 0.006564403 0.10 0.40 3.850988e-06 631
#> 3469: 0.003836637 0.10 0.85 3.549264e-06 632
#> 3470: 0.003688736 0.10 0.70 2.753962e-06 633
#> 3471: 0.003879016 0.10 0.10 6.289666e-07 634