[Rd] [BioC] Suppress output from getGEO

waku at idi.ntnu.no waku at idi.ntnu.no
Fri Jan 29 22:54:03 CET 2010


some time ago i communicated the same issue to sean, and i'm very glad he
has improved the package -- thanks!

i'm purposefully posting to r-devel rather than to bioconductor.  i think
that download.file could be improved to avoid this sort of spamming output
seen previously with getGEO.  currently, it prints dots (when it does) in
5 10-packs per line, line after line.  instead, it could be repeatedly
printing them on the same line, to give it a more progress bar-like look.

the function putdots (src/modules/internet/internet.c:218) is responsible
for printing the dots.  after each 5x10 bunch of dots, it proceeds to the
next line:

    if((i+1) % 50 == 0) REprintf("\n");

but it could instead just swipe the dots and start in the same line again:

    if((i+1) % 50 == 0) REprintf("\r%55s\r", "");

it's ad hoc, of course, and requires some other changes to prevent the
progress bar from being rewritten too quickly, e.g., by replacing

    if(guess <= 0) putdots(&ndots, nbytes/1024);

with

    if(guess <= 0) putdots(&ndots, nbytes/(100*1024));

in lines 427 and 532 in the same file.  it's even more ad hoc, but on my
machine it works just fine.  i have no time to explore whether it
generalises to other configurations.

the attached patch was compiled and tested with no issues:

svn diff src/modules/internet/internet.c > internet.diff
svn revert src/modules/internet/internet.c
patch -p0 < internet.diff
make
make check # fine

vQ



More information about the R-devel mailing list