Question: question on hgu95 metadata and ontoTools
0
gravatar for Elisabetta Manduchi
16.0 years ago by
Elisabetta Manduchi160 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. Thanks, Elisabetta
ontotools • 402 views
ADD COMMENTlink modified 16.0 years ago by rgentleman5.5k • written 16.0 years ago by Elisabetta Manduchi160
Answer: question on hgu95 metadata and ontoTools
0
gravatar for rgentleman
16.0 years ago by
rgentleman5.5k
United States
rgentleman5.5k 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 -- +--------------------------------------------------------------------- ------+ | 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 COMMENTlink written 16.0 years ago by rgentleman5.5k
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 REPLYlink written 16.0 years ago by Elisabetta Manduchi160
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 154 users visited in the last hour