contrast_each_group_to_the_rest {celaref} | R Documentation |
Produces a table of within-experiment differential expression results (for either query or reference experiment), where each group (cluster) is compared to the rest of the cells.
contrast_each_group_to_the_rest(dataset_se, dataset_name, groups2test = NA, num_cores = 2)
dataset_se |
Summarised experiment object containing count data. Also
requires 'ID' and 'group' to be set within the cell information
(see |
dataset_name |
Short, meaningful name for this dataset/experiment. |
groups2test |
An optional character vector specificing specific groups to check. By default (set to NA), all groups will be tested. |
num_cores |
Number of cores to use to run MAST jobs in parallel. Ignored if parallel package not available. Set to 1 to avoid parallelisation. Default = 2 |
Note that this function is slow, because it runs the differential expression. It only needs to be run once per dataset though (unless group labels change). Having package parallel installed is highly recomended.
Both reference and query datasets should be processed with this function.
The tables produced by this function (usually named something like de_table.datasetname) contain summarised results of MAST results. Each group is compared versus cells in the group, versus not in the group, (Ie. always a 2-group contrast, other groups information is ignored). As per MAST reccomendataions, the proportion of genes seen in each cell is included in the model.
A tibble the within-experiment de_table (differential expression table). This is a core summary of the individual experiment/dataset, which is used for the cross-dataset comparisons.
The table feilds won't neccesarily match across datasets, as they include cell annotations information. Important columns (used in downstream analysis) are:
Gene identifier
Inner (conservative) 95% confidence interval of log2 fold-change.
Multiple hypothesis corrected p-value (using BH/FDR method)
Cells from this group were compared to everything else
Significnatly differentially expressed (fdr < 0.01), with a positive fold change?
Rank position (within group), ranked by CI inner, highest to lowest.
Rank scaled 0(top most overrepresented genes in group) - 1(top most not-present genes)
Name of dataset/experiment
de_table.demo_query <- contrast_each_group_to_the_rest( demo_query_se, "a_demo_query") ## Not run: de_table.demo_ref <- contrast_each_group_to_the_rest( demo_ref_se, "a_demo_ref", num_cores=4) ## End(Not run)