4
$\begingroup$

I have a dataset with 90 different sets of GO terms (e.g. one set would be ("GO:0014075", "GO:0060742", "GO:2001238", "GO:0071478"). I want to plot the overlap between all of these groups. I don't know what, if any, type of plots are used for showing overlap between many groups. For a smaller set of groups I could use a venn diagram, but this does not work with a large group of comparisons.

What type of plot can be used for plotting the overlap between many groups?

$\endgroup$
2
  • $\begingroup$ How many different terms does the union of your sets contain? $\endgroup$ Apr 7 '14 at 9:57
  • $\begingroup$ @StephanKolassa 267 $\endgroup$
    – Niek
    Apr 7 '14 at 10:55
3
$\begingroup$

Would something like this be a start? enter image description here This shows which terms show up in which sets. Intersections on specific terms are given by dots at the same $x$ position.

The ordering may be helpful... or it may be misleading. You will have to consider your specific application.

Of course, the problem is that we can't distinguish the sets (the $y$ axis labels) any more. I suspect that this will always be hard with 90 groups. Possibilities may be:

  • Limiting the plot to "important" groups (defined according to your specific application)
  • Grouping sets into groups of horizontal dots
  • Working with colors if sets can be grouped meaningfully
  • Only putting every second set name on the left side, and the others on the right

The same problem will occur if you have more than 20 terms overall. Similar remedies may be possible.

R code:

set.seed(1)
terms <- sprintf("%07i",round(100000*runif(20),0))

sets <- sapply(1:90,FUN=function(y)sample(x=terms,size=rpois(1,2)+1))
names(sets) <- paste("A",1:length(sets),sep="")

tab <- t(sapply(sets,function(xx)table(factor(xx,levels=terms))))
tab <- tab[,order(colSums(tab),decreasing=TRUE)]
tab <- tab[rev(do.call(order,as.data.frame(tab))),]

plot(c(1,length(terms)),c(1,length(sets)),type="n",xlab="",ylab="",xaxt="n",yaxt="n")
abline(h=seq_along(sets),col="grey",lty=3)
for ( ii in 1:nrow(tab) ) points(which(tab[ii,]==1),rep(nrow(tab)-ii+1,sum(tab[ii,])),pch=19)
axis(side=1,at=seq_along(terms),labels=colnames(tab),las=3)
axis(side=2,at=seq_along(sets),labels=rownames(tab),las=2)
$\endgroup$
1
  • $\begingroup$ I can break it up in three groups of 30, and when I remove the x-axis labels it looks quite good. Thanks! $\endgroup$
    – Niek
    Apr 7 '14 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.