merged_ewce combines enrichment results from multiple studies targetting the same scientific problem

merged_ewce(results, reps = 100)

Arguments

results

a list of EWCE results generated using add_res_to_merging_list.

reps

Number of random gene lists to generate (Default=100 but should be >=10,000 for publication-quality results).

Value

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.

Examples

# Load the single cell data ctd <- ewceData::ctd()
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
# 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 # Load the data tt_alzh_BA36 <- ewceData::tt_alzh_BA36()
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
tt_alzh_BA44 <- ewceData::tt_alzh_BA44()
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
# Run EWCE analysis tt_results_36 <- EWCE::ewce_expression_data( sct_data = ctd, tt = tt_alzh_BA36, thresh = thresh, annotLevel = 1, reps = reps, ttSpecies = "human", sctSpecies = "mouse" )
#> Returning 10,854 unique genes from the user-supplied bg.
#> Standardising CellTypeDataset
#> Converting to sparse matrix.
#> Converting to sparse matrix.
#> Checking gene list inputs.
#> Retrieving all genes using: homologene.
#> Retrieving all organisms available in gprofiler.
#> Using stored `gprofiler_orgs`.
#> Mapping species name: human
#> Common name mapping found for human
#> 1 organism identified from search: 9606
#> Gene table with 19,129 rows retrieved.
#> Returning all 19,129 genes from human.
#> Standardising sct_data.
#> Converting gene list input to standardised human genes.
#> Running without gene size control.
#> 6 hit genes remain after filtering.
#> Computing summed proportions.
#> Testing for enrichment in 7 cell types...
#> Sorting results by p-value.
#> Computing BH-corrected q-values.
#> 1 significant cell type enrichment results @ q<0.05 :
#> CellType annotLevel p fold_change sd_from_mean q #> 1 oligodendrocytes 1 0 1.945157 3.480483 0
#> Returning 10,854 unique genes from the user-supplied bg.
#> Standardising CellTypeDataset
#> Converting to sparse matrix.
#> Converting to sparse matrix.
#> Checking gene list inputs.
#> Retrieving all genes using: homologene.
#> Retrieving all organisms available in gprofiler.
#> Using stored `gprofiler_orgs`.
#> Mapping species name: human
#> Common name mapping found for human
#> 1 organism identified from search: 9606
#> Gene table with 19,129 rows retrieved.
#> Returning all 19,129 genes from human.
#> Standardising sct_data.
#> Converting gene list input to standardised human genes.
#> Running without gene size control.
#> 5 hit genes remain after filtering.
#> Computing summed proportions.
#> Testing for enrichment in 7 cell types...
#> Sorting results by p-value.
#> Computing BH-corrected q-values.
#> 2 significant cell type enrichment results @ q<0.05 :
#> CellType annotLevel p fold_change sd_from_mean q #> 1 microglia 1 0 1.422840 0.8918925 0 #> 2 pyramidal SS 1 0 1.146459 0.7165786 0
tt_results_44 <- EWCE::ewce_expression_data( sct_data = ctd, tt = tt_alzh_BA44, thresh = thresh, annotLevel = 1, reps = reps, ttSpecies = "human", sctSpecies = "mouse" )
#> Returning 10,854 unique genes from the user-supplied bg.
#> Standardising CellTypeDataset
#> Converting to sparse matrix.
#> Converting to sparse matrix.
#> Checking gene list inputs.
#> Retrieving all genes using: homologene.
#> Retrieving all organisms available in gprofiler.
#> Using stored `gprofiler_orgs`.
#> Mapping species name: human
#> Common name mapping found for human
#> 1 organism identified from search: 9606
#> Gene table with 19,129 rows retrieved.
#> Returning all 19,129 genes from human.
#> Standardising sct_data.
#> Converting gene list input to standardised human genes.
#> Running without gene size control.
#> 6 hit genes remain after filtering.
#> Computing summed proportions.
#> Testing for enrichment in 7 cell types...
#> Sorting results by p-value.
#> Computing BH-corrected q-values.
#> 2 significant cell type enrichment results @ q<0.05 :
#> CellType annotLevel p fold_change sd_from_mean q #> 1 oligodendrocytes 1 0 1.438299 4.677587 0 #> 2 endothelial-mural 1 0 1.923386 3.394031 0
#> Returning 10,854 unique genes from the user-supplied bg.
#> Standardising CellTypeDataset
#> Converting to sparse matrix.
#> Converting to sparse matrix.
#> Checking gene list inputs.
#> Retrieving all genes using: homologene.
#> Retrieving all organisms available in gprofiler.
#> Using stored `gprofiler_orgs`.
#> Mapping species name: human
#> Common name mapping found for human
#> 1 organism identified from search: 9606
#> Gene table with 19,129 rows retrieved.
#> Returning all 19,129 genes from human.
#> Standardising sct_data.
#> Converting gene list input to standardised human genes.
#> Running without gene size control.
#> 5 hit genes remain after filtering.
#> Computing summed proportions.
#> Testing for enrichment in 7 cell types...
#> Sorting results by p-value.
#> Computing BH-corrected q-values.
#> 1 significant cell type enrichment results @ q<0.05 :
#> CellType annotLevel p fold_change sd_from_mean q #> 1 pyramidal CA1 1 0 1.359822 3.275729 0
# Fill a list with the results results <- EWCE::add_res_to_merging_list(tt_results_36) results <- EWCE::add_res_to_merging_list(tt_results_44, results) # Perform the merged analysis # For publication reps should be higher merged_res <- EWCE::merged_ewce( results = results, reps = 2 ) print(merged_res)
#> CellType p fc sd_from_mean #> astrocytes_ependymal astrocytes_ependymal 0.10910 1.1678985 1.16198959 #> endothelial-mural endothelial-mural 0.10710 1.1688657 1.25405010 #> interneurons interneurons 0.67155 0.7853842 -0.69648688 #> microglia microglia 0.55440 0.7672514 -0.53308113 #> oligodendrocytes oligodendrocytes 0.00000 1.6584841 6.20503534 #> pyramidal CA1 pyramidal CA1 0.66670 0.8605966 -0.90599247 #> pyramidal SS pyramidal SS 0.77715 0.8408472 -0.67325296 #> astrocytes_ependymal1 astrocytes_ependymal 0.33665 1.0835837 0.44723149 #> endothelial-mural1 endothelial-mural 0.55350 0.7635425 -0.66420002 #> interneurons1 interneurons 1.00000 0.8301179 -1.47510472 #> microglia1 microglia 0.22160 1.0609015 0.23482404 #> oligodendrocytes1 oligodendrocytes 0.33665 1.3615614 0.88132354 #> pyramidal CA11 pyramidal CA1 0.00000 1.1758751 2.24622798 #> pyramidal SS1 pyramidal SS 0.33490 1.0068599 0.03247843 #> Direction #> astrocytes_ependymal Up #> endothelial-mural Up #> interneurons Up #> microglia Up #> oligodendrocytes Up #> pyramidal CA1 Up #> pyramidal SS Up #> astrocytes_ependymal1 Down #> endothelial-mural1 Down #> interneurons1 Down #> microglia1 Down #> oligodendrocytes1 Down #> pyramidal CA11 Down #> pyramidal SS1 Down