Compiled-code stdout fix + set Wei Li as maintainer (Bioc) - #12
Merged
Conversation
Bioconductor / R CMD check flags compiled code that writes to stdout/stderr. Replace std::cout/std::cerr/printf with Rcpp::Rcout/Rcpp::Rcerr/Rprintf in src/RRA.cpp, src/fileio.cpp and src/rngs.cpp (fprintf() calls that write to the RRA output *file* are unchanged). Verified: scMAGeCK.so no longer references std::cout/cerr/printf/puts/putchar, and scmageck_rra output on the bundled demo is byte-identical to before (full result table all.equal == TRUE; lo_value sums unchanged).
Switch the Authors@R cre role to Wei Li <li.david.wei@gmail.com> for the Bioconductor resubmission (Xiaolong Cheng and Lin Yang remain authors). Note the compiled-code fix in NEWS.
davidliwei
force-pushed
the
fix/compiled-code-stdout
branch
from
July 9, 2026 18:24
77890cc to
8d5365b
Compare
Collaborator
Author
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to make the package Bioconductor submission-ready for version 0.99.0 by (1) routing compiled-code diagnostics through R-friendly output mechanisms and (2) updating package maintainer metadata.
Changes:
- Replaced
std::cout/std::cerr/printfusage in C/C++ sources withRcpp::Rcout/Rcpp::Rcerr/Rprintf. - Updated
DESCRIPTIONto set Wei Li ascre(maintainer). - Documented the compiled-code stdout/stderr change in
NEWS.md.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
src/RRA.cpp |
Switched diagnostic output from C/C++ streams/printf to R output APIs (Rcpp::Rcout/Rcpp::Rcerr/Rprintf). |
src/fileio.cpp |
Switched error/diagnostic output to Rcpp::Rcerr/Rprintf while keeping result-file fprintf() writes. |
src/rngs.cpp |
Replaced printf with Rprintf for messages in RNG utilities and added the R print header. |
NEWS.md |
Added a changelog entry describing the compiled output routing change. |
DESCRIPTION |
Updated Authors@R to set Wei Li as maintainer (cre). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
101
to
105
| ifstream fh; | ||
| fh.open(fname); | ||
| if(!fh.is_open()){ | ||
| cerr<<"Error opening "<<fname<<endl; | ||
| Rcpp::Rcerr<<"Error opening "<<fname<<endl; | ||
| } |
Comment on lines
37
to
41
| ifstream fh; | ||
| fh.open(fileName); | ||
| if(!fh.is_open()){ | ||
| cerr<<"Error opening "<<fileName<<endl; | ||
| Rcpp::Rcerr<<"Error opening "<<fileName<<endl; | ||
| } |
Comment on lines
179
to
183
| // actually loading the file | ||
| fh.open(fileName); | ||
| if(!fh.is_open()){ | ||
| cerr<<"Error opening "<<fileName<<endl; | ||
| Rcpp::Rcerr<<"Error opening "<<fileName<<endl; | ||
| } |
| for (i=0;i<groupNum;i++){ | ||
| if(groups[i].controlsgs>=groups[i].itemNum){ //skip those that consists of only control sgrnas | ||
| printf("Suppressing the output of gene %s since it is negative ontrol genes.\n",groups[i].name); | ||
| Rprintf("Suppressing the output of gene %s since it is negative ontrol genes.\n",groups[i].name); |
Comment on lines
118
to
122
| if (x == 0) | ||
| while (!ok) { | ||
| printf("\nEnter a positive integer seed (9 digits or less) >> "); | ||
| Rprintf("\nEnter a positive integer seed (9 digits or less) >> "); | ||
| scanf("%ld", &x); | ||
| ok = (0 < x) && (x < MODULUS); |
| Authors@R: c( | ||
| person("Wei", "Li", role = "aut"), | ||
| person("Xiaolong", "Cheng", email = "xiaolongcheng1120@gmail.com", role = c("aut", "cre")), | ||
| person("Wei", "Li", email = "li.david.wei@gmail.com", role = c("aut", "cre")), |
- loadControlSeq / getGroupListNum / ReadFile: return early on file-open
failure instead of continuing on a failed stream.
- loadControlSeq: guard the trailing-char access so empty lines are not
read out of bounds (undefined behavior).
- PutSeed(x == 0): seed from the clock like x < 0 instead of prompting via
scanf() -- reading stdin can hang non-interactive R runs.
- Fix two user-facing message typos ("Aggreation", "ontrol").
RRA output on the bundled demo remains byte-identical (all.equal == TRUE;
lo_value sums and control-sequence count unchanged).
Collaborator
Author
|
Thanks @copilot — all 7 points addressed in 695e421:
Verified: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Final Bioconductor submission-readiness for 0.99.0.
std::cout/cerr/printf→Rcpp::Rcout/Rcpp::Rcerr/Rprintfinsrc/RRA.cpp/fileio.cpp/rngs.cpp(thefprintf(fh, ...)result-file writes are unchanged). Clears the last R CMD check NOTE.cre); Xiaolong Cheng and Lin Yang remainaut.loadControlSeq/getGroupListNum/ReadFile); guard empty-line char access (UB);PutSeed(0)seeds from the clock instead of reading stdin viascanf; fixed two message typos.Verified:
scMAGeCK.sono longer referencesstd::cout/cerr/printf/puts/putchar;scmageck_rraon the bundled demo is byte-identical (all.equal== TRUE; lo_value sums + control-seq count unchanged); R CMD check on Linux = 0 ERROR / 0 WARNING / 0 NOTE.🤖 Generated with Claude Code