VennDiagram 畫文氏圖/維恩圖/Venn


用R包畫韋恩圖:

install.packages("VennDiagram")

-------------------------------------------
library(VennDiagram)

A = 1:150
B = c(121:170,300:320)
C = c(20:40,141:200)
Length_A<-length(A)
Length_B<-length(B)
Length_C<-length(C)
Length_AB<-length(intersect(A,B))
Length_BC<-length(intersect(B,C))
Length_AC<-length(intersect(A,C))
Length_ABC<-length(intersect(intersect(A,B),C))


T<-venn.diagram(list(A=A,B=B),filename=NULL
,lwd=1,lty=2
,col=c('red','green'),fill=c('red','green')
,cat.col=c('red','green')
,rotation.degree=90)
grid.draw(T)

-------------------------------------------
library(VennDiagram)

A = 1:150
B = c(121:170,300:320)
C = c(20:40,141:200)
Length_A<-length(A)
Length_B<-length(B)
Length_C<-length(C)
Length_AB<-length(intersect(A,B))
Length_BC<-length(intersect(B,C))
Length_AC<-length(intersect(A,C))
Length_ABC<-length(intersect(intersect(A,B),C))


T<-venn.diagram(list(A=A,B=B,C=C),filename=NULL
,lwd=1,lty=2,col=c('red','green','blue')
,fill=c('red','green','blue')
,cat.col=c('red','green','blue')
,reverse=TRUE)
grid.draw(T)

-------------------------------------------
library(VennDiagram)
draw.pairwise.venn(area1=Length_A,area2=Length_B,cross.area=Length_AB
,category=c('A','B'),lwd=rep(1,1),lty=rep(2,2)
,col=c('red','green'),fill=c('red','green')
,cat.col=c('red','green') )

-------------------------------------------
library(VennDiagram)
draw.triple.venn(area1=Length_A, area2=Length_B, area3=Length_C
,n12=Length_AB, n23=Length_BC, n13=Length_AC, n123=Length_ABC
,category = c('A','B','C')
,col=c('red','green','blue'),fill=c('red','green','blue')
,cat.col=c('red','green','blue')
,reverse = FALSE)
-------------------------------------------

## scaled venn diagram

library(VennDiagram)
draw.pairwise.venn(area1=2000,area2=200,cross.area=20
,category=c('A','B'),lwd=rep(1,1),lty=rep(2,2)
,col=c('red','green'),fill=c('red','green')
,cat.col=c('red','green') )

 

-------------------------------------------

install.packages("venneuler")

-------------------------------------------
library(venneuler)
library("venneuler")
vd <- venneuler(c(A=0.3, B=0.3, C=1.1, "A&B"=0.1, "A&C"=0.2, "B&C"=0.1 ,"A&B&C"=0.1))
plot(vd)

-------------------------------------------
library("venneuler")
vd <- venneuler(c(A=18700, B=8, "A&B"=377))
plot(vd)
-------------------------------------------

 

文氏圖(韋恩圖,venn圖)的基本概念:

https://www.lucidchart.com/pages/venn-diagram

https://www.mathsisfun.com/sets/venn-diagrams.html

Venn diagram glossary

Set A collection of things. Given the versatility of Venn Diagrams, the things can really be anything. The things may be called items, objects, members or similar terms.  
Union All items in the sets.  
Intersection The items that overlap in the sets. Sometimes called a subset.  
Symmetric difference of two sets Everything but the intersection.  
Absolute complement Everything not in the set.  
Relative complement  In one set but not the other.  
Scaled Venn Diagram Also called Area Proportional. The circles (or other shapes) are sized by their proportional representation of the whole.  
Reuleaux Triangle Shape formed from the intersection of three circulars or shapes, such as in a Venn Diagram.  
Set notations

The concepts illustrated in Venn Diagrams are expressed with mathematical notations such as those representing sets and subsets (in brackets), unions (with a U-like symbol) and intersections (with an upside-down U symbol.)

 
Set theory The longstanding branch of mathematics dealing with sets.  

 

在線畫韋恩圖(Draw venn diagram online):

BioVenn - a web application for the comparison and visualization of biological lists using area-proportional Venn diagrams

http://www.biovenn.nl/

http://bioinformatics.psb.ugent.be/webtools/Venn/

http://bioinfogp.cnb.csic.es/tools/venny/index.html

 http://www.pangloss.com/seidel/Protocols/venn.cgi

 http://jura.wi.mit.edu/bioc/tools/venn.php

 

其它畫韋恩圖的工具軟件(Other tools):

eulerAPE: Drawing Area-Proportional Euler and Venn Diagrams

http://www.eulerdiagrams.org/eulerAPE/

 

相關資料(Related resources):

https://stackoverflow.com/questions/11727068/scaling-triple-venn-diagram-in-r-with-venndiagram-package

http://cran.r-project.org/web/packages/VennDiagram/VennDiagram.pdf

https://www.biostars.org/p/7713/

 http://www.conceptdraw.com/helpdesk/how-to-draw-venn-diagram

http://www.conceptdraw.com/samples/diagrams-venn

https://softwarerecs.stackexchange.com/questions/25706/library-to-generate-a-scaled-4-set-venn-diagram

 

Papers:

http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0101717

https://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-12-35

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM