question on hgu95 metadata and ontoTools
1
0
Entering edit mode
@elisabetta-manduchi-575
Last seen 9.6 years ago
Hi, I would like to create an environment that combines the hgu95av2GO, hgu95bGO, ...hgu95eGO into just one environment, that I can subsequently use as the otkvEnv argument in the ontoTools function otkvEnv2namedSparse. Is there a quick and simple way to do this in R, without having to define a new hash and the key-value mapping block by block (according to which environment the key belongs to)? In other words, I'm asking if there is a one-stop way in R to "union" the above 5 environments. Thanks, Elisabetta
ontoTools ontoTools • 728 views
ADD COMMENT
0
Entering edit mode
rgentleman ★ 5.5k
@rgentleman-7725
Last seen 9.0 years ago
United States
On Wed, Dec 17, 2003 at 03:47:54PM -0500, Elisabetta Manduchi wrote: > > Hi, > I would like to create an environment that combines the hgu95av2GO, > hgu95bGO, ...hgu95eGO into just one environment, that I can subsequently > use as the otkvEnv argument in the ontoTools function otkvEnv2namedSparse. > Is there a quick and simple way to do this in R, without having to define > a new hash and the key-value mapping block by block (according to which > environment the key belongs to)? In other words, I'm asking if there is a > one-stop way in R to "union" the above 5 environments. Sort of, in R there are no hash tables but environments are close so we used them. They have a rather unique aspect which is the parent environment. So that if a value is not found in the first environment the parent is searched. So to solve your problem you could do some thing like parent.env(E2) <- E1 parent.env(E3) <- E2 ... then do your get's on E1 (with inherits=TRUE, which is the default in get) and you should be almost set. The one issue that is not easily solved is the if inherits is TRUE then you search up beyond the last of your environments (your work space and then the search list). But that should not be a problem in your case.... Robert > Thanks, > Elisabetta > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://www.stat.math.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
0
Entering edit mode
Robert, thank you very much for such a prompt reply. A question, with your notation below, shouldn't I do my gets on E5 rather than on E1, if E1 is the ancestor? Was that a just typo or am I misunderstanding? In other words to deal with my case, I guess I could do the following (calling hgu95GO my new combined environment): hgu95GO<-hgu95av2GO parent.env(hgu95GO)<-hgu95bGO parent.env(hgu95bGO)<-hgu95cGO parent.env(hgu95cGO)<-hgu95dGO) parent.env(hgu95dGO)<-hgu95eGO and then do my gets on hgu95GO, right? Elisabetta On Wed, 17 Dec 2003, Robert Gentleman wrote: > On Wed, Dec 17, 2003 at 03:47:54PM -0500, Elisabetta Manduchi wrote: > > > > Hi, > > I would like to create an environment that combines the hgu95av2GO, > > hgu95bGO, ...hgu95eGO into just one environment, that I can subsequently > > use as the otkvEnv argument in the ontoTools function otkvEnv2namedSparse. > > Is there a quick and simple way to do this in R, without having to define > > a new hash and the key-value mapping block by block (according to which > > environment the key belongs to)? In other words, I'm asking if there is a > > one-stop way in R to "union" the above 5 environments. > > Sort of, in R there are no hash tables but environments are close so > we used them. They have a rather unique aspect which is the parent > environment. So that if a value is not found in the first environment > the parent is searched. So to solve your problem you could do some > thing like > > parent.env(E2) <- E1 > parent.env(E3) <- E2 > ... > > then do your get's on E1 (with inherits=TRUE, which is the default > in get) and you should be almost set. The one issue that is not > easily solved is the if inherits is TRUE then you search up beyond > the last of your environments (your work space and then the search > list). But that should not be a problem in your case.... > > Robert > > > Thanks, > > Elisabetta > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor@stat.math.ethz.ch > > https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor > > -- Elisabetta Manduchi Computational Biology and Informatics Laboratory Center for Bioinformatics University of Pennsylvania 1428 Blockley Hall 423 Guardian Drive Philadelphia, PA 19104-6021 phone: 215-573-4408 fax: 215 573-3111 email: manduchi@pcbi.upenn.edu web: http://www.cbil.upenn.edu/~manduchi ---
ADD REPLY

Login before adding your answer.

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