Question: mget plus regular expression
0
gravatar for marco fabbri
9.2 years ago by
marco fabbri320
Italy
marco fabbri320 wrote:
I am looking for refseq NM_016951 but mget returns me three results, how can I get only for NM_016951 (the first one): unlist(mget('NM_016951', revmap(hgug4112aREFSEQ)) NM_016951 NM_0169512 NM_0169513 "A_23_P118061" "A_23_P206396" "A_24_P215804" thank you Marco
• 589 views
ADD COMMENTlink modified 9.2 years ago by Vincent J. Carey, Jr.6.3k • written 9.2 years ago by marco fabbri320
Answer: mget plus regular expression
0
gravatar for Scott Ochsner
9.2 years ago by
Scott Ochsner300
Scott Ochsner300 wrote:
Marco, With your query you have asked for the hgug4112a array features mapped to refseq NM_016951. There are apparently three. Scott Scott A. Ochsner NURSA Bioinformatics Resource Baylor College of Medicine -----Original Message----- From: bioconductor-bounces@stat.math.ethz.ch [mailto:bioconductor- bounces@stat.math.ethz.ch] On Behalf Of Marco Fabbri Sent: Monday, July 19, 2010 11:29 AM To: bioconductor at stat.math.ethz.ch Subject: [BioC] mget plus regular expression I am looking for refseq NM_016951 but mget returns me three results, how can I get only for NM_016951 (the first one): unlist(mget('NM_016951', revmap(hgug4112aREFSEQ)) NM_016951 NM_0169512 NM_0169513 "A_23_P118061" "A_23_P206396" "A_24_P215804" thank you Marco _______________________________________________ Bioconductor mailing list Bioconductor at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/bioconductor Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD COMMENTlink written 9.2 years ago by Scott Ochsner300
Answer: mget plus regular expression
0
gravatar for Vincent J. Carey, Jr.
9.2 years ago by
United States
Vincent J. Carey, Jr.6.3k wrote:
> unlist(mget('NM_016951', revmap(hgug4112aREFSEQ))) NM_0169511 NM_0169512 NM_0169513 "A_23_P118061" "A_23_P206396" "A_24_P215804" This has nothing to do with regular expressions. It has to do with name mangling and an odd application of mget. > mget('NM_016951', revmap(hgug4112aREFSEQ)) $NM_016951 [1] "A_23_P118061" "A_23_P206396" "A_24_P215804" you don't need mget for this application. if you use it and unlist() the results, unlist will add distinguishing tokens to the names of the list elements as their names are pushed onto the unlisted data. > unlist(list(a=c(2,3))) a1 a2 2 3 > unlist(list(a=c(b=2,d=3))) a.b a.d 2 3 On Mon, Jul 19, 2010 at 12:28 PM, Marco Fabbri <fabbri.marco at="" gmail.com=""> wrote: > I am looking for refseq NM_016951 but mget returns me three results, > how can I get only for NM_016951 (the first one): > > unlist(mget('NM_016951', revmap(hgug4112aREFSEQ)) > ? ?NM_016951 ? ? NM_0169512 ? ? NM_0169513 > "A_23_P118061" "A_23_P206396" "A_24_P215804" > > thank you > > Marco > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >
ADD COMMENTlink written 9.2 years ago by Vincent J. Carey, Jr.6.3k
Hi Marco, Vince is correct to point out that the problem is being caused by name-mangling that happens when you use the unlist() method. This occurs because the authors of the unlist() method wanted to guarantee that the names returned by unlist() remained unique. However, as you have discovered, this becomes a problem when the names have a meaning and the name-mangling ends up changing that. :( There is a work around though. If you just want to do something like unlist() with this, you have the option to use the unlist2() method in the AnnotationDbi package which will allow you to skip the troublesome name-mangling. Marc On 07/19/2010 10:30 AM, Vincent Carey wrote: >> unlist(mget('NM_016951', revmap(hgug4112aREFSEQ))) >> > NM_0169511 NM_0169512 NM_0169513 > "A_23_P118061" "A_23_P206396" "A_24_P215804" > > This has nothing to do with regular expressions. It has to do with > name mangling and an odd application of > mget. > > >> mget('NM_016951', revmap(hgug4112aREFSEQ)) >> > $NM_016951 > [1] "A_23_P118061" "A_23_P206396" "A_24_P215804" > > you don't need mget for this application. if you use it and unlist() > the results, unlist will add distinguishing tokens > to the names of the list elements as their names are pushed onto the > unlisted data. > > >> unlist(list(a=c(2,3))) >> > a1 a2 > 2 3 > > >> unlist(list(a=c(b=2,d=3))) >> > a.b a.d > 2 3 > > > > > On Mon, Jul 19, 2010 at 12:28 PM, Marco Fabbri <fabbri.marco at="" gmail.com=""> wrote: > >> I am looking for refseq NM_016951 but mget returns me three results, >> how can I get only for NM_016951 (the first one): >> >> unlist(mget('NM_016951', revmap(hgug4112aREFSEQ)) >> NM_016951 NM_0169512 NM_0169513 >> "A_23_P118061" "A_23_P206396" "A_24_P215804" >> >> thank you >> >> Marco >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at stat.math.ethz.ch >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >> >> > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >
ADD REPLYlink written 9.2 years ago by Marc Carlson7.2k
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: 228 users visited in the last hour