2
$\begingroup$

From my microarray data I have selected three subsets of probes. I would like to display these subsets as a Euler diagram to visualize the overlaps, but am struggling with inputting the combinations into Eulerr. All three subsets need to be nested within the full set of probes; one subset is fully contained within another, and the third overlaps with the other two. Is there a package into which I could feed the vectors of probe names and let it determine the overlaps for me? Many thanks in advance!

$\endgroup$
2
$\begingroup$

Since you are in R, consider using the UpsetR library. It doesn't make Venn diagrams but it helps to visualize overlaps between any number of groups.

http://gehlenborglab.org/research/projects/upsetr/#:~:text=UpSetR%20is%20an%20R%20package,based%20on%20groupings%20and%20queries.

$\endgroup$
0
$\begingroup$

You might consider different ways of using the venneuler package. I'm not super thrilled with its usability (or with the accuracy of the overlaps), but you can get it to make custom Venn diagrams.

Here is a thread with some suggestions along these lines.

Below is some sample R code that I slightly modified from an old project that I used to make a 3-category Venn diagram.

I didn't run this to make sure that it works because of an irritating Java dependency issue on my OSX laptop that I don't feel like fixing right now, but as long as you have a JDK on your machine and can install the packages it should work.

# note irritating rJava dependency of venneuler
library(plotrix)
library(venneuler)

#A-B sharing: 200414
#B-C sharing: 17561
#A-C sharing: 16764
#All share 14201

# get coordinates for circles- replace as needed
# this function is supposed to plot stuff, but doesn't actually
ven = venneuler(c(C=48147-17561-16764+14201, 
                  B=347181-17561-200414+14201, 
                  A=325971-200414-16764+14201, 
                  "C&B"=17561, "B&A"=200414, "C&A"=16764, "A&B&C"=14201))

cats = c('A','B','C')

# note- this following only shows up in the .pdf printer, not in the X11 utility plotter
pdf('venn.pdf')
plot(c(-.5,1.5), c(-.5,1.5), type='n', xaxt='n', yaxt='n', bty='n', xlab='', ylab='')
draw.circle(ven$center[1,1], ven$center[1,2], ven$diameters[1],
        col = hsv(1,1,1,.5))
draw.circle(ven$center[2,1], ven$center[2,2], ven$diameters[2], 
            col = hsv(.5,1,1,.5))
draw.circle(ven$center[3,1], ven$center[3,2], ven$diameters[3],
            col = hsv(.1,1,1,.5))

text(ven$center[1,1]+.065, ven$center[1,2], labels=cats[3], cex=1.3)
text(ven$center[2,1], ven$center[2,2]-.2, labels=cats[2], cex=1.3)
text(ven$center[3,1], ven$center[3,2]+.2, labels=cats[1], cex=1.3)

dev.off()
$\endgroup$

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.