[BioC] how can I use the limma result as input in topGo

Adrian Alexa adrian.alexa at gmail.com
Thu Nov 8 16:17:40 CET 2007


Hi Caroline,

you are using the "array" type for the geneList. topGO expects a
"character vector" instead. It is a good practice to use the str()
function to see which type of data are you using and if you need any
coercion. Let me give you an example:

## build a 1-dim array (of type character)
> x <- as.array(letters[1:10])
> dimnames(x) <- list(LETTERS[1:10])
## you can see the structure:
> str(x)
 chr [, 1:10] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"
 - attr(*, "dimnames")=List of 1
  ..$ : chr [1:10] "A" "B" "C" "D" ...


## build a character vector
> y <- as.character(letters[1:10])
> names(y) <- as.character(LETTERS[1:10])
> str(y)
 Named chr [1:10] "a" "b" "c" "d" "e" "f" "g" "h" "i" ...
 - attr(*, "names")= chr [1:10] "A" "B" "C" "D" ...

###################

As you see x differ in structure from y. Thus what you need to do is
the following:

> geneList<-as.character(mytable$P.Value)
> names(geneList) <- as.character(mytable$ID)

Hope this helps,
Adrian






On 11/8/07, Caroline Reiff <C.Reiff at rri.sari.ac.uk> wrote:
>
>    I wonder if somebody can tell me how I can use my P values from the limma
>    test as input into topGo. This is what I tried:
>    In topGo I usually do the following using the standard t-test:
>    > geneList <- getPvalues(exprs(esetSub), classlabel = y, alternative =
>    "two.sided", correction = "BH")
>    > geneList[1:10]
>        1415670_at    1415671_at    1415672_at    1415673_at  1415674_a_at
>    1415675_at
>        0.15021513    0.07711458    0.38562825    0.78996178    0.64844312
>    0.16257882
>    1415676_a_at   1415677_at   1415678_at   1415679_at
>      0.92404052   0.01690829   0.30654309   0.55264382
>    > length(geneList)
>    [1] 9103
>    > topDiffGenes <- function(allScore) {
>    + return(allScore < 0.01)
>    + }
>    > GOdata <- new("topGOdata",
>    + ontology = "BP",
>    + allGenes = geneList,
>    + geneSel = topDiffGenes,
>    + description = "GO analysis of data. Diff. Expre. between WT and IL10",
>    + annot = annFUN.hgu,
>    + affyLib = affyLib)
>    Building most specific GOs .....        ( 2088 GO terms found. )
>    Build GO DAG topology ..........        ( 3286 GO terms and 5438 relations.
>    )
>    Annotating nodes ...............        ( 6088 genes annotated to the GO
>    terms. )
>    I tried to replace geneList with the results from limma in the following
>    way:
>    > geneList<-as.array(mytable$P.Value)
>    > dimnames(geneList) <- list(mytable$ID)
>    This gives me a genelist just as the one before except that the results are
>    ordered by P-value as they come from the limma table
>    > geneList[1:10]
>           1423677_at NuGO_emt025263_at        1421628_at        1436576_at
>         4.335431e-10      2.530289e-09      4.326564e-09      4.470340e-09
>           1450034_at        1422632_at        1453080_at        1438037_at
>         5.625014e-09      5.931422e-09      6.114187e-09      6.872450e-09
>           1422953_at        1446280_at
>         1.078998e-08      1.143128e-08
>    > length(geneList)
>    [1] 9103
>    but when I use this as input in topGo I get an error message:
>    > topDiffGenes <- function(allScore) {
>    + return(allScore < 0.01)
>    + }
>    > GOdata <- new("topGOdata",
>    + ontology = "BP",
>    + allGenes = geneList,
>    + geneSel = topDiffGenes,
>    + description = "WT versus Il10 ko",
>    + annot = annFUN.hgu,
>    + affyLib = affyLib)
>    Error in checkSlotAssignment(object, name, value) :
>             assignment of an object of class "AsIs" is not valid for slot
>    "allGenes" in an object of class "topGOdata"; is(value, "character") is not
>    TRUE
>    >
>     Hope somebody can help, Many thanks Caroline
> _______________________________________________
> 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