Data is assumed to be tidy with a single grouping variable; all other variables are treated as activities to compare. Descriptive columns like cell_id should not be included.

stat_activity_grouped(tbl, group, complete = FALSE, ...)

Arguments

tbl

data from a SingleCellExperiment

group

variable for generating combinations

complete

If TRUE, generate complete group combinations (useful for e.g., matrix visulatization of p-values). Default is FALSE, generating unique groups combinations.

...

additional parameters to pass to calc_qvalues().

Value

tibble, sorted by q.value

  • activity

  • group

  • group1

  • ratio (ratio of the median signals in group over group1)

  • p.value

  • q.value

Details

Applies stats::wilcox.test() to unique pairs of groups for each measured variable. Adjusted p-values are calculated using qvalue::qvalue(). A ratio of activity in each group is reported; Inf values indicate that no activities were measured for the second group.

References

doi: 10.1038/nmeth.4612

Examples

x <- fsce_tidy[c("k_cluster", "Uracil_45", "riboG_44")] stat_activity_grouped(x, group = k_cluster)
#> # A tibble: 30 x 6 #> activity group group1 ratio p.value q.value #> <chr> <chr> <chr> <dbl> <dbl> <dbl> #> 1 Uracil_45 1 6 3.91 2.91e-14 8.73e-13 #> 2 riboG_44 1 3 2.87 2.60e-13 3.90e-12 #> 3 Uracil_45 1 5 1.35 1.90e- 7 1.58e- 6 #> 4 Uracil_45 5 6 2.89 2.11e- 7 1.58e- 6 #> 5 Uracil_45 1 3 1.64 1.17e- 6 7.00e- 6 #> 6 riboG_44 1 5 1.41 1.77e- 5 8.85e- 5 #> 7 Uracil_45 1 2 1.34 1.67e- 4 7.15e- 4 #> 8 riboG_44 1 2 1.43 2.42e- 4 9.08e- 4 #> 9 Uracil_45 2 6 2.92 7.07e- 4 2.36e- 3 #> 10 Uracil_45 3 6 2.38 8.72e- 4 2.62e- 3 #> # … with 20 more rows