Add Mode to splitFasta to Split Peptides by FASTA Entry#18
Merged
Conversation
…lti-entry peptide headers per entry while preserving default single-tier behavior with test and docs updates
There was a problem hiding this comment.
Pull request overview
This PR adds a --split-mode option to the splitFasta command, enabling two split behaviors: the existing peptide mode (one FASTA record per unique peptide sequence assigned to a single tier) and a new entry mode (each individual FASTA header entry is routed to its own tier, allowing the same peptide sequence to appear in multiple tier files under different labels).
Changes:
PeptidePoolSplitter.split()gains asplit_modeparameter; the existing assignment logic is extracted intoadd_peptide_to_database_peptide_mode(), a newadd_peptide_to_database_entry_mode()handles per-entry routing, and shared key-resolution is factored intoget_database_key().- The
splitFastaCLI argument parser gains a--split-modeargument (choices:peptide,entry), and its handler passes the value to the splitter. - Unit and integration tests are added for both modes, and documentation is updated.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
moPepGen/aa/PeptidePoolSplitter.py |
Adds split_mode parameter, extracts per-mode methods, adds validation |
moPepGen/cli/split_fasta.py |
Adds --split-mode CLI argument and passes it to splitter.split() |
test/unit/test_peptide_pool_splitter.py |
Adds unit tests for entry and peptide mode split behavior |
test/integration/test_split_fasta.py |
Adds base args default and integration test for entry mode |
docs/split-fasta.md |
Documents the new --split-mode option |
CHANGELOG.md |
Records the new feature under the unreleased section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Description
Add
--split-modetosplitFastawith two modes:Closes #17
Checklist
.png, .jpeg),.pdf,.RData,.xlsx,.doc,.ppt, or other non-plain-text files. To automatically exclude such files using a .gitignore file, see here for example.CHANGELOG.mdunder the next release version or unreleased, and updated the date.