I did replace the call to cat in topGO with with a call to a package private .cat2message function (which makes some adjustments to the passed arguments so that the messages look as before). The patched package is available from here. https://github.com/wolski/topGO Upstream commits made on 3 February by h.bengtsson are merged. AFAIK all is working OK (checks pass and my code using topGO is still working)
Witold On 4 February 2016 at 11:56, Witold E Wolski <wewol...@gmail.com> wrote: > Hi Dan, > > Excellent suggestion. This is very similar to how I am plan to do the > refactoring. Write a function cat2message which has a signature like > cat but uses message in the implementation and than replace all calls > to cat in the topGO package. > > best > > On 4 February 2016 at 00:56, Dan Tenenbaum <dtene...@fredhutch.org> wrote: >> Another dirty hack is to redefine cat() in your own code to do nothing: >> >> cat <- function(....) {} >> >> Dan >> >> >> ----- Original Message ----- >>> From: "James W. MacDonald" <jmac...@uw.edu> >>> To: "Witold E Wolski" <wewol...@gmail.com> >>> Cc: "bioc-devel" <bioc-devel@r-project.org> >>> Sent: Tuesday, February 2, 2016 6:50:21 AM >>> Subject: Re: [Bioc-devel] topGO and cat() and print() statements in program >>> code >> >>> I can't speak to the issue of changing somebody else's code without forking >>> (which you are free to do), or getting their OK. But do note that there are >>> usually ways around this. First, you can use include = FALSE in your chunk >>> options statement, which will run all the code, but silence everything. >>> This isn't a good use case if you need to print, but that can usually be >>> split out. Something like >>> >>> ```r{noisypart, include = FALSE} >>> >>> noisy code goes here >>> >>> ``` >>> >>> ```r{quietpart, echo = FALSE, fig.cap = ""} >>> >>> plots go here >>> >>> ``` >>> >>> An alternative is to use GOstats, which may be less noisy, but which still >>> has 18 calls to cat() (vs 121 for topGO) and 2 calls to print() (vs 29 for >>> topGO). >>> >>> Best, >>> >>> Jim >>> >>> >>> >>> On Tue, Feb 2, 2016 at 5:19 AM, Witold E Wolski <wewol...@gmail.com> wrote: >>> >>>> Hi, >>>> >>>> I am using the very usefull package topGO to generate a report (R >>>> markdown). There is not much to complain about topGO (on the contrary) >>>> except that the package uses cat instead of message to display >>>> progress information. which ruins the report. >>>> >>>> Also the bioconductor package guidelines state: >>>> cat() or print() are used only when displaying an object to the user, >>>> e.g., in a show method. >>>> >>>> This makes it difficult to integrate topGO. >>>> >>>> I did contact the maintainer asking to update topGO. However I did not >>>> get an reply. It seems that the maintainer is occupied with other >>>> problems. I did offer to replace the cat with message for these >>>> functions I am using myself. No reply. >>>> >>>> So what I am wondering is... If I do the corrections, and would like >>>> to commit the code... Sure I could create a branch but since I do not >>>> have write access to svn no chance to push (commit) it for review. >>>> And who is going to review it if the maintainer does not have time? >>>> >>>> best >>>> Witold >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> Witold Eryk Wolski >>>> >>>> _______________________________________________ >>>> Bioc-devel@r-project.org mailing list >>>> https://stat.ethz.ch/mailman/listinfo/bioc-devel >>>> >>> >>> >>> >>> -- >>> James W. MacDonald, M.S. >>> Biostatistician >>> University of Washington >>> Environmental and Occupational Health Sciences >>> 4225 Roosevelt Way NE, # 100 >>> Seattle WA 98105-6099 >>> >>> [[alternative HTML version deleted]] >>> >>> _______________________________________________ >>> Bioc-devel@r-project.org mailing list >>> https://stat.ethz.ch/mailman/listinfo/bioc-devel > > > > -- > Witold Eryk Wolski -- Witold Eryk Wolski _______________________________________________ Bioc-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel