[BioC] topGO enrichment using ensembl gene list

Adrian Alexa adrian.alexa at gmail.com
Thu Feb 26 14:39:46 CET 2009


Hi Alex,

Yes, you can test for underrepresentation with topGO. Basically what
you need to do is to change the direction of the test. By default,
when using Fisher's exact test, the alternative hypothesis is  that
the odds ratios are "greater" than the null odds. If yo want to test
for underrepresentation you need to use as alternative "less". To
achieve this you need to define a new test statistic in the following
way:

if(!isGeneric("GOFisherUnder"))
  setGeneric("GOFisherUnder", function(object) standardGeneric("GOFisherUnder"))

setMethod("GOFisherUnder", "classicCount",
          function(object) {

            contMat <- contTable(object)

            if(all(contMat == 0))
              p.value <- 1
            else
              p.value <- fisher.test(contMat, alternative = "less")$p.value

            return(p.value)
          })

The following code will run the "weight" algorithm with this new test:

test.stat <- new("weightCount", testStatistic = GOFisherUnder, name
="Weight with Fisher's exact test for underrepresentation")
resFisher.weight <- getSigGroups(GOdata, test.stat)


This is not the most elegant solution, since there is an option to
parametrize the GOFisherTest, such that one can chose the direction of
the test but I never did it ... I will put it on my TODO list and I'll
try to include it in the next release.


Hope this helps,
Adrian




On Thu, Feb 26, 2009 at 11:10 AM,  <AlexThiemann at gmx.de> wrote:
> Hi,
>
> I just want to know if it is also possible to
> test for underrepresented GO categories by
> using the weight algorithm. If yes, do I have
> to change something in the definition of the
> test statistic when using weight instead of elim and classic?
>
> Thank you
> --
>
> _______________________________________________
> 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