ewce_expression_data takes a differential expression table and determines the probability of cell-type enrichment in the up & down regulated genes

ewce_expression_data(
  sct_data,
  annotLevel = 1,
  tt,
  sortBy = "t",
  thresh = 250,
  reps = 100,
  ttSpecies = "mouse",
  sctSpecies = "mouse"
)

Arguments

sct_data

List generated using generate_celltype_data

annotLevel

an integer indicating which level of the annotation to analyse. Default = 1.

tt

Differential expression table. Can be output of limma::topTable function. Minimum requirement is that one column stores a metric of increased/decreased expression (i.e. log fold change, t-statistic for differential expression etc) and another contains either HGNC or MGI symbols.

sortBy

Column name of metric in tt which should be used to sort up- from down- regulated genes. Default="t"

thresh

The number of up- and down- regulated genes to be included in each analysis. Default=250

reps

Number of random gene lists to generate (default=100 but should be over 10000 for publication quality results)

ttSpecies

Either 'mouse' or 'human' depending on which species the differential expression table was generated from

sctSpecies

Either 'mouse' or 'human' depending on which species the single cell data was generated from

Value

A list containing five data frames:

  • results: dataframe in which each row gives the statistics (p-value, fold change and number of standard deviations from the mean) associated with the enrichment of the stated cell type in the gene list. An additional column *Direction* stores whether it the result is from the up or downregulated set.

  • hit.cells.up: vector containing the summed proportion of expression in each cell type for the target list

  • hit.cells.down: vector containing the summed proportion of expression in each cell type for the target list#'

  • bootstrap_data.up: matrix in which each row represents the summed proportion of expression in each cell type for one of the random lists

  • bootstrap_data.down: matrix in which each row represents the summed proportion of expression in each cell type for one of the random lists

Examples

library(ewceData) # Load the single cell data ctd <- ctd()
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
# Set the parameters for the analysis # Use 3 bootstrap lists for speed, for publishable analysis use >10000 reps <- 3 # Use 5 up/down regulated genes (thresh) for speed, default is 250 thresh = 5 annotLevel <- 1 # <- Use cell level annotations (i.e. Interneurons) # Load the top table tt_alzh <- tt_alzh()
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
tt_results <- ewce_expression_data( sct_data = ctd, tt = tt_alzh, annotLevel = 1, thresh = thresh, reps = reps, ttSpecies = "human", sctSpecies = "mouse" )
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
#> Tbc1d2b, Cxcr4, Nrip2, Sox12, Selplg
#> astrocytes_ependymal
#> 1
#>
#> endothelial-mural
#> 0
#> Fold enrichment: 2.15939656808996
#> Standard deviations from mean: 2.12704248258333
#>
#> interneurons
#> 0.333333333333333
#>
#> microglia
#> 0
#> Fold enrichment: 2.38180905035279
#> Standard deviations from mean: 2.91053189668301
#>
#> oligodendrocytes
#> 0.666666666666667
#>
#> pyramidal CA1
#> 1
#>
#> pyramidal SS
#> 1
#>
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
#> Cirbp, Camk1g, Nat10, Sema3a, Sssca1
#> astrocytes_ependymal
#> 1
#>
#> endothelial-mural
#> 1
#>
#> interneurons
#> 0.333333333333333
#>
#> microglia
#> 1
#>
#> oligodendrocytes
#> 0.333333333333333
#>
#> pyramidal CA1
#> 0
#> Fold enrichment: 1.35828266686707
#> Standard deviations from mean: 1.30233163542232
#>
#> pyramidal SS
#> 0
#> Fold enrichment: 2.15397179076472
#> Standard deviations from mean: 3.58197688157336
#>