arabidopsis annotate mget problem
2
0
Entering edit mode
@siobhan-a-braybrook-2637
Last seen 9.6 years ago
please excuse me if this is elementary, but I am lost about an error I am getting. I want to use a list of probe IDs to get out the genes from ath1121501ACCNUM. So I did the following: library(annotate) library(ath1121501.db) #next I made a short list of probe IDs to test my mget ability abaup=c("262128_at","255795_at","266462_at","250648_at","247095_at","2 58498_at","247723_at","258347_at","245982_at","263497_at") a1=mget(abaup, ath1121501ACCNUM) #this worked just fine #so I made a txt file of all the probe IDs I wanted to look up, and read in abaupr= read.delim("upgenes.txt", header = FALSE, quote="",sep = "\t") #then I made it a list abaupr=as.list(abaupr) #then I did just like I did on my test case above but got an error about #ifnotfound. a1=mget(abaupr, ath1121501ACCNUM) #Error in .checkKeys(value, Lkeys(x), x at ifnotfound) : # the keys must be character strings #I looked up ifnotfound in mget.....and still dont understand #the error. #the only option is NA, but......... a1=mget(abaupr, ath1121501ACCNUM,ifnotfound=NA) #Error in .checkKeys(value, Lkeys(x), x at ifnotfound) : # the keys must be character strings My lack of understanding could be due to my lack of getting mget.....any help? Thanks! Siobhan S.A. Braybrook Section of Plant Biology University of California, Davis Davis, CA 530-752-6980 "The time is always right to do what is right." -Dr. Martin Luther King Jr.
probe probe • 671 views
ADD COMMENT
0
Entering edit mode
Marc Carlson ★ 7.2k
@marc-carlson-2264
Last seen 7.7 years ago
United States
Siobhan Braybrook wrote: > please excuse me if this is elementary, but I am lost about an error I am > getting. > I want to use a list of probe IDs to get out the genes from ath1121501ACCNUM. > > So I did the following: > > library(annotate) > library(ath1121501.db) > #next I made a short list of probe IDs to test my mget ability > abaup=c("262128_at","255795_at","266462_at","250648_at","247095_at", "258498_at","247723_at","258347_at","245982_at","263497_at") > a1=mget(abaup, ath1121501ACCNUM) > #this worked just fine > #so I made a txt file of all the probe IDs I wanted to look up, and read in > abaupr= read.delim("upgenes.txt", header = FALSE, quote="",sep = "\t") > #then I made it a list > abaupr=as.list(abaupr) > #then I did just like I did on my test case above but got an error about > #ifnotfound. > a1=mget(abaupr, ath1121501ACCNUM) > #Error in .checkKeys(value, Lkeys(x), x at ifnotfound) : > # the keys must be character strings > > #I looked up ifnotfound in mget.....and still dont understand #the error. > #the only option is NA, but......... > a1=mget(abaupr, ath1121501ACCNUM,ifnotfound=NA) > #Error in .checkKeys(value, Lkeys(x), x at ifnotfound) : > # the keys must be character strings > > My lack of understanding could be due to my lack of getting mget.....any help? > > Thanks! > Siobhan > > S.A. Braybrook > Section of Plant Biology > University of California, Davis > Davis, CA > 530-752-6980 > > "The time is always right to do what is right." > -Dr. Martin Luther King Jr. > > _______________________________________________ > 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 > > Hi Siobhan, The problem you are having is because the mget() function expects a simple character vector. In your 1st example this is what you had, but after you read the data in from a file you had a matrix that you then cast into a list. Try just slicing out the column that you need from your matrix like below: #1st you can start out like before abaupr= read.delim("upgenes.txt", header = FALSE, quote="",sep = "\t") #but then do something more like this: foo = as.vector(abaupr[,1]) #if you now look with class() you can see you have a simple character vector now class(foo) #and now this can work with mget: a1=mget(foo, ath1121501ACCNUM) Marc
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 41 minutes ago
United States
Hi Siobhan, Siobhan Braybrook wrote: > please excuse me if this is elementary, but I am lost about an error I am > getting. > I want to use a list of probe IDs to get out the genes from ath1121501ACCNUM. > > So I did the following: > > library(annotate) > library(ath1121501.db) > #next I made a short list of probe IDs to test my mget ability > abaup=c("262128_at","255795_at","266462_at","250648_at","247095_at", "258498_at","247723_at","258347_at","245982_at","263497_at") > This isn't a list - it is a character vector. > a1=mget(abaup, ath1121501ACCNUM) > #this worked just fine > #so I made a txt file of all the probe IDs I wanted to look up, and read in > abaupr= read.delim("upgenes.txt", header = FALSE, quote="",sep = "\t") > #then I made it a list > abaupr=as.list(abaupr) > #then I did just like I did on my test case above but got an error about > #ifnotfound. > a1=mget(abaupr, ath1121501ACCNUM) > #Error in .checkKeys(value, Lkeys(x), x at ifnotfound) : > # the keys must be character strings > This error is trying to tell you that you are supposed to be feeding mget() a character vector rather than a list, which is why it worked above and didn't work here. Just remove the as.list() part and you should be good. Best, Jim > #I looked up ifnotfound in mget.....and still dont understand #the error. > #the only option is NA, but......... > a1=mget(abaupr, ath1121501ACCNUM,ifnotfound=NA) > #Error in .checkKeys(value, Lkeys(x), x at ifnotfound) : > # the keys must be character strings > > My lack of understanding could be due to my lack of getting mget.....any help? > > Thanks! > Siobhan > > S.A. Braybrook > Section of Plant Biology > University of California, Davis > Davis, CA > 530-752-6980 > > "The time is always right to do what is right." > -Dr. Martin Luther King Jr. > > _______________________________________________ > 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

Login before adding your answer.

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