I currently have a seurat object scData
in which I have applied module scored by using AddModuleScore
.
AddModuleScore(scData, features = inflam, name = "inflam_score", seed = 1, search = FALSE, assay = NULL, nbin = 21, ctrl = 100, pool = NULL)
I've gone ahead and plotted a violin plot to see a visual by doing:
VlnPlot(scData, features = c("inflam_score1"), pt.size = 0) + NoLegend() + theme(axis.text.x = element_text(angle = 90, hjust = 1))
Is there a way to add a p-value to the output?
I tried:
VlnPlot(scData, features = c("inflam_score1"), pt.size = 0) + stat_compare_means()
But get this error:
Error in stat_compare_means() : could not find function "stat_compare_means"
I tried:
VlnPlot(scData, features = c("inflam_score1"), pt.size = 0) + stat_compare_means()
But get this error:
Error in stat_compare_means() : could not find function "stat_compare_means"
UPDATE:
I needed to load the ggpubr
package to get the p-values.
But since I have more than to 2 pair, how would I go about adding a global p-value plus the p-values for more than 2 groups.[![enter image description here][1]][1]
I tried:
my_comparisons <- list( c("hIgG2_mIgG2", "NIS793_mIgG2"), c("hIgG2_aIL_1b", "NIS793_aIL_1b"))
VlnPlot(fib_395, features = c("trans_score1"), pt.size = 0) + stat_compare_means(comparisons = my_comparisons) + stat_compare_means()
But I get this warning and no p-values show up:
Warning: Removed 6 rows containing missing values (geom_signif).