Commit f39cae88 authored by Valentina Galata's avatar Valentina Galata
Browse files

report: mmseqs2: highlight only combis included in top N shown (issue #119)

parent bda364f2
...@@ -621,15 +621,18 @@ plot_diamondDB_density2d <- function(df){ ...@@ -621,15 +621,18 @@ plot_diamondDB_density2d <- function(df){
return(pp) return(pp)
} }
plot_mmseqs2_overlap <- function(df){ plot_mmseqs2_overlap <- function(df, topN=20){
# cluster summary: number of proteins in clusters grouped by represented tools # cluster summary: number of proteins in clusters grouped by represented tools
upsetr_input <- UpSetR::fromExpression(t(df %>% select(members))[1,,drop=TRUE]) upsetr_input <- UpSetR::fromExpression(t(df %>% select(members))[1,,drop=TRUE])
testit::assert(all( colnames(upsetr_input) %in% ASM_TOOL_NAMES )) testit::assert(all( colnames(upsetr_input) %in% ASM_TOOL_NAMES ))
upsetr_input <- upsetr_input[,ASM_TOOL_NAMES,drop=FALSE] upsetr_input <- upsetr_input[,ASM_TOOL_NAMES,drop=FALSE]
topN_combis <- rownames(df[with(df, order(-members)), ])[1:topN]
UpSetR::upset( UpSetR::upset(
upsetr_input, upsetr_input,
keep.order=TRUE,
nsets=ncol(upsetr_input), nsets=ncol(upsetr_input),
nintersects=20, sets=ASM_TOOL_NAMES,
nintersects=topN,
order.by="freq", order.by="freq",
decreasing=TRUE, decreasing=TRUE,
# titles # titles
...@@ -641,7 +644,7 @@ plot_mmseqs2_overlap <- function(df){ ...@@ -641,7 +644,7 @@ plot_mmseqs2_overlap <- function(df){
queries=c( queries=c(
# unique proteins # unique proteins
lapply( lapply(
colnames(upsetr_input), intersect(colnames(upsetr_input), topN_combis),
function(x){ list(query=intersects, params=list(x), active=TRUE, color=MMSEQS2_UPSETR_HIGHLIGHTS["unique"]) } function(x){ list(query=intersects, params=list(x), active=TRUE, color=MMSEQS2_UPSETR_HIGHLIGHTS["unique"]) }
), ),
# all tools # all tools
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment