How to retrieve the GO identifier correctly?
1
0
Entering edit mode
@szhanuoguelphca-892
Last seen 10.1 years ago
Hello, Experts, I tried to retrieve all biological process GO terms at level 3 starting "biological process" as level 1 using the code as bellows: 1 library(GO) 2 library(GOstats) 3 level2<-getGOChildren("GO:0008150")$"GO:0008150"$Children 4 for ( i in 1:length(level2)) { 5 level3 <- getGOChildren(level2[i])$level2[i]$Children 6 for ( j in 1:length(level3)){ 7 level3term <- getGOTerm(as.character(level3[j]))$BP$level3[j] 8 level3term 9 } 10 } What is the difference between line 3 and line5? In the line 3 I retrieved the GO identifiers at level 2 successfullly but in the line 5 I got nothing. How to correct the line 5 to retrieve the GO terms at level 3 correctly? Thank you in advance! Josh
GO PROcess GO PROcess • 917 views
ADD COMMENT
0
Entering edit mode
rgentleman ★ 5.5k
@rgentleman-7725
Last seen 9.4 years ago
United States
On Tue, Oct 12, 2004 at 05:12:08PM -0400, szhan@uoguelph.ca wrote: > Hello, Experts, > I tried to retrieve all biological process GO terms at level 3 starting > "biological process" as level 1 using the code as bellows: The difference is that the $ operator does not evaluate its arguments, so it does not do what you think it does in your line 5. Use the [[ ]], version, which does evaluate its argument. Robert ps it is considered to be bad style to post the same request to more than one help list, and it is not helpful to put in line numbers as that makes cut and paste a pain. > > 1 library(GO) > 2 library(GOstats) > 3 level2<-getGOChildren("GO:0008150")$"GO:0008150"$Children > 4 for ( i in 1:length(level2)) { > 5 level3 <- getGOChildren(level2[i])$level2[i]$Children > 6 for ( j in 1:length(level3)){ > 7 level3term <- getGOTerm(as.character(level3[j]))$BP$level3[j] > 8 level3term > 9 } > 10 } > What is the difference between line 3 and line5? In the line 3 I retrieved the > GO identifiers at level 2 successfullly but in the line 5 I got nothing. How to > correct the line 5 to retrieve the GO terms at level 3 correctly? > Thank you in advance! > Josh > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor -- +--------------------------------------------------------------------- ------+ | Robert Gentleman phone : (617) 632-5250 | | Associate Professor fax: (617) 632-2444 | | Department of Biostatistics office: M1B20 | | Harvard School of Public Health email: rgentlem@jimmy.harvard.edu | +--------------------------------------------------------------------- ------+
ADD COMMENT

Login before adding your answer.

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