AnnBuilder bug // R-2.0.0 // getList4GO
1
0
Entering edit mode
@harry-athanassiou-1000
Last seen 9.6 years ago
I'm trying to use AnnBuilder to make some custom annotation files for a non-standard microarray chip. In running the tests with R-2.0.0, I run acroos a problem in the function getList4GO. I'm not sure if this issue is due to R-2.0.0 or not. Here's the issue: when the sub-function procOne is called by sapply, the names(goids) is NULL. Thus when procOne calls : apply(temp, 1, vect2List, vectNames = c("GOID", "Evidence", "Ontology")) the number of list-elements to be named is mismatched. I do not know how to make sapply pass the names() of its first argument to the FUN() it calls, so I modified procOne->procOne.new to drop the column "Evidence". And add this column with a trick afterwards. I'm sure this is not the best solution, just worked for me >>> getList4GO <- function (goNCat, goNEvi) { procOne <- function(goids) { if (is.null(goids) || is.na(goids)) { return(NA) } else { temp <- cbind(goids, names(goids), goNCat[goids]) rownames(temp) <- goids return(apply(temp, 1, vect2List, vectNames = c("GOID", "Evidence", "Ontology"))) } } # the names(goids) do not get propagated through the sapply() in R-2.0.0! # remove the column evidence procOne.new <- function(goids) { if (is.null(goids) || is.na(goids)) { return(NA) } else { temp <- cbind(goids, goNCat[goids]) rownames(temp) <- goids return(apply(temp, 1, vect2List, vectNames = c("GOID", "Ontology"))) } } temp <- sapply(goNEvi, procOne.new) names(temp) <- 1:length(temp) # add the evidence list-element # do not know a better way will do a loop on an index to acc two arrays at the same time for (r in 1:length(goNEvi)) { if (!is.na(temp[r])) { temp[[r]] <- c(temp[[r]], "Evidence"=names(goNEvi)[r]) } } return(temp) } >>> Harry Athanassiou BioInformatics manager Automated Cell, Inc
Microarray Annotation AnnBuilder Microarray Annotation AnnBuilder • 867 views
ADD COMMENT
0
Entering edit mode
John Zhang ★ 2.9k
@john-zhang-6
Last seen 9.6 years ago
Thanks. I will have a look at the code and fix the problem. >From: "Harry Athanassiou" <hathanassiou@automatedcell.com> >To: <bioconductor@stat.math.ethz.ch> >Date: Tue, 9 Nov 2004 01:22:42 -0500 >MIME-Version: 1.0 >X-Priority: 3 (Normal) >X-MSMail-Priority: Normal >Importance: Normal >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 >X-ELNK-Trace: 5cb454646877e76194f5150ab1c16ac08f4233f47979de267864528e82c1f9d017095c 3ef67204ee 350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c >X-Originating-IP: 70.20.82.76 >Received-SPF: none (hypatia: domain of bioconductor- bounces@stat.math.ethz.ch does not designate permitted sender hosts) >Received-SPF: none (hypatia: domain of hathanassiou@automatedcell.com does not designate permitted sender hosts) >X-Virus-Scanned: by amavisd-new at stat.math.ethz.ch >Content-Transfer-Encoding: 8bit >X-MIME-Autoconverted: from quoted-printable to 8bit by hypatia.math.ethz.ch id iA96MkAl017284 >Subject: [BioC] AnnBuilder bug // R-2.0.0 // getList4GO >X-BeenThere: bioconductor@stat.math.ethz.ch >X-Mailman-Version: 2.1.5 >List-Id: The Bioconductor Project Mailing List <bioconductor.stat.math.ethz.ch> >List-Unsubscribe: <https: stat.ethz.ch="" mailman="" listinfo="" bioconductor="">, <mailto:bioconductor-request@stat.math.ethz.ch?subject=unsubscribe> >List-Archive: <https: stat.ethz.ch="" pipermail="" bioconductor=""> >List-Post: <mailto:bioconductor@stat.math.ethz.ch> >List-Help: <mailto:bioconductor- request@stat.math.ethz.ch?subject="help"> >List-Subscribe: <https: stat.ethz.ch="" mailman="" listinfo="" bioconductor="">, <mailto:bioconductor-request@stat.math.ethz.ch?subject=subscribe> >X-Spam-Checker-Version: SpamAssassin 2.60-rc1 (1.197-2003-08-21-exp) on blaise.dfci.harvard.edu >X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=ham version=2.60-rc1 >X-Spam-Level: > >I'm trying to use AnnBuilder to make some custom annotation files for a >non-standard microarray chip. In running the tests with R-2.0.0, I run >acroos a problem in the function getList4GO. I'm not sure if this issue is >due to R-2.0.0 or not. > >Here's the issue: >when the sub-function procOne is called by sapply, the names(goids) is NULL. >Thus when procOne calls : > apply(temp, 1, vect2List, vectNames = c("GOID", "Evidence", "Ontology")) >the number of list-elements to be named is mismatched. > >I do not know how to make sapply pass the names() of its first argument to >the FUN() it calls, so I modified procOne->procOne.new to drop the column >"Evidence". >And add this column with a trick afterwards. > >I'm sure this is not the best solution, just worked for me > >>>> >getList4GO <- function (goNCat, goNEvi) >{ > procOne <- function(goids) { > if (is.null(goids) || is.na(goids)) { > return(NA) > } > else { > temp <- cbind(goids, names(goids), goNCat[goids]) > rownames(temp) <- goids > return(apply(temp, 1, vect2List, vectNames = c("GOID", >"Evidence", "Ontology"))) > } > } > > # the names(goids) do not get propagated through the sapply() in >R-2.0.0! > # remove the column evidence > procOne.new <- function(goids) { > if (is.null(goids) || is.na(goids)) { > return(NA) > } > else { > temp <- cbind(goids, goNCat[goids]) > rownames(temp) <- goids > return(apply(temp, 1, vect2List, vectNames = c("GOID", >"Ontology"))) > } > } > > temp <- sapply(goNEvi, procOne.new) > names(temp) <- 1:length(temp) > > # add the evidence list-element > # do not know a better way will do a loop on an index to acc two arrays >at the same time > for (r in 1:length(goNEvi)) { > if (!is.na(temp[r])) { > temp[[r]] <- c(temp[[r]], "Evidence"=names(goNEvi)[r]) > } > } > > return(temp) >} >>>> > >Harry Athanassiou >BioInformatics manager >Automated Cell, Inc > >_______________________________________________ >Bioconductor mailing list >Bioconductor@stat.math.ethz.ch >https://stat.ethz.ch/mailman/listinfo/bioconductor Jianhua Zhang Department of Biostatistics Dana-Farber Cancer Institute 44 Binney Street Boston, MA 02115-6084
ADD COMMENT

Login before adding your answer.

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