Skip to content

Conversation

@sanjaysgk
Copy link
Collaborator

@sanjaysgk sanjaysgk commented Jun 29, 2025

Summary by Sourcery

Enable customizable protein ID parsing and isoform extraction, improve runner input handling and logging, update plot titles, and bump the package version with new example data

New Features:

  • Allow custom delimiter patterns in extract_protein_ids for flexible accession splitting
  • Add extract_protein_isoforms to parse and return protein isoform identifiers from accession strings

Enhancements:

  • Enhance runner to accept single protein strings, comma-separated lists, or file paths with detailed logging and error handling
  • Standardize and clarify plot titles to include the target protein identifier

Chores:

  • Bump package version to 1.1.1-dev
  • Add example data files for JCI146771_Mouse_peptides dataset

Sanjay Gopala Krishna added 2 commits June 24, 2025 15:06
@sourcery-ai
Copy link

sourcery-ai bot commented Jun 29, 2025

Reviewer's Guide

This PR refactors protein ID extraction by parameterizing split patterns and adding isoform parsing, enhances the runner’s handling and logging of provided protein lists, updates the package version, and includes new sample data files for testing.

Class diagram for updated PeptideDataProcessor methods

classDiagram
    class PeptideDataProcessor {
        +remove_ptm(peptide: str) str
        +extract_protein_ids(accession_value: str, protein_pattern=None) List[str]
        +extract_protein_isoforms(accession_value: str, protein_pattern: str = r'[,:;|/\\s]+') List[str]
        +find_peptide_position(peptide: str, protein_sequence: str) Tuple[int, int]
    }
Loading

Class diagram for run_pipeline function changes

classDiagram
    class run_pipeline {
        +run_pipeline(...)
        specific_proteins
    }
    run_pipeline --> PeptideDataProcessor : uses
    class PeptideDataProcessor
Loading

File-Level Changes

Change Details Files
Refactor protein ID extraction with parameterized patterns and isoform support
  • Added optional protein_pattern parameter to extract_protein_ids with default fallback
  • Replaced static split regex with compiled or provided pattern
  • Introduced extract_protein_isoforms to parse and extract isoform suffixes using regex
ProtPeptigram/DataProcessor.py
Enhance runner’s protein_list parsing and logging
  • Added detailed console.log messages for provided protein_list inputs
  • Supported single string, comma-separated lists, and file-based inputs under a unified branch
  • Wrapped file reading in try/except to handle missing files gracefully
  • Updated visualization title format to include target protein
ProtPeptigram/runner.py
Bump package version
  • Updated version from "1.1.0-dev" to "1.1.1-dev"
ProtPeptigram/__init__.py
Include sample data and test output files
  • Added new CSV data files under data/ and example/data/ for demo purposes
  • Included processed_peptides_prot-peptigram.csv in test_output for validation
data/JCI146771_Mouse_peptides_peaks_online copy.csv
example/data/JCI146771_Mouse_peptides_peaks_online_Nopeptides_ingroups.csv
test_output/processed_peptides_prot-peptigram.csv

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sanjaysgk sanjaysgk merged commit 80ab5f2 into main Jun 29, 2025
3 checks passed
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We encountered an error and are unable to review this PR. We have been notified and are working to fix it.

You can try again by commenting this pull request with @sourcery-ai review, or contact us for help.

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.

2 participants