[BioC] problems in arrays

Thomas Girke thomas.girke at ucr.edu
Wed Oct 14 19:24:08 CEST 2009


Dear Brian,

It seems that you are having problems with generating the sample set
list object that is passed on to the overLapper()/vennPlot()
functions.
The example you are giving below generates an Error, and therefore the final
step doesn't generate the expected result.

To generate the test sample list with your command (3) you have to add
'replace=TRUE' to each sample() instance when you request more than 26
letters: 

source("http://faculty.ucr.edu/~tgirke/Documents/R_BioCond/My_R_Scripts/overLapper.R")
setlist <- list(A=sample(letters, 2707, replace=T),
                B=sample(letters, 3812, replace=T),
                C=sample(letters, 1215, replace=T),
                D=sample(letters, 943, replace=T),
                E=sample(letters, 4320, replace=T))
OLlist5 <- overLapper(setlist=setlist, sep="_", type="vennsets", keepdups=T)
counts <- sapply(OLlist5$Venn_List, length)
vennPlot(counts=counts, ccol=c(rep(1,30),2), lcex=1.5, ccex=c(rep(1.5,5), rep(0.6,25),1.5))


For more detailed information on my personal custom intersect/venn functions, please consult this 
page:
http://faculty.ucr.edu/~tgirke/Documents/R_BioCond/R_BioCondManual.html#R_graphics_venn


To get your data into R from Excel, you can use the copy&paste approach,
but this is a bit tedious. The best might be to set up your five sample
sets in an Excel table with 5 columns, then you save it to a tab-delimited
text file and import it into R with the read.delim() function:
mytable <- read.delim(file="mytable")

Once you have it in R, you can convert into a list with lapply(). Here is
an example for the iris data set: 
setlist <- lapply(colnames(iris), function(x) as.character(iris[,x]))
names(setlist) <- LETTERS[1:5]

Alternatively, you could do this 'manually' like this:
setlist <- list(A=as.character(mytable[,1]),
                B=as.character(mytable[,2]),
                C=as.character(mytable[,3]),
                D=as.character(mytable[,4]),
                E=as.character(mytable[,5]))


I hope this helps.

Thomas



On Wed, Oct 14, 2009 at 12:14:34PM -0400, Brian Moldover wrote:
> Hello all, I'm trying to use the overlapper.R script to calculate Venn
> intersections between gene lists. Apparently there is a lot of user error,
> as I cannot get any output. Here is what I am doing. 
> 
>  
> 
> 1.       Start R 2.9.0
> 
> 2.       Start the script:
> >source("http://faculty.ucr.edu/~tgirke/Documents/R_BioCond/My_R_Scripts/ove
> rLapper.R")
> 
> 3.       Define the setlist:  > setlist <- list(A=sample(letters, 2707),
> B=sample(letters, 3812), C=sample(letters, 1215), D=sample(letters, 943),
> E=sample(letters, 4320, replace=T))
> 
> 4.       Copy the Excel data into the clipboard.
> 
> 5.       Read the data into R: > read.delim("clipboard", header=F) 
> 
> a.       Sample input
> 
> 4318      NA      NA      NA      NA 7650653
> 
> 4319      NA      NA      NA      NA 7650725
> 
> 4320      NA      NA      NA      NA 7650735
> 
>  
> 
> 6.       Calculate the Venn overlaps: > OLlist <-
> overLapper(setlist=setlist, sep="", type="vennsets"); OLlist; names(OLlist)
> 
>  
> 
> But the array data appears to be empty, since I can output a file but no
> overlaps between the sets. The export file has the possible overlaps, but no
> probeID's.Help? J
> 
>  
> 
>  
> 
>  
> 
> - Brian
> 
>  
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> 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
>



More information about the Bioconductor mailing list