[BioC] problem with getGOOntology

Francois Pepin fpepin at cs.mcgill.ca
Thu Apr 7 23:59:42 CEST 2005


On Thu, 2005-04-07 at 17:58, Sean Davis wrote:

> >> getGOOntology
> > function (x)
> > {
> >     if (!is.character(x))
> >         stop("need a character argument")
> >     if (length(x) == 0)
> >         return(character(0))
> >     wh <- mget(x, env = GOTERM, ifnotfound = NA)
> >     return(sapply(wh, Ontology))
> > }
> >
> 
> My bad.  The lowercase 'o' got me.
> 
> If you haven't already done it, looks like a line:
> 
> wh <- wh[!is.na(wh)]
> 
> right before the return line might do the trick.

Not quite, as it would mess the indices up if you were to load a list of
terms.

Instead of having c('MF', NA, NA, 'CC', 'BP') as a result you'd end up
having c('MA','CC','BP') and think that the 3rd one is a biological
process term rather than not being a GO term (and have no clue for the
last 2).

Francois


> Sean



More information about the Bioconductor mailing list