Skip to content

Add Mode to splitFasta to Split Peptides by FASTA Entry#18

Merged
zhuchcn merged 3 commits into
mainfrom
czhu-update-split-fasta
Mar 2, 2026
Merged

Add Mode to splitFasta to Split Peptides by FASTA Entry#18
zhuchcn merged 3 commits into
mainfrom
czhu-update-split-fasta

Conversation

@zhuchcn

@zhuchcn zhuchcn commented Mar 2, 2026

Copy link
Copy Markdown
Collaborator

Description

Add --split-mode to splitFasta with two modes:

  • peptide (default): existing behavior, one tier per peptide sequence
  • entry: split by individual FASTA header entry, so shared peptides can appear in multiple tiers

Closes #17

Checklist

  • This PR does NOT contain PHI or germline genetic data. A repo may need to be deleted if such data is uploaded. Disclosing PHI is a major problem.
  • This PR does NOT contain molecular files, compressed files, output files such as images (e.g. .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.
  • I have read the code review guidelines and the code review best practice on GitHub check-list.
  • The name of the branch is meaningful and well formatted following the standards, using [AD_username (or 5 letters of AD if AD is too long)]-[brief_description_of_branch].
  • I have added the major changes included in this pull request to the CHANGELOG.md under the next release version or unreleased, and updated the date.
  • All test cases passed locally.

…lti-entry peptide headers per entry while preserving default single-tier behavior with test and docs updates
Copilot AI review requested due to automatic review settings March 2, 2026 13:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 a split_mode parameter; the existing assignment logic is extracted into add_peptide_to_database_peptide_mode(), a new add_peptide_to_database_entry_mode() handles per-entry routing, and shared key-resolution is factored into get_database_key().
  • The splitFasta CLI argument parser gains a --split-mode argument (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.

Comment thread moPepGen/cli/split_fasta.py Outdated
Comment thread moPepGen/cli/split_fasta.py Outdated
zhuchcn and others added 2 commits March 2, 2026 21:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@zhuchcn
zhuchcn merged commit 8f68649 into main Mar 2, 2026
2 of 3 checks passed
@zhuchcn
zhuchcn deleted the czhu-update-split-fasta branch March 2, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

splitFasta: Entry-level Split for Shared Peptides

2 participants