From 169b9a141174f0f0f0859ed19ced0a1d31cc4d7e Mon Sep 17 00:00:00 2001 From: Xiuwen Zheng Date: Wed, 27 Mar 2024 19:51:31 -0500 Subject: [PATCH] tweak display --- NEWS | 4 ++-- R/UtilsMerge.R | 5 ++--- src/Index.cpp | 16 ++++++++-------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/NEWS b/NEWS index 8145304..fb56d6c 100644 --- a/NEWS +++ b/NEWS @@ -12,8 +12,8 @@ UTILITIES sex chromosomes, when the alleles are partially missing (e.g., genotypes on chromosome X for males) - o new 'verbose.clean' in `seqExport()` to control the level of information - display + o new 'verbose.clean' in `seqExport()` to control how much information to + be displayed CHANGES IN VERSION 1.42.3 diff --git a/R/UtilsMerge.R b/R/UtilsMerge.R index 9b6fe86..6c20942 100644 --- a/R/UtilsMerge.R +++ b/R/UtilsMerge.R @@ -274,9 +274,8 @@ seqMerge <- function(gds.fn, out.fn, storage.option="LZMA_RA", if (verbose) { - cat(date(), "\n", sep="") - cat(sprintf("Preparing merging %d GDS files:\n", - length(gds.fn))) + .cat(sprintf("Preparing merging %d GDS files (%s):", length(gds.fn), + date())) } # open all GDS files diff --git a/src/Index.cpp b/src/Index.cpp index 5abb423..455342c 100755 --- a/src/Index.cpp +++ b/src/Index.cpp @@ -1231,13 +1231,13 @@ void CProgress::ShowProgress() ConnPutText(File, "[%s] %2.0f%%, %s %s", bar, p, vCounter < vTotalCount ? "ETC:" : "completed,", time_str(s)); if (R_Process_Count && R_Process_Index && (*R_Process_Count>1)) - ConnPutText(File, " (process %d)", *R_Process_Index); + ConnPutText(File, " (process %d/%d)", *R_Process_Index, *R_Process_Count); ConnPutText(File, "\n"); } else { ConnPutText(File, "\r[%s] %2.0f%%, %s %s", bar, p, vCounter < vTotalCount ? "ETC:" : "completed,", time_str(s)); if (R_Process_Count && R_Process_Index && (*R_Process_Count>1)) - ConnPutText(File, " (process %d)", *R_Process_Index); + ConnPutText(File, " (process %d/%d)", *R_Process_Index, *R_Process_Count); ConnPutText(File, " "); if (vCounter >= vTotalCount) ConnPutText(File, "\n"); } @@ -1255,7 +1255,7 @@ void CProgress::ShowProgress() } else ConnPutText(File, "[: (0 line)] %s", dt); if (R_Process_Count && R_Process_Index && (*R_Process_Count>1)) - ConnPutText(File, " (process %d)", *R_Process_Index); + ConnPutText(File, " (process %d/%d)", *R_Process_Index, *R_Process_Count); ConnPutText(File, "\n"); } else { if (vCounter > 0) @@ -1265,7 +1265,7 @@ void CProgress::ShowProgress() } else ConnPutText(File, "\r[: (0 line)] %s", dt); if (R_Process_Count && R_Process_Index && (*R_Process_Count>1)) - ConnPutText(File, " (process %d)", *R_Process_Index); + ConnPutText(File, " (process %d/%d)", *R_Process_Index, *R_Process_Count); } } (*File->fflush)(File); @@ -1329,8 +1329,8 @@ void CProgressStdOut::ShowProgress() "\r[%s] 100%%, completed, %s", bar, time_str(s)); if (R_Process_Count && R_Process_Index && (*R_Process_Count>1)) { - snprintf(buffer+n, sizeof(buffer)-n, " (process %d)", - *R_Process_Index); + snprintf(buffer+n, sizeof(buffer)-n, " (process %d/%d)", + *R_Process_Index, *R_Process_Count); } Rprintf("%s\n", buffer); } else if ((interval >= 5) || (vCounter <= 0)) @@ -1341,8 +1341,8 @@ void CProgressStdOut::ShowProgress() "\r[%s] %2.0f%%, ETC: %s", bar, p, time_str(s)); if ((vCounter>0) && R_Process_Count && R_Process_Index && (*R_Process_Count>1)) { - n += snprintf(buffer+n, sizeof(buffer)-n, " (process %d)", - *R_Process_Index); + n += snprintf(buffer+n, sizeof(buffer)-n, " (process %d/%d)", + *R_Process_Index, *R_Process_Count); } strcpy(buffer+n, " "); Rprintf("%s", buffer);