[BioC] Finding GO leaf nodes for an ontology - which package?

Seth Falcon sfalcon at fhcrc.org
Tue Jul 31 16:11:12 CEST 2007


Tim Smith <tim_smith_666 at yahoo.com> writes:

> Hi Seth (and everyone),
>
> Thanks for the replies. I ended up doing (for the BP ontology):
>
>     leaves <- list()
>     root <- "GO:0008150"
>     allgos <- get(root,GOBPOFFSPRING)
>     for(i in 1:length(allgos)){
>        if(is.na(get(allgos[i],GOBPOFFSPRING))){
>             leaves <- c(leaves,allgos[i])
>        }
>     }
>
>
> I hope this is equivalent to getting the leaves!

I think this will get you the answer, but did you compare to the two or
three other solutions suggested?

The for loop with get will be slower than using mget.

+ seth

-- 
Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center
BioC: http://bioconductor.org/
Blog: http://userprimary.net/user/



More information about the Bioconductor mailing list