limma2annaffy error
1
0
Entering edit mode
mali salmon ▴ 370
@mali-salmon-4532
Last seen 6.2 years ago
Israel
Hi All I am analysing affymetrix data, and I am trying to use "limma2annaffy" function from "affycoretools" package to create html tables. When I run the following command: >limma2annaffy(eset, fit2, design, cont.matrix,lib="hgu133a2" , adjust = "fdr", anncols = aaf.handler()[c(1:3, 4:5, 11:12)], pfilt = 0.05,fldfilt=2,tstat = FALSE, pval = TRUE, FC = TRUE, expression = TRUE, html = TRUE, text = FALSE, save = FALSE) I get the error: "Error in round(fld, 2) : Non-numeric argument to mathematical function" In order to understand why I get this error, I have tried to generate the "tables" object from the limma2annaffy code. However, when I get to "tableFilt" function, R can't find it although the package is loaded. When I type ?tableFilt I get the documentation, but when I try to view the code I get > tableFilt Error: object 'tableFilt' not found Any ideas? Thanks Mali > sessionInfo() R version 2.12.1 (2010-12-16) Platform: i386-redhat-linux-gnu (32-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] hgu133a2.db_2.4.5 org.Hs.eg.db_2.4.6 annaffy_1.22.0 [4] annotate_1.28.0 affycoretools_1.22.0 KEGG.db_2.4.5 [7] GO.db_2.4.5 RSQLite_0.9-4 DBI_0.2-5 [10] AnnotationDbi_1.12.0 simpleaffy_2.26.1 gcrma_2.22.0 [13] genefilter_1.32.0 hgu133a2cdf_2.7.0 affy_1.28.0 [16] Biobase_2.10.0 limma_3.6.9 loaded via a namespace (and not attached): [1] affyio_1.18.0 biomaRt_2.6.0 Biostrings_2.18.2 [4] Category_2.16.1 GOstats_2.16.0 graph_1.28.0 [7] GSEABase_1.12.2 IRanges_1.8.9 preprocessCore_1.12.0 [10] RBGL_1.26.0 RCurl_1.5-0 splines_2.12.1 [13] survival_2.36-2 tcltk_2.12.1 tools_2.12.1 [16] XML_3.2-0 xtable_1.5-6 [[alternative HTML version deleted]]
GO hgu133a2 GO hgu133a2 • 1.2k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 3 days ago
United States
Hi Mali, On 3/16/2011 3:23 AM, mali salmon wrote: > Hi All > I am analysing affymetrix data, and I am trying to use "limma2annaffy" > function from "affycoretools" package to create html tables. > When I run the following command: > >> limma2annaffy(eset, fit2, design, cont.matrix,lib="hgu133a2" , adjust = > "fdr", > anncols = aaf.handler()[c(1:3, 4:5, 11:12)], pfilt = > 0.05,fldfilt=2,tstat = FALSE, pval = TRUE, FC = TRUE, > expression = TRUE, html = TRUE, text = FALSE, save = FALSE) > I get the error: > "Error in round(fld, 2) : Non-numeric argument to mathematical function" > > In order to understand why I get this error, I have tried to generate the > "tables" object from the limma2annaffy code. > However, when I get to "tableFilt" function, R can't find it although the > package is loaded. The easiest way to debug a function is to do debug(limma2annaffy) then run the function call. You can then step through the execution of the function line by line, and look at the intermediate objects being made, such as the tables list. Since you will be debugging from within the package namespace, all functions will be available to you. Note however that the tableFilt() function simply takes the output from topTable() and then filters based on the p-value and fold change you supplied. The error indicates that you are getting non-numeric values in the second column of your topTable() output, which is unexpected. > > When I type ?tableFilt I get the documentation, but when I try to view the > code I get >> tableFilt > Error: object 'tableFilt' not found That's because this package has a namespace, and the tableFilt() function isn't exported. You can access unexported functions using :::, e.g., affycoretools:::tableFilt. Best, Jim > > Any ideas? > Thanks > Mali > > >> sessionInfo() > R version 2.12.1 (2010-12-16) > Platform: i386-redhat-linux-gnu (32-bit) > > locale: > [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C > [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 > [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 > [7] LC_PAPER=en_US.UTF-8 LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] hgu133a2.db_2.4.5 org.Hs.eg.db_2.4.6 annaffy_1.22.0 > [4] annotate_1.28.0 affycoretools_1.22.0 KEGG.db_2.4.5 > [7] GO.db_2.4.5 RSQLite_0.9-4 DBI_0.2-5 > [10] AnnotationDbi_1.12.0 simpleaffy_2.26.1 gcrma_2.22.0 > [13] genefilter_1.32.0 hgu133a2cdf_2.7.0 affy_1.28.0 > [16] Biobase_2.10.0 limma_3.6.9 > > loaded via a namespace (and not attached): > [1] affyio_1.18.0 biomaRt_2.6.0 Biostrings_2.18.2 > [4] Category_2.16.1 GOstats_2.16.0 graph_1.28.0 > [7] GSEABase_1.12.2 IRanges_1.8.9 preprocessCore_1.12.0 > [10] RBGL_1.26.0 RCurl_1.5-0 splines_2.12.1 > [13] survival_2.36-2 tcltk_2.12.1 tools_2.12.1 > [16] XML_3.2-0 xtable_1.5-6 > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > 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 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues
ADD COMMENT
0
Entering edit mode
Thanks a lot Jim, it was really helpful!!! I debugged the function and found the problem. My lmFit object, and hence the "tables" object contain gene symbols which I added to the lmFit object in some point. In the code when it reaches the line "aafTable(`Fold Change` = round(fld, 2))" it actually reads the symbols instead of the fold change. May I suggest to replace the line "fld<-tables[[i]][,2]" with "fld<-tables[[i]][,"logFC"], this can prevent the error in the future. I solved this problem and encountered another one, and after debugging I think I found a small bug in the code. The problem appears when I set in the command line "tstat = FALSE". The first hrml file for the first contrast is generated successfully, but when it comes to generate the "testtable" for the second contrast I get the error "Error in merge.aafTable(testtable, aafTable(`p-value` = round(tables[[i]][, : The tables must have the same number of rows" This is because when tstat=FALSE, the testtable is not reset and updated to the new comparison. >if (tstat) testtable <- aafTable(`t-statistic` = round(tables[[i]][, "t"], 2)) >if (pval) { > if (!exists("testtable")) { > testtable <- aafTable(`p-value` = round(tables[[i]][, > "adj.P.Val"], 3)) > } > else { > testtable <- merge(testtable, aafTable(`p-value` = round(tables[[i]][, > "adj.P.Val"], 3))) > } >} When I set "tstat=TRUE" everything is OK All the best Mali This All the best Mali On Wed, Mar 16, 2011 at 3:32 PM, James W. MacDonald <jmacdon@med.umich.edu>wrote: > Hi Mali, > > > On 3/16/2011 3:23 AM, mali salmon wrote: > >> Hi All >> I am analysing affymetrix data, and I am trying to use "limma2annaffy" >> function from "affycoretools" package to create html tables. >> When I run the following command: >> >> limma2annaffy(eset, fit2, design, cont.matrix,lib="hgu133a2" , adjust = >>> >> "fdr", >> anncols = aaf.handler()[c(1:3, 4:5, 11:12)], pfilt = >> 0.05,fldfilt=2,tstat = FALSE, pval = TRUE, FC = TRUE, >> expression = TRUE, html = TRUE, text = FALSE, save = FALSE) >> I get the error: >> "Error in round(fld, 2) : Non-numeric argument to mathematical function" >> >> In order to understand why I get this error, I have tried to generate the >> "tables" object from the limma2annaffy code. >> However, when I get to "tableFilt" function, R can't find it although the >> package is loaded. >> > > The easiest way to debug a function is to do > > debug(limma2annaffy) > > then run the function call. You can then step through the execution of the > function line by line, and look at the intermediate objects being made, such > as the tables list. Since you will be debugging from within the package > namespace, all functions will be available to you. > > Note however that the tableFilt() function simply takes the output from > topTable() and then filters based on the p-value and fold change you > supplied. The error indicates that you are getting non-numeric values in the > second column of your topTable() output, which is unexpected. > > > >> When I type ?tableFilt I get the documentation, but when I try to view the >> code I get >> >>> tableFilt >>> >> Error: object 'tableFilt' not found >> > > That's because this package has a namespace, and the tableFilt() function > isn't exported. You can access unexported functions using :::, e.g., > affycoretools:::tableFilt. > > Best, > > Jim > > > >> Any ideas? >> Thanks >> Mali >> >> >> sessionInfo() >>> >> R version 2.12.1 (2010-12-16) >> Platform: i386-redhat-linux-gnu (32-bit) >> >> locale: >> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C >> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 >> [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 >> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C >> [9] LC_ADDRESS=C LC_TELEPHONE=C >> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C >> >> attached base packages: >> [1] stats graphics grDevices utils datasets methods base >> >> other attached packages: >> [1] hgu133a2.db_2.4.5 org.Hs.eg.db_2.4.6 annaffy_1.22.0 >> [4] annotate_1.28.0 affycoretools_1.22.0 KEGG.db_2.4.5 >> [7] GO.db_2.4.5 RSQLite_0.9-4 DBI_0.2-5 >> [10] AnnotationDbi_1.12.0 simpleaffy_2.26.1 gcrma_2.22.0 >> [13] genefilter_1.32.0 hgu133a2cdf_2.7.0 affy_1.28.0 >> [16] Biobase_2.10.0 limma_3.6.9 >> >> loaded via a namespace (and not attached): >> [1] affyio_1.18.0 biomaRt_2.6.0 Biostrings_2.18.2 >> [4] Category_2.16.1 GOstats_2.16.0 graph_1.28.0 >> [7] GSEABase_1.12.2 IRanges_1.8.9 preprocessCore_1.12.0 >> [10] RBGL_1.26.0 RCurl_1.5-0 splines_2.12.1 >> [13] survival_2.36-2 tcltk_2.12.1 tools_2.12.1 >> [16] XML_3.2-0 xtable_1.5-6 >> >> [[alternative HTML version deleted]] >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor@r-project.org >> 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 > ********************************************************** > Electronic Mail is not secure, may not be read every day, and should not be > used for urgent or sensitive issues > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
Hi Mali, Thanks for the bug report. Fixed now in svn, which will be propagated to the devel version in 24 hours or so. Best, Jim On 3/17/2011 5:11 AM, mali salmon wrote: > Thanks a lot Jim, it was really helpful!!! > I debugged the function and found the problem. > My lmFit object, and hence the "tables" object contain gene symbols which I > added to the lmFit object in some point. In the code when it reaches the > line "aafTable(`Fold Change` = round(fld, 2))" it actually reads the symbols > instead of the fold change. > May I suggest to replace the line "fld<-tables[[i]][,2]" with > "fld<-tables[[i]][,"logFC"], this can prevent the error in the future. > > I solved this problem and encountered another one, and after debugging I > think I found a small bug in the code. > The problem appears when I set in the command line "tstat = FALSE". The > first hrml file for the first contrast is generated successfully, but when > it comes to generate the "testtable" for the second contrast I get the error > > > "Error in merge.aafTable(testtable, aafTable(`p-value` = > round(tables[[i]][, : > The tables must have the same number of rows" > > This is because when tstat=FALSE, the testtable is not reset and updated to > the new comparison. > > >if (tstat) testtable<- aafTable(`t-statistic` = round(tables[[i]][, "t"], > 2)) > >if (pval) { > > if (!exists("testtable")) { > > testtable<- aafTable(`p-value` = round(tables[[i]][, > > "adj.P.Val"], 3)) > > } > > else { > > testtable<- merge(testtable, aafTable(`p-value` = > round(tables[[i]][, > > "adj.P.Val"], 3))) > > } >> } > > When I set "tstat=TRUE" everything is OK > > All the best > Mali > > > > > > > > This > All the best > Mali > > On Wed, Mar 16, 2011 at 3:32 PM, James W. MacDonald > <jmacdon at="" med.umich.edu="">wrote: > >> Hi Mali, >> >> >> On 3/16/2011 3:23 AM, mali salmon wrote: >> >>> Hi All >>> I am analysing affymetrix data, and I am trying to use "limma2annaffy" >>> function from "affycoretools" package to create html tables. >>> When I run the following command: >>> >>> limma2annaffy(eset, fit2, design, cont.matrix,lib="hgu133a2" , adjust = >>>> >>> "fdr", >>> anncols = aaf.handler()[c(1:3, 4:5, 11:12)], pfilt = >>> 0.05,fldfilt=2,tstat = FALSE, pval = TRUE, FC = TRUE, >>> expression = TRUE, html = TRUE, text = FALSE, save = FALSE) >>> I get the error: >>> "Error in round(fld, 2) : Non-numeric argument to mathematical function" >>> >>> In order to understand why I get this error, I have tried to generate the >>> "tables" object from the limma2annaffy code. >>> However, when I get to "tableFilt" function, R can't find it although the >>> package is loaded. >>> >> >> The easiest way to debug a function is to do >> >> debug(limma2annaffy) >> >> then run the function call. You can then step through the execution of the >> function line by line, and look at the intermediate objects being made, such >> as the tables list. Since you will be debugging from within the package >> namespace, all functions will be available to you. >> >> Note however that the tableFilt() function simply takes the output from >> topTable() and then filters based on the p-value and fold change you >> supplied. The error indicates that you are getting non-numeric values in the >> second column of your topTable() output, which is unexpected. >> >> >> >>> When I type ?tableFilt I get the documentation, but when I try to view the >>> code I get >>> >>>> tableFilt >>>> >>> Error: object 'tableFilt' not found >>> >> >> That's because this package has a namespace, and the tableFilt() function >> isn't exported. You can access unexported functions using :::, e.g., >> affycoretools:::tableFilt. >> >> Best, >> >> Jim >> >> >> >>> Any ideas? >>> Thanks >>> Mali >>> >>> >>> sessionInfo() >>>> >>> R version 2.12.1 (2010-12-16) >>> Platform: i386-redhat-linux-gnu (32-bit) >>> >>> locale: >>> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C >>> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 >>> [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 >>> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C >>> [9] LC_ADDRESS=C LC_TELEPHONE=C >>> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C >>> >>> attached base packages: >>> [1] stats graphics grDevices utils datasets methods base >>> >>> other attached packages: >>> [1] hgu133a2.db_2.4.5 org.Hs.eg.db_2.4.6 annaffy_1.22.0 >>> [4] annotate_1.28.0 affycoretools_1.22.0 KEGG.db_2.4.5 >>> [7] GO.db_2.4.5 RSQLite_0.9-4 DBI_0.2-5 >>> [10] AnnotationDbi_1.12.0 simpleaffy_2.26.1 gcrma_2.22.0 >>> [13] genefilter_1.32.0 hgu133a2cdf_2.7.0 affy_1.28.0 >>> [16] Biobase_2.10.0 limma_3.6.9 >>> >>> loaded via a namespace (and not attached): >>> [1] affyio_1.18.0 biomaRt_2.6.0 Biostrings_2.18.2 >>> [4] Category_2.16.1 GOstats_2.16.0 graph_1.28.0 >>> [7] GSEABase_1.12.2 IRanges_1.8.9 preprocessCore_1.12.0 >>> [10] RBGL_1.26.0 RCurl_1.5-0 splines_2.12.1 >>> [13] survival_2.36-2 tcltk_2.12.1 tools_2.12.1 >>> [16] XML_3.2-0 xtable_1.5-6 >>> >>> [[alternative HTML version deleted]] >>> >>> _______________________________________________ >>> Bioconductor mailing list >>> Bioconductor at r-project.org >>> 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 >> ********************************************************** >> Electronic Mail is not secure, may not be read every day, and should not be >> used for urgent or sensitive issues >> > -- 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 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues
ADD REPLY

Login before adding your answer.

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