Annotation.db: how automatically call a mapping?
3
0
Entering edit mode
Guido Hooiveld ★ 3.9k
@guido-hooiveld-2020
Last seen 1 day ago
Wageningen University, Wageningen, the …
Hi, I am facing a problem i cannot solve myselves, despite everything i read/know. But i assume the solution is easy for the more knowledgable folks in BioC/R... This does work: > library(moe430a.db) > xxyy <- moe430aSYMBOL > xxyy SYMBOL map for chip moe430a (object of class "AnnDbBimap") However, for this to work you need to know the array type of the data that is analyzed. Now i would like to automatically extract the (e.g.) SYMBOL mapping from an annotation.db, thus by retrieving the array type from the eset. > library(affy) > eset <- rma(data) > probeids <- featureNames(eset) > annotation(eset) [1] "moe430a" But how can i use this info to properly call the SYMBOL mapping? I tried this: > arraytype <- annotation(eset) > arraytype <- paste(arraytype, "db", sep = ".") > arraytype [1] "moe430a.db" > arraytype <- paste("package", arraytype, sep = ":") > gh <- ls(arraytype) > gh [1] "moe430a" "moe430a_dbconn" "moe430a_dbfile" "moe430a_dbInfo" "moe430a_dbschema" "moe430aACCNUM" "moe430aALIAS2PROBE" "moe430aCHR" "moe430aCHRLENGTHS" "moe430aCHRLOC" [11] "moe430aCHRLOCEND" "moe430aENSEMBL" "moe430aENSEMBL2PROBE" "moe430aENTREZID" "moe430aENZYME" "moe430aENZYME2PROBE" "moe430aGENENAME" "moe430aGO" "moe430aGO2ALLPROBES" "moe430aGO2PROBE" [21] "moe430aMAP" "moe430aMAPCOUNTS" "moe430aMGI" "moe430aMGI2PROBE" "moe430aORGANISM" "moe430aPATH" "moe430aPATH2PROBE" "moe430aPFAM" "moe430aPMID" "moe430aPMID2PROBE" [31] "moe430aPROSITE" "moe430aREFSEQ" "moe430aSYMBOL" "moe430aUNIGENE" "moe430aUNIPROT" > gh[33] [1] "moe430aSYMBOL" > > symbols <- mget(probeids, gh[33]) Error in mget(probeids, gh[33]) : second argument must be an environment This also doesn't work: > symbols <- mget(probeids, envir=gh[33]) Error in mget(probeids, envir = gh[33]) : second argument must be an environment My approach thus is the wrong approach to automatically extract mappings from a annotation.db. Since i don't know about any other possibility, i would appreciate if someone could point me to a working solution. Thanks, Guido ------------------------------------------------ Guido Hooiveld, PhD Nutrition, Metabolism & Genomics Group Division of Human Nutrition Wageningen University Biotechnion, Bomenweg 2 NL-6703 HD Wageningen the Netherlands tel: (+)31 317 485788 fax: (+)31 317 483342 internet: http://nutrigene.4t.com <http: nutrigene.4t.com=""/> email: guido.hooiveld@wur.nl [[alternative HTML version deleted]]
Annotation moe430a Annotation moe430a • 1.9k views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 6 weeks ago
United States
Hooiveld, Guido wrote: > Hi, > > I am facing a problem i cannot solve myselves, despite everything i > read/know. But i assume the solution is easy for the more knowledgable > folks in BioC/R... > > This does work: >> library(moe430a.db) >> xxyy <- moe430aSYMBOL >> xxyy > SYMBOL map for chip moe430a (object of class "AnnDbBimap") > > However, for this to work you need to know the array type of the data > that is analyzed. > > > Now i would like to automatically extract the (e.g.) SYMBOL mapping from > an annotation.db, thus by retrieving the array type from the eset. > >> library(affy) >> eset <- rma(data) >> probeids <- featureNames(eset) >> annotation(eset) > [1] "moe430a" > > But how can i use this info to properly call the SYMBOL mapping? Hi Guido -- to get the appropriate map library(annotate) map = getAnnMap("SYMBOL", annotation(eset)) to select just the relevant probes map[probeids] toTable(map[probeids]) or as.list(map[probeids]) might be the next step in the work flow. Martin > > I tried this: >> arraytype <- annotation(eset) >> arraytype <- paste(arraytype, "db", sep = ".") >> arraytype > [1] "moe430a.db" >> arraytype <- paste("package", arraytype, sep = ":") >> gh <- ls(arraytype) >> gh > [1] "moe430a" "moe430a_dbconn" "moe430a_dbfile" > "moe430a_dbInfo" "moe430a_dbschema" "moe430aACCNUM" > "moe430aALIAS2PROBE" "moe430aCHR" "moe430aCHRLENGTHS" > "moe430aCHRLOC" > [11] "moe430aCHRLOCEND" "moe430aENSEMBL" > "moe430aENSEMBL2PROBE" "moe430aENTREZID" "moe430aENZYME" > "moe430aENZYME2PROBE" "moe430aGENENAME" "moe430aGO" > "moe430aGO2ALLPROBES" "moe430aGO2PROBE" > [21] "moe430aMAP" "moe430aMAPCOUNTS" "moe430aMGI" > "moe430aMGI2PROBE" "moe430aORGANISM" "moe430aPATH" > "moe430aPATH2PROBE" "moe430aPFAM" "moe430aPMID" > "moe430aPMID2PROBE" > [31] "moe430aPROSITE" "moe430aREFSEQ" "moe430aSYMBOL" > "moe430aUNIGENE" "moe430aUNIPROT" > >> gh[33] > [1] "moe430aSYMBOL" >> symbols <- mget(probeids, gh[33]) > Error in mget(probeids, gh[33]) : second argument must be an environment > > This also doesn't work: >> symbols <- mget(probeids, envir=gh[33]) > Error in mget(probeids, envir = gh[33]) : > second argument must be an environment > > My approach thus is the wrong approach to automatically extract mappings > from a annotation.db. > Since i don't know about any other possibility, i would appreciate if > someone could point me to a working solution. > > Thanks, > Guido > > > ------------------------------------------------ > Guido Hooiveld, PhD > Nutrition, Metabolism & Genomics Group > Division of Human Nutrition > Wageningen University > Biotechnion, Bomenweg 2 > NL-6703 HD Wageningen > the Netherlands > tel: (+)31 317 485788 > fax: (+)31 317 483342 > internet: http://nutrigene.4t.com <http: nutrigene.4t.com=""/> > email: guido.hooiveld at wur.nl > > > > [[alternative HTML version deleted]] > > _______________________________________________ > 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 Martin, Indeed, another useful, straigh-forward possibility for mapping. However, I am now facing the problem of properly combining the annotation info with the expression data. This is what I would like to do: >Tab_data <- exprs(eset[probeids]) >Tab_data <- cbind(Tab_data, fit2$Amean) # to add average expression of LIMMA output >Tab_data <- cbind(Tab_data, fit2$p.value) # to add p-value of LIMMA output etc. This al goes fine, however adding the annotation info 'mixes-up' the content of Tab_data; the annotation data replaces the first column of Tab_data, and the content of all cells is replaced by 'null'. I suspect it has something to do with the type of object I would like to merge, but I am not sure. > map.entrez <- getAnnMap("ENTREZID", annotation(eset)) > map.entrez <- as.list(map.entrez[probeids]) > Tab_data <- cbind(Tab_data, map.entrez) ^ in R this seems to work, but when saved as .txt the content of Tab_data is completely mixed up. Before 'adding' map.entrez Tab_dat is OK. > write.table(cbind(rownames(Tab_data2), Tab_data2), file="test_1234.txt", sep="\t", col.names=TRUE, row.names=FALSE) > class(Tab_data) [1] "matrix" > class(map.entrez) [1] "list" > Do you, or someone elsr, have a suggestion how to properly link these two types of data? Thanks again, Guido > -----Original Message----- > From: bioconductor-bounces at stat.math.ethz.ch > [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of > Martin Morgan > Sent: 30 June 2009 00:00 > To: Hooiveld, Guido > Cc: bioconductor at stat.math.ethz.ch > Subject: Re: [BioC] Annotation.db: how automatically call a mapping? > > Hooiveld, Guido wrote: > > Hi, > > > > I am facing a problem i cannot solve myselves, despite everything i > > read/know. But i assume the solution is easy for the more > knowledgable > > folks in BioC/R... > > > > This does work: > >> library(moe430a.db) > >> xxyy <- moe430aSYMBOL > >> xxyy > > SYMBOL map for chip moe430a (object of class "AnnDbBimap") > > > > However, for this to work you need to know the array type > of the data > > that is analyzed. > > > > > > Now i would like to automatically extract the (e.g.) SYMBOL mapping > > from an annotation.db, thus by retrieving the array type > from the eset. > > > >> library(affy) > >> eset <- rma(data) > >> probeids <- featureNames(eset) > >> annotation(eset) > > [1] "moe430a" > > > > But how can i use this info to properly call the SYMBOL mapping? > > Hi Guido -- > > to get the appropriate map > > library(annotate) > map = getAnnMap("SYMBOL", annotation(eset)) > > to select just the relevant probes > > map[probeids] > > toTable(map[probeids]) or as.list(map[probeids]) might be the > next step in the work flow. > > Martin > > > > > I tried this: > >> arraytype <- annotation(eset) > >> arraytype <- paste(arraytype, "db", sep = ".") arraytype > > [1] "moe430a.db" > >> arraytype <- paste("package", arraytype, sep = ":") gh <- > >> ls(arraytype) gh > > [1] "moe430a" "moe430a_dbconn" "moe430a_dbfile" > > "moe430a_dbInfo" "moe430a_dbschema" "moe430aACCNUM" > > "moe430aALIAS2PROBE" "moe430aCHR" "moe430aCHRLENGTHS" > > "moe430aCHRLOC" > > [11] "moe430aCHRLOCEND" "moe430aENSEMBL" > > "moe430aENSEMBL2PROBE" "moe430aENTREZID" "moe430aENZYME" > > "moe430aENZYME2PROBE" "moe430aGENENAME" "moe430aGO" > > "moe430aGO2ALLPROBES" "moe430aGO2PROBE" > > [21] "moe430aMAP" "moe430aMAPCOUNTS" "moe430aMGI" > > "moe430aMGI2PROBE" "moe430aORGANISM" "moe430aPATH" > > "moe430aPATH2PROBE" "moe430aPFAM" "moe430aPMID" > > "moe430aPMID2PROBE" > > [31] "moe430aPROSITE" "moe430aREFSEQ" "moe430aSYMBOL" > > "moe430aUNIGENE" "moe430aUNIPROT" > > > >> gh[33] > > [1] "moe430aSYMBOL" > >> symbols <- mget(probeids, gh[33]) > > Error in mget(probeids, gh[33]) : second argument must be an > > environment > > > > This also doesn't work: > >> symbols <- mget(probeids, envir=gh[33]) > > Error in mget(probeids, envir = gh[33]) : > > second argument must be an environment > > > > My approach thus is the wrong approach to automatically extract > > mappings from a annotation.db. > > Since i don't know about any other possibility, i would > appreciate if > > someone could point me to a working solution. > > > > Thanks, > > Guido > > > > > > ------------------------------------------------ > > Guido Hooiveld, PhD > > Nutrition, Metabolism & Genomics Group Division of Human Nutrition > > Wageningen University Biotechnion, Bomenweg 2 > > NL-6703 HD Wageningen > > the Netherlands > > tel: (+)31 317 485788 > > fax: (+)31 317 483342 > > internet: http://nutrigene.4t.com <http: nutrigene.4t.com=""/> > > email: guido.hooiveld at wur.nl > > > > > > > > [[alternative HTML version deleted]] > > > > _______________________________________________ > > 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
0
Entering edit mode
Hooiveld, Guido wrote: > Hi Martin, > > Indeed, another useful, straigh-forward possibility for mapping. > However, I am now facing the problem of properly combining the > annotation info with the expression data. This is what I would like to > do: > >> Tab_data <- exprs(eset[probeids]) >> Tab_data <- cbind(Tab_data, fit2$Amean) # to add average expression of > LIMMA output >> Tab_data <- cbind(Tab_data, fit2$p.value) # to add p-value of LIMMA > output > etc. > > This al goes fine, however adding the annotation info 'mixes-up' the > content of Tab_data; the annotation data replaces the first column of > Tab_data, and the content of all cells is replaced by 'null'. I suspect > it has something to do with the type of object I would like to merge, > but I am not sure. > >> map.entrez <- getAnnMap("ENTREZID", annotation(eset)) >> map.entrez <- as.list(map.entrez[probeids]) > > >> Tab_data <- cbind(Tab_data, map.entrez) this cbind's a matrix and a list; check that the mapping between probeid and entrez id is strictly 1:1, convert to a named vector, and use the names to coordinately subset & replace library(annotate) data(sample.ExpressionSet) obj <- sample.ExpressionSet # save typing ;) map <- getAnnMap('ENTREZID', annotation(obj)) submap <- map[featureNames(obj)] elts <- as.list(submap) stopifnot(all(sapply(elts, length)) == 1) tabdat <- as.data.frame(exprs(obj)) # conceptually no longer a matrix tabdat[names(elts), "ENTREZID"] <- unlist(elts, use.names=FALSE) if the objective were other than to export data from R, and the data 'SomeData' something experiment specific (like the p.values from limma) I'd suggest something along the lines of featureData(obj)[["SomeData", labelDescription="describe SomeData"]] <- SomeData to add the data to obj, and to carry it forward in a coordinated fashion for subsequent analysis, e.g., eventually forOutput <- cbind(exprs(obj), fData(obj)) (the syntax for simultaneously creating and assigning a _subset_ of featureData is a little convoluted, featureData(obj)[["...", labelD...]][indexToCreate] <- values ). In this case also one wants to make sure the data is appropriately formatted for standard R operations, e.g., cbinding a matrix / data frame with a vector, rather than a list. Martin > ^ in R this seems to work, but when saved as .txt the content of > Tab_data is completely mixed up. Before 'adding' map.entrez Tab_dat is > OK. > > >> write.table(cbind(rownames(Tab_data2), Tab_data2), > file="test_1234.txt", sep="\t", col.names=TRUE, row.names=FALSE) > >> class(Tab_data) > [1] "matrix" >> class(map.entrez) > [1] "list" > > > Do you, or someone elsr, have a suggestion how to properly link these > two types of data? > Thanks again, > Guido > > > > > >> -----Original Message----- >> From: bioconductor-bounces at stat.math.ethz.ch >> [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of >> Martin Morgan >> Sent: 30 June 2009 00:00 >> To: Hooiveld, Guido >> Cc: bioconductor at stat.math.ethz.ch >> Subject: Re: [BioC] Annotation.db: how automatically call a mapping? >> >> Hooiveld, Guido wrote: >>> Hi, >>> >>> I am facing a problem i cannot solve myselves, despite everything i >>> read/know. But i assume the solution is easy for the more >> knowledgable >>> folks in BioC/R... >>> >>> This does work: >>>> library(moe430a.db) >>>> xxyy <- moe430aSYMBOL >>>> xxyy >>> SYMBOL map for chip moe430a (object of class "AnnDbBimap") >>> >>> However, for this to work you need to know the array type >> of the data >>> that is analyzed. >>> >>> >>> Now i would like to automatically extract the (e.g.) SYMBOL mapping >>> from an annotation.db, thus by retrieving the array type >> from the eset. >>> >>>> library(affy) >>>> eset <- rma(data) >>>> probeids <- featureNames(eset) >>>> annotation(eset) >>> [1] "moe430a" >>> >>> But how can i use this info to properly call the SYMBOL mapping? >> Hi Guido -- >> >> to get the appropriate map >> >> library(annotate) >> map = getAnnMap("SYMBOL", annotation(eset)) >> >> to select just the relevant probes >> >> map[probeids] >> >> toTable(map[probeids]) or as.list(map[probeids]) might be the >> next step in the work flow. >> >> Martin >> >>> >>> I tried this: >>>> arraytype <- annotation(eset) >>>> arraytype <- paste(arraytype, "db", sep = ".") arraytype >>> [1] "moe430a.db" >>>> arraytype <- paste("package", arraytype, sep = ":") gh <- >>>> ls(arraytype) gh >>> [1] "moe430a" "moe430a_dbconn" "moe430a_dbfile" >>> "moe430a_dbInfo" "moe430a_dbschema" "moe430aACCNUM" >>> "moe430aALIAS2PROBE" "moe430aCHR" "moe430aCHRLENGTHS" >>> "moe430aCHRLOC" >>> [11] "moe430aCHRLOCEND" "moe430aENSEMBL" >>> "moe430aENSEMBL2PROBE" "moe430aENTREZID" "moe430aENZYME" >>> "moe430aENZYME2PROBE" "moe430aGENENAME" "moe430aGO" >>> "moe430aGO2ALLPROBES" "moe430aGO2PROBE" >>> [21] "moe430aMAP" "moe430aMAPCOUNTS" "moe430aMGI" >>> "moe430aMGI2PROBE" "moe430aORGANISM" "moe430aPATH" >>> "moe430aPATH2PROBE" "moe430aPFAM" "moe430aPMID" >>> "moe430aPMID2PROBE" >>> [31] "moe430aPROSITE" "moe430aREFSEQ" "moe430aSYMBOL" >>> "moe430aUNIGENE" "moe430aUNIPROT" >>> >>>> gh[33] >>> [1] "moe430aSYMBOL" >>>> symbols <- mget(probeids, gh[33]) >>> Error in mget(probeids, gh[33]) : second argument must be an >>> environment >>> >>> This also doesn't work: >>>> symbols <- mget(probeids, envir=gh[33]) >>> Error in mget(probeids, envir = gh[33]) : >>> second argument must be an environment >>> >>> My approach thus is the wrong approach to automatically extract >>> mappings from a annotation.db. >>> Since i don't know about any other possibility, i would >> appreciate if >>> someone could point me to a working solution. >>> >>> Thanks, >>> Guido >>> >>> >>> ------------------------------------------------ >>> Guido Hooiveld, PhD >>> Nutrition, Metabolism & Genomics Group Division of Human Nutrition >>> Wageningen University Biotechnion, Bomenweg 2 >>> NL-6703 HD Wageningen >>> the Netherlands >>> tel: (+)31 317 485788 >>> fax: (+)31 317 483342 >>> internet: http://nutrigene.4t.com <http: nutrigene.4t.com=""/> >>> email: guido.hooiveld at wur.nl >>> >>> >>> >>> [[alternative HTML version deleted]] >>> >>> _______________________________________________ >>> 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
0
Entering edit mode
Hi Guido, Hooiveld, Guido wrote: > Hi Martin, > > Indeed, another useful, straigh-forward possibility for mapping. > However, I am now facing the problem of properly combining the > annotation info with the expression data. This is what I would like to > do: > >> Tab_data <- exprs(eset[probeids]) >> Tab_data <- cbind(Tab_data, fit2$Amean) # to add average expression of > LIMMA output >> Tab_data <- cbind(Tab_data, fit2$p.value) # to add p-value of LIMMA > output > etc. > > This al goes fine, however adding the annotation info 'mixes-up' the > content of Tab_data; the annotation data replaces the first column of > Tab_data, and the content of all cells is replaced by 'null'. I suspect > it has something to do with the type of object I would like to merge, > but I am not sure. > >> map.entrez <- getAnnMap("ENTREZID", annotation(eset)) >> map.entrez <- as.list(map.entrez[probeids]) This sort of thing is going to get really difficult to do by hand when you get to things that have a one-to-many relationship. And you are already duplicating existing efforts with what you have done so far. If you want to combine annotation data with results data, you really want to be using the annaffy package which does lots of these things seamlessly. And if you want things to be a bit easier, you could consider using the affycoretools package as well, which for the most part uses annaffy to create output. You can do what you appear to want in one line: probes2table(eset, featureNames(eset), annotation(eset), list("p-value"= fit2$p.value, "mean" = fit2$Amean), html = FALSE, filename = "output") You might need to play around with the 'anncols' argument to get what annotation data you might want. If you want output specific to the contrasts you have fit, see ?limma2annaffy. Best, Jim > > >> Tab_data <- cbind(Tab_data, map.entrez) > ^ in R this seems to work, but when saved as .txt the content of > Tab_data is completely mixed up. Before 'adding' map.entrez Tab_dat is > OK. > > >> write.table(cbind(rownames(Tab_data2), Tab_data2), > file="test_1234.txt", sep="\t", col.names=TRUE, row.names=FALSE) > >> class(Tab_data) > [1] "matrix" >> class(map.entrez) > [1] "list" > > > Do you, or someone elsr, have a suggestion how to properly link these > two types of data? > Thanks again, > Guido > > > > > >> -----Original Message----- >> From: bioconductor-bounces at stat.math.ethz.ch >> [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of >> Martin Morgan >> Sent: 30 June 2009 00:00 >> To: Hooiveld, Guido >> Cc: bioconductor at stat.math.ethz.ch >> Subject: Re: [BioC] Annotation.db: how automatically call a mapping? >> >> Hooiveld, Guido wrote: >>> Hi, >>> >>> I am facing a problem i cannot solve myselves, despite everything i >>> read/know. But i assume the solution is easy for the more >> knowledgable >>> folks in BioC/R... >>> >>> This does work: >>>> library(moe430a.db) >>>> xxyy <- moe430aSYMBOL >>>> xxyy >>> SYMBOL map for chip moe430a (object of class "AnnDbBimap") >>> >>> However, for this to work you need to know the array type >> of the data >>> that is analyzed. >>> >>> >>> Now i would like to automatically extract the (e.g.) SYMBOL mapping >>> from an annotation.db, thus by retrieving the array type >> from the eset. >>> >>>> library(affy) >>>> eset <- rma(data) >>>> probeids <- featureNames(eset) >>>> annotation(eset) >>> [1] "moe430a" >>> >>> But how can i use this info to properly call the SYMBOL mapping? >> Hi Guido -- >> >> to get the appropriate map >> >> library(annotate) >> map = getAnnMap("SYMBOL", annotation(eset)) >> >> to select just the relevant probes >> >> map[probeids] >> >> toTable(map[probeids]) or as.list(map[probeids]) might be the >> next step in the work flow. >> >> Martin >> >>> >>> I tried this: >>>> arraytype <- annotation(eset) >>>> arraytype <- paste(arraytype, "db", sep = ".") arraytype >>> [1] "moe430a.db" >>>> arraytype <- paste("package", arraytype, sep = ":") gh <- >>>> ls(arraytype) gh >>> [1] "moe430a" "moe430a_dbconn" "moe430a_dbfile" >>> "moe430a_dbInfo" "moe430a_dbschema" "moe430aACCNUM" >>> "moe430aALIAS2PROBE" "moe430aCHR" "moe430aCHRLENGTHS" >>> "moe430aCHRLOC" >>> [11] "moe430aCHRLOCEND" "moe430aENSEMBL" >>> "moe430aENSEMBL2PROBE" "moe430aENTREZID" "moe430aENZYME" >>> "moe430aENZYME2PROBE" "moe430aGENENAME" "moe430aGO" >>> "moe430aGO2ALLPROBES" "moe430aGO2PROBE" >>> [21] "moe430aMAP" "moe430aMAPCOUNTS" "moe430aMGI" >>> "moe430aMGI2PROBE" "moe430aORGANISM" "moe430aPATH" >>> "moe430aPATH2PROBE" "moe430aPFAM" "moe430aPMID" >>> "moe430aPMID2PROBE" >>> [31] "moe430aPROSITE" "moe430aREFSEQ" "moe430aSYMBOL" >>> "moe430aUNIGENE" "moe430aUNIPROT" >>> >>>> gh[33] >>> [1] "moe430aSYMBOL" >>>> symbols <- mget(probeids, gh[33]) >>> Error in mget(probeids, gh[33]) : second argument must be an >>> environment >>> >>> This also doesn't work: >>>> symbols <- mget(probeids, envir=gh[33]) >>> Error in mget(probeids, envir = gh[33]) : >>> second argument must be an environment >>> >>> My approach thus is the wrong approach to automatically extract >>> mappings from a annotation.db. >>> Since i don't know about any other possibility, i would >> appreciate if >>> someone could point me to a working solution. >>> >>> Thanks, >>> Guido >>> >>> >>> ------------------------------------------------ >>> Guido Hooiveld, PhD >>> Nutrition, Metabolism & Genomics Group Division of Human Nutrition >>> Wageningen University Biotechnion, Bomenweg 2 >>> NL-6703 HD Wageningen >>> the Netherlands >>> tel: (+)31 317 485788 >>> fax: (+)31 317 483342 >>> internet: http://nutrigene.4t.com <http: nutrigene.4t.com=""/> >>> email: guido.hooiveld at wur.nl >>> >>> >>> >>> [[alternative HTML version deleted]] >>> >>> _______________________________________________ >>> 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 >> >> > > _______________________________________________ > 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 -- James W. MacDonald, M.S. Biostatistician Douglas Lab University of Michigan Department of Human Genetics 5912 Buhl 1241 E. Catherine St. Ann Arbor MI 48109-5618 734-615-7826
ADD REPLY
0
Entering edit mode
Hi Jim, Since your suggestion looks indeed easy and seems to provide everything I would like to have, a gave it a try (I'll have a further look at Martin's comments/suggestions later). However, it seems that 'probes2table' cannot properly handle multiple contrast defined in limma: > library(affycoretools) Loading required package: GO.db Loading required package: DBI Loading required package: KEGG.db > probes2table(eset, featureNames(eset), annotation(eset), list("p-value"= fit2$p.value, "mean" = fit2$Amean), html = FALSE, filename = "output") Loading required package: moe430a.db Error in aafTable(items = otherdata) : All columns must be of equal length > length(fit2$p.value) [1] 68070 > > length(fit2$Amean) [1] 22690 > I analyzed three contrasts in limma, and 68070/3 is 22690, which exactly equals the number of probesets on the Affy MOE430A array. This thus explains the error. Question: can this easily be solved? Can limma2annaffy handle multiple contrasts? (at the moment I am not familiar with affycoretools at all). Thanks, Guido > -----Original Message----- > From: bioconductor-bounces at stat.math.ethz.ch > [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of > James W. MacDonald > Sent: 30 June 2009 19:44 > To: Hooiveld, Guido > Cc: bioconductor at stat.math.ethz.ch > Subject: Re: [BioC] Annotation.db: how automatically call a mapping? > > Hi Guido, > > Hooiveld, Guido wrote: > > Hi Martin, > > > > Indeed, another useful, straigh-forward possibility for mapping. > > However, I am now facing the problem of properly combining the > > annotation info with the expression data. This is what I > would like to > > do: > > > >> Tab_data <- exprs(eset[probeids]) > >> Tab_data <- cbind(Tab_data, fit2$Amean) # to add average > expression > >> of > > LIMMA output > >> Tab_data <- cbind(Tab_data, fit2$p.value) # to add p-value of LIMMA > > output > > etc. > > > > This al goes fine, however adding the annotation info > 'mixes-up' the > > content of Tab_data; the annotation data replaces the first > column of > > Tab_data, and the content of all cells is replaced by 'null'. I > > suspect it has something to do with the type of object I > would like to > > merge, but I am not sure. > > > >> map.entrez <- getAnnMap("ENTREZID", annotation(eset)) > map.entrez <- > >> as.list(map.entrez[probeids]) > > This sort of thing is going to get really difficult to do by > hand when you get to things that have a one-to-many > relationship. And you are already duplicating existing > efforts with what you have done so far. > > If you want to combine annotation data with results data, you > really want to be using the annaffy package which does lots > of these things seamlessly. And if you want things to be a > bit easier, you could consider using the affycoretools > package as well, which for the most part uses annaffy to > create output. > > You can do what you appear to want in one line: > > probes2table(eset, featureNames(eset), annotation(eset), > list("p-value"= fit2$p.value, "mean" = fit2$Amean), html = > FALSE, filename = "output") > > You might need to play around with the 'anncols' argument to > get what annotation data you might want. > > If you want output specific to the contrasts you have fit, > see ?limma2annaffy. > > Best, > > Jim > > > > > > > > >> Tab_data <- cbind(Tab_data, map.entrez) > > ^ in R this seems to work, but when saved as .txt the content of > > Tab_data is completely mixed up. Before 'adding' map.entrez > Tab_dat is > > OK. > > > > > >> write.table(cbind(rownames(Tab_data2), Tab_data2), > > file="test_1234.txt", sep="\t", col.names=TRUE, row.names=FALSE) > > > >> class(Tab_data) > > [1] "matrix" > >> class(map.entrez) > > [1] "list" > > > > > > Do you, or someone elsr, have a suggestion how to properly > link these > > two types of data? > > Thanks again, > > Guido > > > > > > > > > > > >> -----Original Message----- > >> From: bioconductor-bounces at stat.math.ethz.ch > >> [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf > Of Martin > >> Morgan > >> Sent: 30 June 2009 00:00 > >> To: Hooiveld, Guido > >> Cc: bioconductor at stat.math.ethz.ch > >> Subject: Re: [BioC] Annotation.db: how automatically call > a mapping? > >> > >> Hooiveld, Guido wrote: > >>> Hi, > >>> > >>> I am facing a problem i cannot solve myselves, despite > everything i > >>> read/know. But i assume the solution is easy for the more > >> knowledgable > >>> folks in BioC/R... > >>> > >>> This does work: > >>>> library(moe430a.db) > >>>> xxyy <- moe430aSYMBOL > >>>> xxyy > >>> SYMBOL map for chip moe430a (object of class "AnnDbBimap") > >>> > >>> However, for this to work you need to know the array type > >> of the data > >>> that is analyzed. > >>> > >>> > >>> Now i would like to automatically extract the (e.g.) > SYMBOL mapping > >>> from an annotation.db, thus by retrieving the array type > >> from the eset. > >>> > >>>> library(affy) > >>>> eset <- rma(data) > >>>> probeids <- featureNames(eset) > >>>> annotation(eset) > >>> [1] "moe430a" > >>> > >>> But how can i use this info to properly call the SYMBOL mapping? > >> Hi Guido -- > >> > >> to get the appropriate map > >> > >> library(annotate) > >> map = getAnnMap("SYMBOL", annotation(eset)) > >> > >> to select just the relevant probes > >> > >> map[probeids] > >> > >> toTable(map[probeids]) or as.list(map[probeids]) might be the next > >> step in the work flow. > >> > >> Martin > >> > >>> > >>> I tried this: > >>>> arraytype <- annotation(eset) > >>>> arraytype <- paste(arraytype, "db", sep = ".") arraytype > >>> [1] "moe430a.db" > >>>> arraytype <- paste("package", arraytype, sep = ":") gh <- > >>>> ls(arraytype) gh > >>> [1] "moe430a" "moe430a_dbconn" > "moe430a_dbfile" > >>> "moe430a_dbInfo" "moe430a_dbschema" "moe430aACCNUM" > >>> "moe430aALIAS2PROBE" "moe430aCHR" "moe430aCHRLENGTHS" > >>> "moe430aCHRLOC" > >>> [11] "moe430aCHRLOCEND" "moe430aENSEMBL" > >>> "moe430aENSEMBL2PROBE" "moe430aENTREZID" "moe430aENZYME" > >>> "moe430aENZYME2PROBE" "moe430aGENENAME" "moe430aGO" > >>> "moe430aGO2ALLPROBES" "moe430aGO2PROBE" > >>> [21] "moe430aMAP" "moe430aMAPCOUNTS" "moe430aMGI" > >>> "moe430aMGI2PROBE" "moe430aORGANISM" "moe430aPATH" > >>> "moe430aPATH2PROBE" "moe430aPFAM" "moe430aPMID" > >>> "moe430aPMID2PROBE" > >>> [31] "moe430aPROSITE" "moe430aREFSEQ" "moe430aSYMBOL" > >>> "moe430aUNIGENE" "moe430aUNIPROT" > >>> > >>>> gh[33] > >>> [1] "moe430aSYMBOL" > >>>> symbols <- mget(probeids, gh[33]) > >>> Error in mget(probeids, gh[33]) : second argument must be an > >>> environment > >>> > >>> This also doesn't work: > >>>> symbols <- mget(probeids, envir=gh[33]) > >>> Error in mget(probeids, envir = gh[33]) : > >>> second argument must be an environment > >>> > >>> My approach thus is the wrong approach to automatically extract > >>> mappings from a annotation.db. > >>> Since i don't know about any other possibility, i would > >> appreciate if > >>> someone could point me to a working solution. > >>> > >>> Thanks, > >>> Guido > >>> > >>> > >>> ------------------------------------------------ > >>> Guido Hooiveld, PhD > >>> Nutrition, Metabolism & Genomics Group Division of Human > Nutrition > >>> Wageningen University Biotechnion, Bomenweg 2 > >>> NL-6703 HD Wageningen > >>> the Netherlands > >>> tel: (+)31 317 485788 > >>> fax: (+)31 317 483342 > >>> internet: http://nutrigene.4t.com <http: nutrigene.4t.com=""/> > >>> email: guido.hooiveld at wur.nl > >>> > >>> > >>> > >>> [[alternative HTML version deleted]] > >>> > >>> _______________________________________________ > >>> 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 > >> > >> > > > > _______________________________________________ > > 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 > > -- > James W. MacDonald, M.S. > Biostatistician > Douglas Lab > University of Michigan > Department of Human Genetics > 5912 Buhl > 1241 E. Catherine St. > Ann Arbor MI 48109-5618 > 734-615-7826 > > _______________________________________________ > 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
0
Entering edit mode
Hooiveld, Guido wrote: > Hi Jim, > Since your suggestion looks indeed easy and seems to provide everything > I would like to have, a gave it a try (I'll have a further look at > Martin's comments/suggestions later). > However, it seems that 'probes2table' cannot properly handle multiple > contrast defined in limma: > >> library(affycoretools) > Loading required package: GO.db > Loading required package: DBI > Loading required package: KEGG.db >> probes2table(eset, featureNames(eset), annotation(eset), > list("p-value"= fit2$p.value, "mean" = fit2$Amean), html = FALSE, > filename = "output") > Loading required package: moe430a.db > Error in aafTable(items = otherdata) : > All columns must be of equal length >> length(fit2$p.value) > [1] 68070 >> length(fit2$Amean) > [1] 22690 > > I analyzed three contrasts in limma, and 68070/3 is 22690, which exactly > equals the number of probesets on the Affy MOE430A array. This thus > explains the error. > > Question: can this easily be solved? Can limma2annaffy handle multiple > contrasts? (at the moment I am not familiar with affycoretools at all). limma2annaffy(eset, fit2, <designmatrixname>, <contrastsmatrixname>, annotation(eset), pfilt=1, html = FALSE, interactive = FALSE) should give you text tables for each contrast. I would normally use a reasonable p-value and possibly a fold filter to reduce the output to the reporters of interest, and use html = TRUE because my end users in general like that better than the text. However, for all reporters on this chip the HTML table is too huge to be of use. > > Thanks, > Guido > > > >> -----Original Message----- >> From: bioconductor-bounces at stat.math.ethz.ch >> [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of >> James W. MacDonald >> Sent: 30 June 2009 19:44 >> To: Hooiveld, Guido >> Cc: bioconductor at stat.math.ethz.ch >> Subject: Re: [BioC] Annotation.db: how automatically call a mapping? >> >> Hi Guido, >> >> Hooiveld, Guido wrote: >>> Hi Martin, >>> >>> Indeed, another useful, straigh-forward possibility for mapping. >>> However, I am now facing the problem of properly combining the >>> annotation info with the expression data. This is what I >> would like to >>> do: >>> >>>> Tab_data <- exprs(eset[probeids]) >>>> Tab_data <- cbind(Tab_data, fit2$Amean) # to add average >> expression >>>> of >>> LIMMA output >>>> Tab_data <- cbind(Tab_data, fit2$p.value) # to add p-value of LIMMA >>> output >>> etc. >>> >>> This al goes fine, however adding the annotation info >> 'mixes-up' the >>> content of Tab_data; the annotation data replaces the first >> column of >>> Tab_data, and the content of all cells is replaced by 'null'. I >>> suspect it has something to do with the type of object I >> would like to >>> merge, but I am not sure. >>> >>>> map.entrez <- getAnnMap("ENTREZID", annotation(eset)) >> map.entrez <- >>>> as.list(map.entrez[probeids]) >> This sort of thing is going to get really difficult to do by >> hand when you get to things that have a one-to-many >> relationship. And you are already duplicating existing >> efforts with what you have done so far. >> >> If you want to combine annotation data with results data, you >> really want to be using the annaffy package which does lots >> of these things seamlessly. And if you want things to be a >> bit easier, you could consider using the affycoretools >> package as well, which for the most part uses annaffy to >> create output. >> >> You can do what you appear to want in one line: >> >> probes2table(eset, featureNames(eset), annotation(eset), >> list("p-value"= fit2$p.value, "mean" = fit2$Amean), html = >> FALSE, filename = "output") >> >> You might need to play around with the 'anncols' argument to >> get what annotation data you might want. >> >> If you want output specific to the contrasts you have fit, >> see ?limma2annaffy. >> >> Best, >> >> Jim >> >> >> >>> >>>> Tab_data <- cbind(Tab_data, map.entrez) >>> ^ in R this seems to work, but when saved as .txt the content of >>> Tab_data is completely mixed up. Before 'adding' map.entrez >> Tab_dat is >>> OK. >>> >>> >>>> write.table(cbind(rownames(Tab_data2), Tab_data2), >>> file="test_1234.txt", sep="\t", col.names=TRUE, row.names=FALSE) >>> >>>> class(Tab_data) >>> [1] "matrix" >>>> class(map.entrez) >>> [1] "list" >>> >>> >>> Do you, or someone elsr, have a suggestion how to properly >> link these >>> two types of data? >>> Thanks again, >>> Guido >>> >>> >>> >>> >>> >>>> -----Original Message----- >>>> From: bioconductor-bounces at stat.math.ethz.ch >>>> [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf >> Of Martin >>>> Morgan >>>> Sent: 30 June 2009 00:00 >>>> To: Hooiveld, Guido >>>> Cc: bioconductor at stat.math.ethz.ch >>>> Subject: Re: [BioC] Annotation.db: how automatically call >> a mapping? >>>> Hooiveld, Guido wrote: >>>>> Hi, >>>>> >>>>> I am facing a problem i cannot solve myselves, despite >> everything i >>>>> read/know. But i assume the solution is easy for the more >>>> knowledgable >>>>> folks in BioC/R... >>>>> >>>>> This does work: >>>>>> library(moe430a.db) >>>>>> xxyy <- moe430aSYMBOL >>>>>> xxyy >>>>> SYMBOL map for chip moe430a (object of class "AnnDbBimap") >>>>> >>>>> However, for this to work you need to know the array type >>>> of the data >>>>> that is analyzed. >>>>> >>>>> >>>>> Now i would like to automatically extract the (e.g.) >> SYMBOL mapping >>>>> from an annotation.db, thus by retrieving the array type >>>> from the eset. >>>>> >>>>>> library(affy) >>>>>> eset <- rma(data) >>>>>> probeids <- featureNames(eset) >>>>>> annotation(eset) >>>>> [1] "moe430a" >>>>> >>>>> But how can i use this info to properly call the SYMBOL mapping? >>>> Hi Guido -- >>>> >>>> to get the appropriate map >>>> >>>> library(annotate) >>>> map = getAnnMap("SYMBOL", annotation(eset)) >>>> >>>> to select just the relevant probes >>>> >>>> map[probeids] >>>> >>>> toTable(map[probeids]) or as.list(map[probeids]) might be the next >>>> step in the work flow. >>>> >>>> Martin >>>> >>>>> >>>>> I tried this: >>>>>> arraytype <- annotation(eset) >>>>>> arraytype <- paste(arraytype, "db", sep = ".") arraytype >>>>> [1] "moe430a.db" >>>>>> arraytype <- paste("package", arraytype, sep = ":") gh <- >>>>>> ls(arraytype) gh >>>>> [1] "moe430a" "moe430a_dbconn" >> "moe430a_dbfile" >>>>> "moe430a_dbInfo" "moe430a_dbschema" "moe430aACCNUM" >>>>> "moe430aALIAS2PROBE" "moe430aCHR" "moe430aCHRLENGTHS" >>>>> "moe430aCHRLOC" >>>>> [11] "moe430aCHRLOCEND" "moe430aENSEMBL" >>>>> "moe430aENSEMBL2PROBE" "moe430aENTREZID" "moe430aENZYME" >>>>> "moe430aENZYME2PROBE" "moe430aGENENAME" "moe430aGO" >>>>> "moe430aGO2ALLPROBES" "moe430aGO2PROBE" >>>>> [21] "moe430aMAP" "moe430aMAPCOUNTS" "moe430aMGI" >>>>> "moe430aMGI2PROBE" "moe430aORGANISM" "moe430aPATH" >>>>> "moe430aPATH2PROBE" "moe430aPFAM" "moe430aPMID" >>>>> "moe430aPMID2PROBE" >>>>> [31] "moe430aPROSITE" "moe430aREFSEQ" "moe430aSYMBOL" >>>>> "moe430aUNIGENE" "moe430aUNIPROT" >>>>> >>>>>> gh[33] >>>>> [1] "moe430aSYMBOL" >>>>>> symbols <- mget(probeids, gh[33]) >>>>> Error in mget(probeids, gh[33]) : second argument must be an >>>>> environment >>>>> >>>>> This also doesn't work: >>>>>> symbols <- mget(probeids, envir=gh[33]) >>>>> Error in mget(probeids, envir = gh[33]) : >>>>> second argument must be an environment >>>>> >>>>> My approach thus is the wrong approach to automatically extract >>>>> mappings from a annotation.db. >>>>> Since i don't know about any other possibility, i would >>>> appreciate if >>>>> someone could point me to a working solution. >>>>> >>>>> Thanks, >>>>> Guido >>>>> >>>>> >>>>> ------------------------------------------------ >>>>> Guido Hooiveld, PhD >>>>> Nutrition, Metabolism & Genomics Group Division of Human >> Nutrition >>>>> Wageningen University Biotechnion, Bomenweg 2 >>>>> NL-6703 HD Wageningen >>>>> the Netherlands >>>>> tel: (+)31 317 485788 >>>>> fax: (+)31 317 483342 >>>>> internet: http://nutrigene.4t.com <http: nutrigene.4t.com=""/> >>>>> email: guido.hooiveld at wur.nl >>>>> >>>>> >>>>> >>>>> [[alternative HTML version deleted]] >>>>> >>>>> _______________________________________________ >>>>> 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 >>>> >>>> >>> _______________________________________________ >>> 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 >> -- >> James W. MacDonald, M.S. >> Biostatistician >> Douglas Lab >> University of Michigan >> Department of Human Genetics >> 5912 Buhl >> 1241 E. Catherine St. >> Ann Arbor MI 48109-5618 >> 734-615-7826 >> >> _______________________________________________ >> 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 >> >> > -- James W. MacDonald, M.S. Biostatistician Douglas Lab University of Michigan Department of Human Genetics 5912 Buhl 1241 E. Catherine St. Ann Arbor MI 48109-5618 734-615-7826
ADD REPLY
0
Entering edit mode
Hi again, Some remarks/questions: First of all, thanks for all your help! Meanwhile I got limma2annaffy to work. Nice HTML output! However some minor things: - I experienced that the library 'annaffy' is not automatically loaded. - how to get the scientific notation for the p-values (e.g. 1.24E-12; for all 30 genes it is now "0"). - in the output file, the header 'Fold Change' actually reflects 'log2FC'. Regarding the function probes2table, how to access the results [...html = FALSE, filename = "output")]? Is it (=output) automatically saved? If so, where?; it is not in my working directory. Thanks, Guido > limma2annaffy(eset, fit2, design, cont.matrix, "moe430a", adjust = "fdr", anncols = aaf.handler()[c(1:3, 6:7, 9:12)], number = 30, pfilt = NULL, fldfilt= NULL,tstat = TRUE, pval = TRUE, FC = TRUE, expression = TRUE, html = TRUE, text = FALSE, save = FALSE, addname = NULL, interactive = TRUE) You are going to output 3 tables, With this many genes in each: 30 30 30 Do you want to accept or change these values? [ a/c ]a Error in as.vector(x) : could not find function "aaf.handler" > library(annaffy) > limma2annaffy(eset, fit2, design, cont.matrix, "moe430a", adjust = "fdr", anncols = aaf.handler()[c(1:3, 6:7, 9:12)], number = 30, pfilt = NULL, fldfilt= NULL,tstat = TRUE, pval = TRUE, FC = TRUE, expression = TRUE, html = TRUE, text = FALSE, save = FALSE, addname = NULL, interactive = TRUE) You are going to output 3 tables, With this many genes in each: 30 30 30 Do you want to accept or change these values? [ a/c ]a > -----Original Message----- > From: James W. MacDonald [mailto:jmacdon at med.umich.edu] > Sent: 30 June 2009 22:29 > To: Hooiveld, Guido > Cc: bioconductor at stat.math.ethz.ch > Subject: Re: [BioC] Annotation.db: how automatically call a mapping? > > > > Hooiveld, Guido wrote: > > Hi Jim, > > Since your suggestion looks indeed easy and seems to provide > > everything I would like to have, a gave it a try (I'll have > a further > > look at Martin's comments/suggestions later). > > However, it seems that 'probes2table' cannot properly > handle multiple > > contrast defined in limma: > > > >> library(affycoretools) > > Loading required package: GO.db > > Loading required package: DBI > > Loading required package: KEGG.db > >> probes2table(eset, featureNames(eset), annotation(eset), > > list("p-value"= fit2$p.value, "mean" = fit2$Amean), html = FALSE, > > filename = "output") Loading required package: moe430a.db Error in > > aafTable(items = otherdata) : > > All columns must be of equal length > >> length(fit2$p.value) > > [1] 68070 > >> length(fit2$Amean) > > [1] 22690 > > > > I analyzed three contrasts in limma, and 68070/3 is 22690, which > > exactly equals the number of probesets on the Affy MOE430A > array. This > > thus explains the error. > > > > Question: can this easily be solved? Can limma2annaffy > handle multiple > > contrasts? (at the moment I am not familiar with > affycoretools at all). > > limma2annaffy(eset, fit2, <designmatrixname>, > <contrastsmatrixname>, annotation(eset), pfilt=1, html = > FALSE, interactive = FALSE) > > should give you text tables for each contrast. I would > normally use a reasonable p-value and possibly a fold filter > to reduce the output to the reporters of interest, and use > html = TRUE because my end users in general like that better > than the text. However, for all reporters on this chip the > HTML table is too huge to be of use. > > > > > Thanks, > > Guido > > > > > > > >> -----Original Message----- > >> From: bioconductor-bounces at stat.math.ethz.ch > >> [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf > Of James W. > >> MacDonald > >> Sent: 30 June 2009 19:44 > >> To: Hooiveld, Guido > >> Cc: bioconductor at stat.math.ethz.ch > >> Subject: Re: [BioC] Annotation.db: how automatically call > a mapping? > >> > >> Hi Guido, > >> > >> Hooiveld, Guido wrote: > >>> Hi Martin, > >>> > >>> Indeed, another useful, straigh-forward possibility for mapping. > >>> However, I am now facing the problem of properly combining the > >>> annotation info with the expression data. This is what I > >> would like to > >>> do: > >>> > >>>> Tab_data <- exprs(eset[probeids]) > >>>> Tab_data <- cbind(Tab_data, fit2$Amean) # to add average > >> expression > >>>> of > >>> LIMMA output > >>>> Tab_data <- cbind(Tab_data, fit2$p.value) # to add > p-value of LIMMA > >>> output > >>> etc. > >>> > >>> This al goes fine, however adding the annotation info > >> 'mixes-up' the > >>> content of Tab_data; the annotation data replaces the first > >> column of > >>> Tab_data, and the content of all cells is replaced by 'null'. I > >>> suspect it has something to do with the type of object I > >> would like to > >>> merge, but I am not sure. > >>> > >>>> map.entrez <- getAnnMap("ENTREZID", annotation(eset)) > >> map.entrez <- > >>>> as.list(map.entrez[probeids]) > >> This sort of thing is going to get really difficult to do by hand > >> when you get to things that have a one-to-many > relationship. And you > >> are already duplicating existing efforts with what you > have done so > >> far. > >> > >> If you want to combine annotation data with results data, > you really > >> want to be using the annaffy package which does lots of > these things > >> seamlessly. And if you want things to be a bit easier, you could > >> consider using the affycoretools package as well, which > for the most > >> part uses annaffy to create output. > >> > >> You can do what you appear to want in one line: > >> > >> probes2table(eset, featureNames(eset), annotation(eset), > >> list("p-value"= fit2$p.value, "mean" = fit2$Amean), html = FALSE, > >> filename = "output") > >> > >> You might need to play around with the 'anncols' argument > to get what > >> annotation data you might want. > >> > >> If you want output specific to the contrasts you have fit, see > >> ?limma2annaffy. > >> > >> Best, > >> > >> Jim > >> > >> > >> > >>> > >>>> Tab_data <- cbind(Tab_data, map.entrez) > >>> ^ in R this seems to work, but when saved as .txt the > content of > >>> Tab_data is completely mixed up. Before 'adding' map.entrez > >> Tab_dat is > >>> OK. > >>> > >>> > >>>> write.table(cbind(rownames(Tab_data2), Tab_data2), > >>> file="test_1234.txt", sep="\t", col.names=TRUE, row.names=FALSE) > >>> > >>>> class(Tab_data) > >>> [1] "matrix" > >>>> class(map.entrez) > >>> [1] "list" > >>> > >>> > >>> Do you, or someone elsr, have a suggestion how to properly > >> link these > >>> two types of data? > >>> Thanks again, > >>> Guido > >>> > >>> > >>> > >>> > >>> > >>>> -----Original Message----- > >>>> From: bioconductor-bounces at stat.math.ethz.ch > >>>> [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf > >> Of Martin > >>>> Morgan > >>>> Sent: 30 June 2009 00:00 > >>>> To: Hooiveld, Guido > >>>> Cc: bioconductor at stat.math.ethz.ch > >>>> Subject: Re: [BioC] Annotation.db: how automatically call > >> a mapping? > >>>> Hooiveld, Guido wrote: > >>>>> Hi, > >>>>> > >>>>> I am facing a problem i cannot solve myselves, despite > >> everything i > >>>>> read/know. But i assume the solution is easy for the more > >>>> knowledgable > >>>>> folks in BioC/R... > >>>>> > >>>>> This does work: > >>>>>> library(moe430a.db) > >>>>>> xxyy <- moe430aSYMBOL > >>>>>> xxyy > >>>>> SYMBOL map for chip moe430a (object of class "AnnDbBimap") > >>>>> > >>>>> However, for this to work you need to know the array type > >>>> of the data > >>>>> that is analyzed. > >>>>> > >>>>> > >>>>> Now i would like to automatically extract the (e.g.) > >> SYMBOL mapping > >>>>> from an annotation.db, thus by retrieving the array type > >>>> from the eset. > >>>>> > >>>>>> library(affy) > >>>>>> eset <- rma(data) > >>>>>> probeids <- featureNames(eset) > >>>>>> annotation(eset) > >>>>> [1] "moe430a" > >>>>> > >>>>> But how can i use this info to properly call the SYMBOL mapping? > >>>> Hi Guido -- > >>>> > >>>> to get the appropriate map > >>>> > >>>> library(annotate) > >>>> map = getAnnMap("SYMBOL", annotation(eset)) > >>>> > >>>> to select just the relevant probes > >>>> > >>>> map[probeids] > >>>> > >>>> toTable(map[probeids]) or as.list(map[probeids]) might > be the next > >>>> step in the work flow. > >>>> > >>>> Martin > >>>> > >>>>> > >>>>> I tried this: > >>>>>> arraytype <- annotation(eset) > >>>>>> arraytype <- paste(arraytype, "db", sep = ".") arraytype > >>>>> [1] "moe430a.db" > >>>>>> arraytype <- paste("package", arraytype, sep = ":") gh <- > >>>>>> ls(arraytype) gh > >>>>> [1] "moe430a" "moe430a_dbconn" > >> "moe430a_dbfile" > >>>>> "moe430a_dbInfo" "moe430a_dbschema" "moe430aACCNUM" > >>>>> "moe430aALIAS2PROBE" "moe430aCHR" > "moe430aCHRLENGTHS" > >>>>> "moe430aCHRLOC" > >>>>> [11] "moe430aCHRLOCEND" "moe430aENSEMBL" > >>>>> "moe430aENSEMBL2PROBE" "moe430aENTREZID" "moe430aENZYME" > >>>>> "moe430aENZYME2PROBE" "moe430aGENENAME" "moe430aGO" > >>>>> "moe430aGO2ALLPROBES" "moe430aGO2PROBE" > >>>>> [21] "moe430aMAP" "moe430aMAPCOUNTS" "moe430aMGI" > >>>>> "moe430aMGI2PROBE" "moe430aORGANISM" "moe430aPATH" > >>>>> "moe430aPATH2PROBE" "moe430aPFAM" "moe430aPMID" > >>>>> "moe430aPMID2PROBE" > >>>>> [31] "moe430aPROSITE" "moe430aREFSEQ" > "moe430aSYMBOL" > >>>>> "moe430aUNIGENE" "moe430aUNIPROT" > >>>>> > >>>>>> gh[33] > >>>>> [1] "moe430aSYMBOL" > >>>>>> symbols <- mget(probeids, gh[33]) > >>>>> Error in mget(probeids, gh[33]) : second argument must be an > >>>>> environment > >>>>> > >>>>> This also doesn't work: > >>>>>> symbols <- mget(probeids, envir=gh[33]) > >>>>> Error in mget(probeids, envir = gh[33]) : > >>>>> second argument must be an environment > >>>>> > >>>>> My approach thus is the wrong approach to automatically extract > >>>>> mappings from a annotation.db. > >>>>> Since i don't know about any other possibility, i would > >>>> appreciate if > >>>>> someone could point me to a working solution. > >>>>> > >>>>> Thanks, > >>>>> Guido > >>>>> > >>>>> > >>>>> ------------------------------------------------ > >>>>> Guido Hooiveld, PhD > >>>>> Nutrition, Metabolism & Genomics Group Division of Human > >> Nutrition > >>>>> Wageningen University Biotechnion, Bomenweg 2 > >>>>> NL-6703 HD Wageningen > >>>>> the Netherlands > >>>>> tel: (+)31 317 485788 > >>>>> fax: (+)31 317 483342 > >>>>> internet: http://nutrigene.4t.com <http: nutrigene.4t.com=""/> > >>>>> email: guido.hooiveld at wur.nl > >>>>> > >>>>> > >>>>> > >>>>> [[alternative HTML version deleted]] > >>>>> > >>>>> _______________________________________________ > >>>>> 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 > >>>> > >>>> > >>> _______________________________________________ > >>> 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 > >> -- > >> James W. MacDonald, M.S. > >> Biostatistician > >> Douglas Lab > >> University of Michigan > >> Department of Human Genetics > >> 5912 Buhl > >> 1241 E. Catherine St. > >> Ann Arbor MI 48109-5618 > >> 734-615-7826 > >> > >> _______________________________________________ > >> 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 > >> > >> > > > > -- > James W. MacDonald, M.S. > Biostatistician > Douglas Lab > University of Michigan > Department of Human Genetics > 5912 Buhl > 1241 E. Catherine St. > Ann Arbor MI 48109-5618 > 734-615-7826 > >
ADD REPLY
0
Entering edit mode
John Zhang ★ 2.9k
@john-zhang-6
Last seen 9.6 years ago
>> symbols <- mget(probeids, gh[33]) >Error in mget(probeids, gh[33]) : second argument must be an environment Have you tried symbols <- mget(probeids, get(gh[33])) > >This also doesn't work: >> symbols <- mget(probeids, envir=gh[33]) >Error in mget(probeids, envir = gh[33]) : > second argument must be an environment > >My approach thus is the wrong approach to automatically extract mappings >from a annotation.db. >Since i don't know about any other possibility, i would appreciate if >someone could point me to a working solution. > >Thanks, >Guido > > >------------------------------------------------ >Guido Hooiveld, PhD >Nutrition, Metabolism & Genomics Group >Division of Human Nutrition >Wageningen University >Biotechnion, Bomenweg 2 >NL-6703 HD Wageningen >the Netherlands >tel: (+)31 317 485788 >fax: (+)31 317 483342 >internet: http://nutrigene.4t.com <http: nutrigene.4t.com=""/> >email: guido.hooiveld at wur.nl > > > > [[alternative HTML version deleted]] > >_______________________________________________ >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 Jianhua Zhang Department of Medical Oncology Dana-Farber Cancer Institute 44 Binney Street Boston, MA 02115-6084
ADD COMMENT
0
Entering edit mode
Thanks. This indeed does work! G > -----Original Message----- > From: bioconductor-bounces at stat.math.ethz.ch > [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of > John Zhang > Sent: 29 June 2009 21:51 > To: bioconductor at stat.math.ethz.ch; Hooiveld, Guido > Subject: Re: [BioC] Annotation.db: how automatically call a mapping? > > > >> symbols <- mget(probeids, gh[33]) > >Error in mget(probeids, gh[33]) : second argument must be an > >environment > > Have you tried > > symbols <- mget(probeids, get(gh[33])) > > > > > >This also doesn't work: > >> symbols <- mget(probeids, envir=gh[33]) > >Error in mget(probeids, envir = gh[33]) : > > second argument must be an environment > > > >My approach thus is the wrong approach to automatically extract > >mappings from a annotation.db. > >Since i don't know about any other possibility, i would > appreciate if > >someone could point me to a working solution. > > > >Thanks, > >Guido > > > > > >------------------------------------------------ > >Guido Hooiveld, PhD > >Nutrition, Metabolism & Genomics Group > >Division of Human Nutrition > >Wageningen University > >Biotechnion, Bomenweg 2 > >NL-6703 HD Wageningen > >the Netherlands > >tel: (+)31 317 485788 > >fax: (+)31 317 483342 > >internet: http://nutrigene.4t.com <http: nutrigene.4t.com=""/> > >email: guido.hooiveld at wur.nl > > > > > > > > [[alternative HTML version deleted]] > > > >_______________________________________________ > >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 > > Jianhua Zhang > Department of Medical Oncology > Dana-Farber Cancer Institute > 44 Binney Street > Boston, MA 02115-6084 > > _______________________________________________ > 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
0
Entering edit mode
Hi Guido, The trouble you were having here was because gh[33] is a character vector. You can check this by calling class(gh[33]). My bet is that R will say: [1] "character" when you do this which will indicate that gh[33] is a "character" and not an "AnnDbBimap". To make this work you have to get the appropriate object that was created when you loaded the moe430a.db package, and that object must be an "AnnDbBimap". The get() function will do that for you and return the appropriate "AnnDbBimap" object which is why this works. You may have already figured all of that out, but I am adding these comments here so that others who stumble onto this thread later can learn. Marc Hooiveld, Guido wrote: > Thanks. This indeed does work! > > G > > > > >> -----Original Message----- >> From: bioconductor-bounces at stat.math.ethz.ch >> [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of >> John Zhang >> Sent: 29 June 2009 21:51 >> To: bioconductor at stat.math.ethz.ch; Hooiveld, Guido >> Subject: Re: [BioC] Annotation.db: how automatically call a mapping? >> >> >> >>>> symbols <- mget(probeids, gh[33]) >>>> >>> Error in mget(probeids, gh[33]) : second argument must be an >>> environment >>> >> Have you tried >> >> symbols <- mget(probeids, get(gh[33])) >> >> >> >>> This also doesn't work: >>> >>>> symbols <- mget(probeids, envir=gh[33]) >>>> >>> Error in mget(probeids, envir = gh[33]) : >>> second argument must be an environment >>> >>> My approach thus is the wrong approach to automatically extract >>> mappings from a annotation.db. >>> Since i don't know about any other possibility, i would >>> >> appreciate if >> >>> someone could point me to a working solution. >>> >>> Thanks, >>> Guido >>> >>> >>> ------------------------------------------------ >>> Guido Hooiveld, PhD >>> Nutrition, Metabolism & Genomics Group >>> Division of Human Nutrition >>> Wageningen University >>> Biotechnion, Bomenweg 2 >>> NL-6703 HD Wageningen >>> the Netherlands >>> tel: (+)31 317 485788 >>> fax: (+)31 317 483342 >>> internet: http://nutrigene.4t.com <http: nutrigene.4t.com=""/> >>> email: guido.hooiveld at wur.nl >>> >>> >>> >>> [[alternative HTML version deleted]] >>> >>> _______________________________________________ >>> 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 >> >> Jianhua Zhang >> Department of Medical Oncology >> Dana-Farber Cancer Institute >> 44 Binney Street >> Boston, MA 02115-6084 >> >> _______________________________________________ >> 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
0
Entering edit mode
@perry-moerland-1109
Last seen 2.0 years ago
Bioinformatics Laboratory, Academic Med…
Dear Guido, A few weeks back I was struggling with the same problem and came up with this solution: makeMapping <- function(annotPkg,str="SYMBOL",ids){ do.call(library,list(annotPkg)) annotPkg = sub(".db","",annotPkg) f = function(x) mget(ids,x,ifnotfound=NA) annot = do.call(f,list(get(paste(annotPkg,str,sep="")))) return(annot) } Just as an example: > makeMapping("moe430a.db",str="SYMBOL",ids=c("1415670_at","1415671_at ")) $`1415670_at` [1] "Copg" $`1415671_at` [1] "Atp6v0d1" best, Perry --- Perry Moerland, PhD Room J1B-206, Bioinformatics Laboratory Department of Clinical Epidemiology, Biostatistics and Bioinformatics Academic Medical Centre, University of Amsterdam Postbus 22660, 1100 DD Amsterdam, The Netherlands tel: +31 20 5664660 p.d.moerland at amc.uva.nl, http://www.amc.uva.nl/ ----- Original Message ----- From: "Hooiveld, Guido" <guido.hooiveld@wur.nl> Date: Monday, June 29, 2009 9:43 pm Subject: [BioC] Annotation.db: how automatically call a mapping? To: bioconductor at stat.math.ethz.ch > Hi, > > I am facing a problem i cannot solve myselves, despite everything i > read/know. But i assume the solution is easy for the more knowledgable > folks in BioC/R... > > This does work: > > library(moe430a.db) > > xxyy <- moe430aSYMBOL > > xxyy > SYMBOL map for chip moe430a (object of class "AnnDbBimap") > > However, for this to work you need to know the array type of the data > that is analyzed. > > > Now i would like to automatically extract the (e.g.) SYMBOL mapping from > an annotation.db, thus by retrieving the array type from the eset. > > > library(affy) > > eset <- rma(data) > > probeids <- featureNames(eset) > > annotation(eset) > [1] "moe430a" > > But how can i use this info to properly call the SYMBOL mapping? > > I tried this: > > arraytype <- annotation(eset) > > arraytype <- paste(arraytype, "db", sep = ".") > > arraytype > [1] "moe430a.db" > > arraytype <- paste("package", arraytype, sep = ":") > > gh <- ls(arraytype) > > gh > [1] "moe430a" "moe430a_dbconn" "moe430a_dbfile" > "moe430a_dbInfo" "moe430a_dbschema" "moe430aACCNUM" > "moe430aALIAS2PROBE" "moe430aCHR" "moe430aCHRLENGTHS" > "moe430aCHRLOC" > [11] "moe430aCHRLOCEND" "moe430aENSEMBL" > "moe430aENSEMBL2PROBE" "moe430aENTREZID" "moe430aENZYME" > "moe430aENZYME2PROBE" "moe430aGENENAME" "moe430aGO" > "moe430aGO2ALLPROBES" "moe430aGO2PROBE" > [21] "moe430aMAP" "moe430aMAPCOUNTS" "moe430aMGI" > "moe430aMGI2PROBE" "moe430aORGANISM" "moe430aPATH" > "moe430aPATH2PROBE" "moe430aPFAM" "moe430aPMID" > "moe430aPMID2PROBE" > [31] "moe430aPROSITE" "moe430aREFSEQ" "moe430aSYMBOL" > "moe430aUNIGENE" "moe430aUNIPROT" > > > gh[33] > [1] "moe430aSYMBOL" > > > > symbols <- mget(probeids, gh[33]) > Error in mget(probeids, gh[33]) : second argument must be an environment > > This also doesn't work: > > symbols <- mget(probeids, envir=gh[33]) > Error in mget(probeids, envir = gh[33]) : > second argument must be an environment > > My approach thus is the wrong approach to automatically extract mappings > from a annotation.db. > Since i don't know about any other possibility, i would appreciate if > someone could point me to a working solution. > > Thanks, > Guido > > > ------------------------------------------------ > Guido Hooiveld, PhD > Nutrition, Metabolism & Genomics Group > Division of Human Nutrition > Wageningen University > Biotechnion, Bomenweg 2 > NL-6703 HD Wageningen > the Netherlands > tel: (+)31 317 485788 > fax: (+)31 317 483342 > internet: > email: guido.hooiveld at wur.nl > > > > [[alternative HTML version deleted]] > > _______________________________________________ > 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 Perry, Thanks for your suggestion. Compared to my efforts this is much more generic, which I prefer. :) I'll give it a try and let you know. Guido > -----Original Message----- > From: bioconductor-bounces at stat.math.ethz.ch > [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of > P.D. Moerland > Sent: 29 June 2009 22:07 > To: Hooiveld, Guido > Cc: bioconductor at stat.math.ethz.ch > Subject: Re: [BioC] Annotation.db: how automatically call a mapping? > > Dear Guido, > > A few weeks back I was struggling with the same problem and > came up with this solution: > > > makeMapping <- function(annotPkg,str="SYMBOL",ids){ > do.call(library,list(annotPkg)) > annotPkg = sub(".db","",annotPkg) > f = function(x) mget(ids,x,ifnotfound=NA) > annot = do.call(f,list(get(paste(annotPkg,str,sep="")))) > return(annot) > } > > Just as an example: > > > > makeMapping("moe430a.db",str="SYMBOL",ids=c("1415670_at","1415671_at") > > ) > > $`1415670_at` > [1] "Copg" > > $`1415671_at` > [1] "Atp6v0d1" > > > best, > Perry > > --- > Perry Moerland, PhD > Room J1B-206, Bioinformatics Laboratory > Department of Clinical Epidemiology, Biostatistics and > Bioinformatics Academic Medical Centre, University of > Amsterdam Postbus 22660, 1100 DD Amsterdam, The Netherlands > tel: +31 20 5664660 > p.d.moerland at amc.uva.nl, http://www.amc.uva.nl/ > > ----- Original Message ----- > From: "Hooiveld, Guido" <guido.hooiveld at="" wur.nl=""> > Date: Monday, June 29, 2009 9:43 pm > Subject: [BioC] Annotation.db: how automatically call a mapping? > To: bioconductor at stat.math.ethz.ch > > > > Hi, > > > > I am facing a problem i cannot solve myselves, despite everything i > > read/know. But i assume the solution is easy for the more > knowledgable > > folks in BioC/R... > > > > This does work: > > > library(moe430a.db) > > > xxyy <- moe430aSYMBOL > > > xxyy > > SYMBOL map for chip moe430a (object of class "AnnDbBimap") > > > > However, for this to work you need to know the array type > of the data > > that is analyzed. > > > > > > Now i would like to automatically extract the (e.g.) SYMBOL mapping > > from an annotation.db, thus by retrieving the array type > from the eset. > > > > > library(affy) > > > eset <- rma(data) > > > probeids <- featureNames(eset) > > > annotation(eset) > > [1] "moe430a" > > > > But how can i use this info to properly call the SYMBOL mapping? > > > > I tried this: > > > arraytype <- annotation(eset) > > > arraytype <- paste(arraytype, "db", sep = ".") arraytype > > [1] "moe430a.db" > > > arraytype <- paste("package", arraytype, sep = ":") gh <- > > > ls(arraytype) gh > > [1] "moe430a" "moe430a_dbconn" "moe430a_dbfile" > > "moe430a_dbInfo" "moe430a_dbschema" "moe430aACCNUM" > > "moe430aALIAS2PROBE" "moe430aCHR" "moe430aCHRLENGTHS" > > "moe430aCHRLOC" > > [11] "moe430aCHRLOCEND" "moe430aENSEMBL" > > "moe430aENSEMBL2PROBE" "moe430aENTREZID" "moe430aENZYME" > > "moe430aENZYME2PROBE" "moe430aGENENAME" "moe430aGO" > > "moe430aGO2ALLPROBES" "moe430aGO2PROBE" > > [21] "moe430aMAP" "moe430aMAPCOUNTS" "moe430aMGI" > > "moe430aMGI2PROBE" "moe430aORGANISM" "moe430aPATH" > > "moe430aPATH2PROBE" "moe430aPFAM" "moe430aPMID" > > "moe430aPMID2PROBE" > > [31] "moe430aPROSITE" "moe430aREFSEQ" "moe430aSYMBOL" > > "moe430aUNIGENE" "moe430aUNIPROT" > > > > > gh[33] > > [1] "moe430aSYMBOL" > > > > > > symbols <- mget(probeids, gh[33]) > > Error in mget(probeids, gh[33]) : second argument must be an > > environment > > > > This also doesn't work: > > > symbols <- mget(probeids, envir=gh[33]) > > Error in mget(probeids, envir = gh[33]) : > > second argument must be an environment > > > > My approach thus is the wrong approach to automatically extract > > mappings from a annotation.db. > > Since i don't know about any other possibility, i would > appreciate if > > someone could point me to a working solution. > > > > Thanks, > > Guido > > > > > > ------------------------------------------------ > > Guido Hooiveld, PhD > > Nutrition, Metabolism & Genomics Group Division of Human Nutrition > > Wageningen University Biotechnion, Bomenweg 2 > > NL-6703 HD Wageningen > > the Netherlands > > tel: (+)31 317 485788 > > fax: (+)31 317 483342 > > internet: > > email: guido.hooiveld at wur.nl > > > > > > > > [[alternative HTML version deleted]] > > > > _______________________________________________ > > 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: 443 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