subset ontology from entire GO db using topGO
1
0
Entering edit mode
Paul Rigor ▴ 20
@paul-rigor-4426
Last seen 10.2 years ago
Hi, I'm using topGO and I'm trying to obtain subsets of the three ontologies. How do I go about obtaining just the GO terms associated with MF, BP, or CC? I'm comparing raw counts from my experimental data (with separate enrichments per ontology) versus the background (for each of the ontologies). Thank you, Paul [[alternative HTML version deleted]]
GO topGO GO topGO • 1.9k views
ADD COMMENT
0
Entering edit mode
Marc Carlson ★ 7.2k
@marc-carlson-2264
Last seen 8.3 years ago
United States
Hi Paul, Not completely sure what you are asking as you didn't give us a concrete example. So here is a rudimentary guess: If I have a bunch of GO IDs in some vector: foo = c('GO:0008150','GO:0005576','GO:0003674') Then, I can get rid of the ones that are not of the "MF" ontology (as an example) by using the Ontology helper function from AnnotationDbi in an expression like this: foo[Ontology(foo)=="MF"] Hope that helps, Marc On 01/08/2011 11:29 PM, Paul Rigor wrote: > Hi, > > I'm using topGO and I'm trying to obtain subsets of the three ontologies. > How do I go about obtaining just the GO terms associated with MF, BP, or CC? > > I'm comparing raw counts from my experimental data (with separate > enrichments per ontology) versus the background (for each of the > ontologies). > > Thank you, > Paul > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >
ADD COMMENT
0
Entering edit mode
Hi Marc, Actually, how to I obtain all of the GO IDs for a particular ontology? Ideally, something like MFids = getGOIds(GOdb, ontology="MF") Thanks, Paul On Mon, Jan 10, 2011 at 11:57 AM, Marc Carlson <mcarlson@fhcrc.org> wrote: > Hi Paul, > > Not completely sure what you are asking as you didn't give us a concrete > example. So here is a rudimentary guess: > If I have a bunch of GO IDs in some vector: > > foo = c('GO:0008150','GO:0005576','GO:0003674') > > Then, I can get rid of the ones that are not of the "MF" ontology (as an > example) by using the Ontology helper function from AnnotationDbi in an > expression like this: > > > foo[Ontology(foo)=="MF"] > > > Hope that helps, > > > Marc > > > > > On 01/08/2011 11:29 PM, Paul Rigor wrote: > > Hi, > > > > I'm using topGO and I'm trying to obtain subsets of the three ontologies. > > How do I go about obtaining just the GO terms associated with MF, BP, or > CC? > > > > I'm comparing raw counts from my experimental data (with separate > > enrichments per ontology) versus the background (for each of the > > ontologies). > > > > Thank you, > > Paul > > > > [[alternative HTML version deleted]] > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor@r-project.org > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > > > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
Hi Paul, So to use what I just showed you to answer your specific question you can do this: library(GO.db) MFTerms <- Term(GOTERM[Ontology(GOTERM)=="MF"]) The GOTERM mapping from the GO.db package gives you all the terms from GO. So here I just subset that to be only the set that is in the "MF" ontology using the trick that I showed you before. Then you only need to call Term to get a vector of GO terms that are only from MF and where the names are the GOIDs. I used Term here, but really you could have used GOID, Definition, or Ontology as they all return a vector where the names *are* the GOIDs. The help page for Ontology will also show you how to use Term, GOID, Definition and related functions. Marc On 01/11/2011 01:49 PM, Paul Rigor wrote: > Hi Marc, > Actually, how to I obtain all of the GO IDs for a particular ontology? > Ideally, something like > > MFids = getGOIds(GOdb, ontology="MF") > > Thanks, > Paul > > > On Mon, Jan 10, 2011 at 11:57 AM, Marc Carlson <mcarlson@fhcrc.org> <mailto:mcarlson@fhcrc.org>> wrote: > > Hi Paul, > > Not completely sure what you are asking as you didn't give us a > concrete > example. So here is a rudimentary guess: > If I have a bunch of GO IDs in some vector: > > foo = c('GO:0008150','GO:0005576','GO:0003674') > > Then, I can get rid of the ones that are not of the "MF" ontology > (as an > example) by using the Ontology helper function from AnnotationDbi > in an > expression like this: > > > foo[Ontology(foo)=="MF"] > > > Hope that helps, > > > Marc > > > > > On 01/08/2011 11:29 PM, Paul Rigor wrote: > > Hi, > > > > I'm using topGO and I'm trying to obtain subsets of the three > ontologies. > > How do I go about obtaining just the GO terms associated with > MF, BP, or CC? > > > > I'm comparing raw counts from my experimental data (with separate > > enrichments per ontology) versus the background (for each of the > > ontologies). > > > > Thank you, > > Paul > > > > [[alternative HTML version deleted]] > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor@r-project.org <mailto:bioconductor@r-project.org> > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > > > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org <mailto:bioconductor@r-project.org> > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
Hi Marc, Thank you so much! Paul On Tue, Jan 11, 2011 at 3:40 PM, Marc Carlson <mcarlson@fhcrc.org> wrote: > Hi Paul, > > So to use what I just showed you to answer your specific question you can > do this: > > library(GO.db) > MFTerms <- Term(GOTERM[Ontology(GOTERM)=="MF"]) > > The GOTERM mapping from the GO.db package gives you all the terms from GO. > So here I just subset that to be only the set that is in the "MF" ontology > using the trick that I showed you before. Then you only need to call Term > to get a vector of GO terms that are only from MF and where the names are > the GOIDs. I used Term here, but really you could have used GOID, > Definition, or Ontology as they all return a vector where the names *are* > the GOIDs. The help page for Ontology will also show you how to use Term, > GOID, Definition and related functions. > > > Marc > > > > On 01/11/2011 01:49 PM, Paul Rigor wrote: > > Hi Marc, > Actually, how to I obtain all of the GO IDs for a particular ontology? > Ideally, something like > > MFids = getGOIds(GOdb, ontology="MF") > > Thanks, > Paul > > > On Mon, Jan 10, 2011 at 11:57 AM, Marc Carlson <mcarlson@fhcrc.org> wrote: > >> Hi Paul, >> >> Not completely sure what you are asking as you didn't give us a concrete >> example. So here is a rudimentary guess: >> If I have a bunch of GO IDs in some vector: >> >> foo = c('GO:0008150','GO:0005576','GO:0003674') >> >> Then, I can get rid of the ones that are not of the "MF" ontology (as an >> example) by using the Ontology helper function from AnnotationDbi in an >> expression like this: >> >> >> foo[Ontology(foo)=="MF"] >> >> >> Hope that helps, >> >> >> Marc >> >> >> >> >> On 01/08/2011 11:29 PM, Paul Rigor wrote: >> > Hi, >> > >> > I'm using topGO and I'm trying to obtain subsets of the three >> ontologies. >> > How do I go about obtaining just the GO terms associated with MF, BP, or >> CC? >> > >> > I'm comparing raw counts from my experimental data (with separate >> > enrichments per ontology) versus the background (for each of the >> > ontologies). >> > >> > Thank you, >> > Paul >> > >> > [[alternative HTML version deleted]] >> > >> > _______________________________________________ >> > Bioconductor mailing list >> > Bioconductor@r-project.org >> > https://stat.ethz.ch/mailman/listinfo/bioconductor >> > Search the archives: >> http://news.gmane.org/gmane.science.biology.informatics.conductor >> > >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor@r-project.org >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: >> http://news.gmane.org/gmane.science.biology.informatics.conductor >> > > > [[alternative HTML version deleted]]
ADD REPLY

Login before adding your answer.

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