Enrichment tests with an array read with read.table
0
0
Entering edit mode
@lemmechange-7551
Last seen 9.1 years ago
Spain

Hello guys,

first of all I am new to R and Bioconductor. I've been trying without success to use my own custom data for performing a fisher's test. I did the following in first hand for trying it out using some samples that R includes.

data(GOdata)
########################################
## GenTable
########################################
## load two topGOresult sample objects: resultFisher and resultKS
data(results.tGO)
## generate the result of Fisher's exact test
sig.tab <- GenTable(GOdata, Fis = resultFisher, topNodes = 20)
## results of both test
sig.tab <- GenTable(GOdata, resultFisher, resultKS, topNodes = 20)
## results of both test with specified names
sig.tab <- GenTable(GOdata, Fis = resultFisher, KS = resultKS, topNodes = 20)
## results of both test with specified names and specified ordering
sig.tab <- GenTable(GOdata, Fis = resultFisher, KS = resultKS, orderBy = "KS", ranksOf = "Fis", topNodes = 20)
########################################
## showGroupDensity
########################################
goID <- "GO:0006091"
print(showGroupDensity(GOdata, goID, ranks = TRUE))
print(showGroupDensity(GOdata, goID, ranks = FALSE, rm.one = FALSE))

And then, the following code:

## load a sample topGOdata object
data(GOdata)
GOdata
##############################
## getSigGroups interface
##############################
## define a test statistic
test.stat <- new("classicCount", testStatistic = GOFisherTest, name = "Fisher test")
## perform the test
resultFis <- getSigGroups(GOdata, test.stat)
resultFis
##############################
## runTest interface
##############################
## Enrichment analysis by using the "classic" method and Fisher's exact test
resultFis <- runTest(GOdata, algorithm = "classic", statistic = "fisher")
resultFis
## weight01 is the default algorithm
weight01.fisher <- runTest(GOdata, statistic = "fisher")
weight01.fisher
## not all combinations are possible!
# weight.ks <- runTest(GOdata, algorithm = "weight", statistic = "t")

Now I wanted to perform exactly what I did over here, but using my own data. In my case, I loaded it using read.table as follows

data<-read.table("dengue.csv", header=TRUE, sep="\t", dec=".")

How could I achieve this guys? I had no success trying to input it, and the error output was not very descriptive I'd say...

 

Kind regards

 
read.table enrichment test fisher classic • 1.1k views
ADD COMMENT
0
Entering edit mode

This is exactly the opposite of what you should be doing. Showing us a bunch of code that worked for you is not of interest. It's nice that you got things to work, but this forum is about helping people with problems, not accolades for successes.

When you got to the problem part, you just show the code that (apparently) didn't work, and then you stop giving any information. If you want help you need to tell us three things:

  1. What were you trying to do?
  2. What did you do?
  3. What happened - in particular the error messages. The fact that the error message was not informative for you is not important. That it might be informative to us is important however, so you need to actually show what it was.

If the error was a problem with reading in a .csv file, then this isn't really the forum you should be using anyway. General R-help questions go on the R-help mailing list (r-help@r-project.org).

ADD REPLY

Login before adding your answer.

Traffic: 548 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