Calculate the mean ratio value and rank for each gene for each cell type in the sce object, to identify effective marker genes for deconvolution.

get_mean_ratio2(
  sce,
  cellType_col = "cellType",
  assay_name = "logcounts",
  add_symbol = TRUE
)

Arguments

sce

SummarizedExperiment-class object

cellType_col

A character(1) name of the column in the colData() of sce that denotes the cell type or group of interest

assay_name

A character(1) specifying the name of the assay() in the sce object to use to rank expression values. Defaults to logcounts since it typically contains the normalized expression values.

add_symbol

a logical indicating whether the gene symbol column to the marker stats table

Value

Table of mean ratio for each x cell type

Details

Improved efficiency and ability to handle large data sets from get_mean_ratio().

Examples

#' ## load example SingleCellExperiment
if (!exists("sce_DLPFC_example")) sce_DLPFC_example <- fetch_deconvo_data("sce_DLPFC_example")
#> 2024-08-06 18:48:11.430654 loading file /github/home/.cache/R/BiocFileCache/3f6448e07fb_sce_DLPFC_example.Rdata%3Frlkey%3Dv3z4u8ru0d2y12zgdl1az07q9%26st%3D1dcfqc1i%26dl%3D1

## Get the mean ratio for each gene for each cell type defined in `cellType_broad_hc`
get_mean_ratio2(sce_DLPFC_example, cellType_col = "cellType_broad_hc")
#> # A tibble: 762 × 8
#>    gene  cellType.target mean.target cellType   mean ratio rank_ratio anno_ratio
#>    <chr> <fct>                 <dbl> <fct>     <dbl> <dbl>      <int> <chr>     
#>  1 CD22  Oligo                  1.36 OPC      0.0730  18.6          1 Oligo/OPC…
#>  2 LINC… Oligo                  2.39 Micro    0.142   16.8          2 Oligo/Mic…
#>  3 FOLH1 Oligo                  1.59 OPC      0.101   15.7          3 Oligo/OPC…
#>  4 SLC5… Oligo                  2.14 Micro    0.145   14.7          4 Oligo/Mic…
#>  5 AC01… Oligo                  2.42 OPC      0.169   14.3          5 Oligo/OPC…
#>  6 ST18  Oligo                  4.65 OPC      0.329   14.1          6 Oligo/OPC…
#>  7 MAG   Oligo                  1.44 Astro    0.103   14.0          7 Oligo/Ast…
#>  8 ANLN  Oligo                  1.60 Micro    0.115   13.9          8 Oligo/Mic…
#>  9 CLDN… Oligo                  1.82 EndoMur… 0.146   12.5          9 Oligo/End…
#> 10 MOG   Oligo                  2.06 OPC      0.185   11.1         10 Oligo/OPC…
#> # ℹ 752 more rows

#  gene       cellType.target mean.target cellType    mean ratio rank_ratio anno_ratio
#<chr>      <fct>                 <dbl> <fct>      <dbl> <dbl>      <int> <chr>
# 1 CD22       Oligo                  1.36 OPC       0.0730  18.6          1 Oligo/OPC: 18.625
# 2 LINC01608  Oligo                  2.39 Micro     0.142   16.8          2 Oligo/Micro: 16.829
# 3 FOLH1      Oligo                  1.59 OPC       0.101   15.7          3 Oligo/OPC: 15.684
# 4 SLC5A11    Oligo                  2.14 Micro     0.145   14.7          4 Oligo/Micro: 14.697
# 5 AC012494.1 Oligo                  2.42 OPC       0.169   14.3          5 Oligo/OPC: 14.282