Only apply pyrodigal meta mode when genome < 20kb and prevent long runs of N in predicted genes#368
Open
JeanMainguy wants to merge 4 commits intodevfrom
Open
Only apply pyrodigal meta mode when genome < 20kb and prevent long runs of N in predicted genes#368JeanMainguy wants to merge 4 commits intodevfrom
JeanMainguy wants to merge 4 commits intodevfrom
Conversation
axbazin
approved these changes
Feb 27, 2026
…est dataset and therefore is impacted by meta mode change
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:
When running Pyrodigal in meta mode for highly fragmented genomes, it sometimes assigns the wrong genetic code to contigs. This happens because the current logic switches to meta mode if the largest contig is smaller than 20 kb, even though the total genome size might be sufficient for training.
Solution:
Updated the logic to switch to meta mode only if the sum of all contig sizes in the genome is less than 20 kb (instead of just the largest contig). This ensures Pyrodigal trains on the full genome when possible, reducing incorrect genetic code assignments.
Impact:
Other Change:
I also modify the min_mask parameter to pyrodigal.GeneFinder. This paramter defines the minimum length of masked sequence to trigger masking and it default value is 50. I set it to 9 to prevent long runs of N in predicted genes. Some problematic genes were observed in genome GCA_022531725.1.