mget plus regular expression
2
0
Entering edit mode
marco fabbri ▴ 320
@marco-fabbri-1657
Last seen 8.2 years ago
Italy
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
• 1.5k views
ADD COMMENT
0
Entering edit mode
Scott Ochsner ▴ 300
@scott-ochsner-599
Last seen 10.3 years ago
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 COMMENT
0
Entering edit mode
@vincent-j-carey-jr-4
Last seen 3 months ago
United States
> 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 COMMENT
0
Entering edit mode
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 REPLY

Login before adding your answer.

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