PlotGroups - heatmap of p-values
Closed this issue · 0 comments
SamGG commented
Hi,
Here is my proposal for code
Lines 1606 to 1616 in af08bb6
I applied same correction as before (although not rigorous). I turned the score in the minus the log10 of the p-value (which is standard in volcano plot). I adapted the colour scale. I set the test as not exact in order to avoid warnings with tied values. Once again, this is just a proposal. I would prefer to get a symmetrical color scale, but this requires more job.
Cheers.
p_v <- rep(NA,ncol(values))
for(i in seq_len(ncol(values))){
test <- stats::wilcox.test(
values[groups$groups %in% groupnames[1],i],
values[groups$groups %in% group,i],
exact = FALSE)
p_v[i] <- test$p.value
}
diff <- groups$means[group,] - groups$means[groupnames[1],]
adj_p <- stats::p.adjust(p_v,"BH")
score <- -log10(adj_p) * (-1)^(diff < 0)