Russel88 / DAtest

Compare different differential abundance and expression methods
GNU General Public License v3.0
49 stars 9 forks source link

Implement UpsetDA #21

Open malcook opened 2 years ago

malcook commented 2 years ago

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