Suppress repetitive GeneMark license banner in training/predict logs#56
Merged
nextgenusfs merged 1 commit intomainfrom Apr 22, 2026
Merged
Suppress repetitive GeneMark license banner in training/predict logs#56nextgenusfs merged 1 commit intomainfrom
nextgenusfs merged 1 commit intomainfrom
Conversation
Agent-Id: agent-4d333a81-18f1-408d-8560-0c846ac09121
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.
Problem
During
funannotate2 train(andpredict),gmhmme3is invoked once per contig. Each invocation prints a two-line license banner to both stdout and stderr:runSubprocesscaptures both streams and forwards them tologger.debug(...), and the file handler is set toDEBUG. Result: the log file gets flooded with duplicate banners (one block per contig — typically dozens to thousands).Example from a user's log:
Fix
funannotate2/utilities.py— add an opt-inoutput_filter=Nonekwarg torunSubprocess. When set, the success path delegates output handling tooutput_filter(logfile, stdout, stderr)instead of the defaultlogoutput(logfile.debug, process). Default behavior is unchanged for every existing caller. Error path (CalledProcessError) is untouched.funannotate2/abinitio.py— add a module-level_GENEMARK_BANNER_LOGGEDflag and a_genemark_output_filterhelper. The helper splits each stream into banner lines (matchingGeneMark.hmm eukaryoticordays remaining in the license period) vs. other content; the banner is logged atdebugonce per process, then suppressed on subsequent calls. Non-banner content (real warnings/errors) continues to go throughlog.debug. Bothgmhmme3call sites (run_genemarkand the evaluation loop'stool == "genemark"branch) now passoutput_filter=_genemark_output_filter.Preserved behavior
gmhmme3 -f gtf -k 0.03 ...command line is still logged (that one is useful for debugging; only the banner is suppressed).CalledProcessError) still log full stdout/stderr at error level — unchanged.Verification
python3 -m py_compile funannotate2/utilities.py funannotate2/abinitio.py— both compile clean.True.Noneinputs handled without raising.Risk notes
gmhmme3into amultiprocessingworker (fork), each worker would log the banner once — still a massive reduction.Pull Request opened by Augment Code with guidance from the PR author