Hi,
I am getting interested in R/Bioconductor packages and trying to learn about it. I want to perform HyperGeometric test for over representation against GO and KEGG. I have go two text files: Back.txt and genes.txt. To test HyperGeometric test I wrote following code in R. The result with be in data.frame and visualizing in the Gograph or KEGG pathway.
library(topGO)
library(GOstats)
universe=read.table("Back.txt", sep=",") # Background files where only entrez id's are listed without heading column
tbl <- read.table ("genes.txt", sep=",") # selected genes with following header Probes_id,entrez_gene_id,symbols,P.Value and F.C
selected=<-tbl$V2 # Selecting only second column of tbl vector where entrez_gene_id is present
param <- new ("GOHyperGParams", geneIds = selected,
universeGeneIds=universe, annotation="org.Hs.eg.db",
ontology="BP",pvalueCutoff=0.1, conditional=FALSE,testDirection="over")
But, I couldn't succeeed because I get the error
Error in makeValidParams(.Object) :
geneIds and universeGeneIds must have the same mode
geneIds: NULL
universeGeneIds: integerFALSE
In addition: Warning message:
In makeValidParams(.Object) :
converting univ from list to atomic vector via unlist
hyp <- hyperGTest (param)
Error in is(object, Cl) :
error in evaluating the argument 'p' in selecting a method for function 'hyperGTest'
Am I missing something here? Do I have to go through more resources to clear my understanding? if yes where can I find R/Bioconductor HyperGeometric test with all needed R packages?
Plus I have loaded all the library and packages, shown in the link ( http://pastebin.com/i735EUWp )
Thank you
just a comment, trying to read a file in R using readLines while there a functions like read.delim, read.table, (more robust and flexible) or scan (more efficent) is almost always a bad idea. Also, please provide example input files or put the files online.
I think also that an example file would be necessary.