venn diagrams
2
0
Entering edit mode
David Lyon ▴ 340
@david-lyon-4016
Last seen 3.0 years ago
United States
Sorry newbie question. If I had 6 files named 1,2,3,4 each file containing a ID eg: ENST00000326632 etc. Can someone provide the code that loads each file and generates a Venn Diagram displaying the intersection/unique/union of the data sets in both a table format and a diagramatic format like a jpeg ? Thanks in advance.
• 3.7k views
ADD COMMENT
0
Entering edit mode
@thomas-hampton-2820
Last seen 10.2 years ago
You might try gplots: venn package:gplots R Documentation Plot a Venn diagram Description: Plot Venn diagrams for up to 5 sets Usage: venn(data, universe=NA, small=0.7, showSetLogicLabel=FALSE, simplify=FALSE, show.plot=TRUE) best, Tom On Jun 2, 2010, at 3:48 PM, David Lyon wrote: > Sorry newbie question. > > If I had 6 files named 1,2,3,4 each file containing a ID eg: > > ENST00000326632 > etc. > > Can someone provide the code that loads each file and generates a > Venn Diagram displaying the intersection/unique/union of the data > sets in both a table format and a diagramatic format like a jpeg ? > > Thanks in advance. > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD COMMENT
0
Entering edit mode
Thanks Thomas can you or someone give me a clue on how to load the files and then generate a venn diagram and the various data sets that lists the union/intesect/unique members. I have read the gplots but its not clear to me as a newbie. ----- Original Message ---- From: Thomas Hampton <thomas.h.hampton@dartmouth.edu> To: David Lyon <david_lyon3 at="" yahoo.com=""> Cc: bioconductor at stat.math.ethz.ch Sent: Wed, June 2, 2010 4:03:07 PM Subject: Re: [BioC] venn diagrams You might try gplots: venn package:gplots R Documentation Plot a Venn diagram Description: Plot Venn diagrams for up to 5 sets Usage: venn(data, universe=NA, small=0.7, showSetLogicLabel=FALSE, simplify=FALSE, show.plot=TRUE) best, Tom On Jun 2, 2010, at 3:48 PM, David Lyon wrote: > Sorry newbie question. > > If I had 6 files named 1,2,3,4 each file containing a ID eg: > > ENST00000326632 > etc. > > Can someone provide the code that loads each file and generates a Venn Diagram displaying the intersection/unique/union of the data sets in both a table format and a diagramatic format like a jpeg ? > > Thanks in advance. > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD REPLY
0
Entering edit mode
You can try overLapper function in BioC instruction. It will do up to five lists. Steve On Wed, Jun 2, 2010 at 5:10 PM, David Lyon <david_lyon3@yahoo.com> wrote: > Thanks Thomas > > can you or someone give me a clue on how to load the files and then > generate a venn diagram and the various data sets that lists the > union/intesect/unique members. I have read the gplots but its not clear to > me as a newbie. > > > > > > > ----- Original Message ---- > From: Thomas Hampton <thomas.h.hampton@dartmouth.edu> > To: David Lyon <david_lyon3@yahoo.com> > Cc: bioconductor@stat.math.ethz.ch > Sent: Wed, June 2, 2010 4:03:07 PM > Subject: Re: [BioC] venn diagrams > > You might try gplots: > > venn package:gplots R Documentation > > Plot a Venn diagram > > Description: > > Plot Venn diagrams for up to 5 sets > > Usage: > > venn(data, universe=NA, small=0.7, showSetLogicLabel=FALSE, > simplify=FALSE, show.plot=TRUE) > > best, > > Tom > > On Jun 2, 2010, at 3:48 PM, David Lyon wrote: > > > Sorry newbie question. > > > > If I had 6 files named 1,2,3,4 each file containing a ID eg: > > > > ENST00000326632 > > etc. > > > > Can someone provide the code that loads each file and generates a Venn > Diagram displaying the intersection/unique/union of the data sets in both a > table format and a diagramatic format like a jpeg ? > > > > Thanks in advance. > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor@stat.math.ethz.ch > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
Thanks Steve I used this tutorial: http://manuals.bioinformatics.ucr.edu/home/R_BioCondManual#R_graphics_ venn which clearly demonstrates how to use OverLapper. I only wished that all the packages from R and bioconductor could be written with the clarity and simplicity as the tutorial above..... ________________________________ From: Steve Shen <sshen@bu.edu> Cc: Thomas Hampton <thomas.h.hampton@dartmouth.edu>; bioconductor@stat.math.ethz.ch Sent: Wed, June 2, 2010 6:51:04 PM Subject: Re: [BioC] venn diagrams You can try overLapper function in BioC instruction. It will do up to five lists. Steve Thanks Thomas > >>can you or someone give me a clue on how to load the files and then generate a venn diagram and the various data sets that lists the union/intesect/unique members. I have read the gplots but its not clear to me as a newbie. > > > > > > >>----- Original Message ---- >>From: Thomas Hampton <thomas.h.hampton@dartmouth.edu> >>Cc: bioconductor@stat.math.ethz.ch >>Sent: Wed, June 2, 2010 4:03:07 PM >>Subject: Re: [BioC] venn diagrams > >>You might try gplots: > >>venn package:gplots R Documentation > >>Plot a Venn diagram > >>Description: > >> Plot Venn diagrams for up to 5 sets > >>Usage: > >> venn(data, universe=NA, small=0.7, showSetLogicLabel=FALSE, >> simplify=FALSE, show.plot=TRUE) > >>best, > >>Tom > >>On Jun 2, 2010, at 3:48 PM, David Lyon wrote: > >>> Sorry newbie question. >>> >>> If I had 6 files named 1,2,3,4 each file containing a ID eg: >>> >>> ENST00000326632 >>> etc. >>> >>> Can someone provide the code that loads each file and generates a Venn Diagram displaying the intersection/unique/union of the data sets in both a table format and a diagramatic format like a jpeg ? >>> >>> Thanks in advance. > >> >>> _______________________________________________ >>> Bioconductor mailing list >>> Bioconductor@stat.math.ethz.ch >>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > >>_______________________________________________ >>Bioconductor mailing list >Bioconductor@stat.math.ethz.ch >https://stat.ethz.ch/mailman/listinfo/bioconductor >>Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
David Lyon ▴ 340
@david-lyon-4016
Last seen 3.0 years ago
United States
Does anyone know the answer to this simple question library(gplots) This works great from the console: A <- c(1,2,3,4) B <- c(1,2,3,4) C <- c(1,2,3,4) input<-list(A,B,C) venn(input) When I input the data from flat files each containing in a single col it is only using the first row from each file in the venn diagram eg: A <- ("A.file") B <- ("B.file") C <- ("C.file") input<-list(A,B,C) venn(input) its returns the venn diagram from only the first row from each file , how do I change the code so it uses every data point in each column. Thanks contents of A.file 1 2 3 4 contents of B.file 1 2 3 4 contents of C.file 1 2 3 4 ________________________________ To: Steve Shen <sshen@bu.edu> Cc: Thomas Hampton <thomas.h.hampton@dartmouth.edu>; bioconductor@stat.math.ethz.ch Sent: Wed, June 2, 2010 7:06:34 PM Subject: Re: [BioC] venn diagrams Thanks Steve I used this tutorial: http://manuals.bioinformatics.ucr.edu/home/R_BioCondManual#R_graphics_ venn which clearly demonstrates how to use OverLapper. I only wished that all the packages from R and bioconductor could be written with the clarity and simplicity as the tutorial above..... ________________________________ From: Steve Shen <sshen@bu.edu> Cc: Thomas Hampton <thomas.h.hampton@dartmouth.edu>; bioconductor@stat.math.ethz.ch Sent: Wed, June 2, 2010 6:51:04 PM Subject: Re: [BioC] venn diagrams You can try overLapper function in BioC instruction. It will do up to five lists. Steve Thanks Thomas > >>can you or someone give me a clue on how to load the files and then generate a venn diagram and the various data sets that lists the union/intesect/unique members. I have read the gplots but its not clear to me as a newbie. > > > > > > >>----- Original Message ---- >>From: Thomas Hampton <thomas.h.hampton@dartmouth.edu> >>Cc: bioconductor@stat.math.ethz.ch >>Sent: Wed, June 2, 2010 4:03:07 PM >>Subject: Re: [BioC] venn diagrams > >>You might try gplots: > >>venn package:gplots R Documentation > >>Plot a Venn diagram > >>Description: > >> Plot Venn diagrams for up to 5 sets > >>Usage: > >> venn(data, universe=NA, small=0.7, showSetLogicLabel=FALSE, >> simplify=FALSE, show.plot=TRUE) > >>best, > >>Tom > >>On Jun 2, 2010, at 3:48 PM, David Lyon wrote: > >>> Sorry newbie question. >>> >>> If I had 6 files named 1,2,3,4 each file containing a ID eg: >>> >>> ENST00000326632 >>> etc. >>> >>> Can someone provide the code that loads each file and generates a Venn Diagram displaying the intersection/unique/union of the data sets in both a table format and a diagramatic format like a jpeg ? >>> >>> Thanks in advance. > >> >>> _______________________________________________ >>> Bioconductor mailing list >>> Bioconductor@stat.math.ethz.ch >>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > >>_______________________________________________ >>Bioconductor mailing list >Bioconductor@stat.math.ethz.ch >https://stat.ethz.ch/mailman/listinfo/bioconductor >>Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
On 06/05/2010 06:45 PM, David Lyon wrote: > Does anyone know the answer to this simple question > library(gplots) > > This works great from the console: > A <- c(1,2,3,4) > B <- c(1,2,3,4) > C <- c(1,2,3,4) > input<-list(A,B,C) > venn(input) > > When I input the data from flat files each containing in a single col it is only using the first row from each file in the venn diagram > eg: > A <- ("A.file") > B <- ("B.file") > C <- ("C.file") > input<-list(A,B,C) > venn(input) > > its returns the venn diagram from only the first row from each file , how do I change the code so it uses every data point in each column. Hello, the input (?data? in the ?venn man page) should be a named list of _vectors_ . If it is something else, try converting it, maybe like as.vector? I am not familiar with your syntax to read in files. > a<-("b") > a [1] "b" Maybe something like read.table or so is what you really want? Just guessing Steffen
ADD REPLY
0
Entering edit mode
Thanks for your efforts Steffen. If anyone knows exactly how to get this working I would be appreciative: eg: library(gplots) A <- read.delim ("A.file") B <- read.delim ("B.file") C <- read.delim ("C.file") input<-list(A,B,C) venn(input) its returns the venn diagram from only the first row from each file , how do I change the code so it uses every data point in each column. Thanks contents of A.file 1 2 3 4 contents of B.file 1 2 3 4 contents of C.file 1 2 3 4
ADD REPLY
0
Entering edit mode
Your have to turn your sets into vectors objects first. You could do this in one step with readLines A <- readLines("A.file") or after read.delim() you would convert the resulting data frames to vectors like this: A <- read.delim ("A.file") A <- as.character(as.matrix(A)) Thomas On Sat, Jun 05, 2010 at 11:50:34AM -0700, David Lyon wrote: > Thanks for your efforts Steffen. > > If anyone knows exactly how to get this working I would be appreciative: > > > > > eg: > library(gplots) > A <- read.delim ("A.file") > B <- read.delim ("B.file") > C <- read.delim ("C.file") > input<-list(A,B,C) > venn(input) > > its returns the venn > diagram from only the first row from each file , how do I change the > code so it uses every data point in each column. > > > Thanks > > > > contents > of A.file > 1 > 2 > 3 > 4 > > contents of B.file > 1 > 2 > 3 > 4 > > contents of C.file > 1 > 2 > 3 > 4 > > > > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >
ADD REPLY
0
Entering edit mode
Thank you very much that works. Cheers! ----- Original Message ---- From: Thomas Girke <thomas.girke@ucr.edu> To: David Lyon <david_lyon3 at="" yahoo.com=""> Cc: Steffen M?ller <steffen_moeller at="" gmx.de="">; bioconductor at stat.math.ethz.ch Sent: Sat, June 5, 2010 3:15:45 PM Subject: Re: [BioC] venn diagrams Your have to turn your sets into vectors objects first. You could do this in one step with readLines A <- readLines("A.file") or after read.delim() you would convert the resulting data frames to vectors like this: A <- read.delim ("A.file") A <- as.character(as.matrix(A)) Thomas On Sat, Jun 05, 2010 at 11:50:34AM -0700, David Lyon wrote: > Thanks for your efforts Steffen. > > If anyone knows exactly how to get this working I would be appreciative: > > > > > eg: > library(gplots) > A <- read.delim ("A.file") > B <- read.delim ("B.file") > C <- read.delim ("C.file") > input<-list(A,B,C) > venn(input) > > its returns the venn > diagram from only the first row from each file , how do I change the > code so it uses every data point in each column. > > > Thanks > > > > contents > of A.file > 1 > 2 > 3 > 4 > > contents of B.file > 1 > 2 > 3 > 4 > > contents of C.file > 1 > 2 > 3 > 4 > > > > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >
ADD REPLY
0
Entering edit mode
Hi Thomas, the "as.matrix" did the trick. The challenge is to lose the "data.frame", which I find somewhat counter-intuitive at times: # creating some data frome > a<-data.frame(1:3,4:6) > a X1.3 X4.6 1 1 4 2 2 5 3 3 6 > dim(a) [1] 3 2 # Instruction to lose the dimension > dim(a)<-NULL # no warning no nothing, the data.format is kept > dim(a) [1] 3 2 # The same as a matrix just works > a<-as.matrix(a) > dim(a) [1] 3 2 > dim(a)<-NULL > a [1] 1 2 3 4 5 6 This is all understandable, I nonetheless hope to find where getVennCounts is affected by this or something else data.frame-specific. It should at least stop() if it does not work with data.frames. Best, Steffen On 06/05/2010 09:15 PM, Thomas Girke wrote: > Your have to turn your sets into vectors objects first. You > could do this in one step with readLines > > A <- readLines("A.file") > > or after read.delim() you would convert the resulting data frames to > vectors like this: > > A <- read.delim ("A.file") > A <- as.character(as.matrix(A)) > > Thomas > > On Sat, Jun 05, 2010 at 11:50:34AM -0700, David Lyon wrote: >> Thanks for your efforts Steffen. >> >> If anyone knows exactly how to get this working I would be appreciative: >> >> >> >> >> eg: >> library(gplots) >> A <- read.delim ("A.file") >> B <- read.delim ("B.file") >> C <- read.delim ("C.file") >> input<-list(A,B,C) >> venn(input) >> >> its returns the venn >> diagram from only the first row from each file , how do I change the >> code so it uses every data point in each column. >> >> >> Thanks >> >> >> >> contents >> of A.file >> 1 >> 2 >> 3 >> 4 >> >> contents of B.file >> 1 >> 2 >> 3 >> 4 >> >> contents of C.file >> 1 >> 2 >> 3 >> 4 >> >> >> >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at stat.math.ethz.ch >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >>
ADD REPLY
0
Entering edit mode
Hello again, David. I can confirm your problem (or at least that there is something strange). What repairs it for me is venn(list(a[,1],b[,1],c[,1])) which does what I had previously hoped the "as.vector" to achieve. I'm having a close look at that and send a patch. Cheers, Steffen On 06/05/2010 08:50 PM, David Lyon wrote: > Thanks for your efforts Steffen. > > If anyone knows exactly how to get this working I would be appreciative: > > > > > eg: > library(gplots) > A <- read.delim ("A.file") > B <- read.delim ("B.file") > C <- read.delim ("C.file") > input<-list(A,B,C) > venn(input) > > its returns the venn > diagram from only the first row from each file , how do I change the > code so it uses every data point in each column. > > > Thanks > > > > contents > of A.file > 1 > 2 > 3 > 4 > > contents of B.file > 1 > 2 > 3 > 4 > > contents of C.file > 1 > 2 > 3 > 4 > > >
ADD REPLY

Login before adding your answer.

Traffic: 1061 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6