DAtest icon indicating copy to clipboard operation
DAtest copied to clipboard

Implement UpsetDA

Open malcook opened this issue 2 years ago • 0 comments

  • Name/description of method UpSetDA
  • Link to publication if it exists https://jokergoo.github.io/ComplexHeatmap-reference/book/upset-plot.html
  • Is the method already implemented in R? Yes

propose implementation:

library(ComplexHeatmap)
UpSetDA<-function(x,tests=names(x$results),alpha=0.01,...) {
  lt<-lapply(x$results[tests],function(result) result[result$pval.adj<=alpha,'Feature'])
  m = ComplexHeatmap::make_comb_mat(lt)
  ComplexHeatmap::UpSet(m,...,
                        top_annotation = upset_top_annotation(m, add_numbers = TRUE),
                        right_annotation = upset_right_annotation(m, add_numbers = TRUE)
                        )
}

(More?) Useful wherever vennDA might be used. Example:

testa <- allDA(df, predictor = vec,relative=FALSE,       core.check=FALSE)
compareTest<-c("lrm","lim","aov")
vennDA(testa, tests = compareTest,0.001)
UpSetDA(testa,compareTest,0.001)

image

malcook avatar Jun 18 '22 21:06 malcook