Skip to content

fix: add safety checks for string peptides before computing number of matches in database-grounded FDR calculation#166

Merged
JemmaLDaniel merged 3 commits into
mainfrom
fix-add-string-peptide-safety-check-to-db-fdr
Feb 25, 2026
Merged

fix: add safety checks for string peptides before computing number of matches in database-grounded FDR calculation#166
JemmaLDaniel merged 3 commits into
mainfrom
fix-add-string-peptide-safety-check-to-db-fdr

Conversation

@JemmaLDaniel
Copy link
Copy Markdown
Collaborator

@JemmaLDaniel JemmaLDaniel commented Feb 24, 2026

PR Type

Bug fix


Description

  • Clarify docstring column names and confidence description

  • Add safety checks for string sequences and predictions

  • Simplify num_matches computation lambda


Changes walkthrough 📝

Relevant files
Bug fix
database_grounded.py
Add sequence/prediction safety checks and simplify matching

winnow/fdr/database_grounded.py

  • Renamed docstring field from 'peptide' to sequence
  • Updated confidence description to "User-specified confidence column"
  • Added type checks before splitting sequence and prediction
  • Removed conditional in num_matches lambda for list type
  • +9/-8     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • … matches in database-grounded FDR calculation
    @JemmaLDaniel JemmaLDaniel self-assigned this Feb 24, 2026
    @JemmaLDaniel JemmaLDaniel added the bug Something isn't working label Feb 24, 2026
    @JemmaLDaniel
    Copy link
    Copy Markdown
    Collaborator Author

    /describe

    @instadeep-pr-agent
    Copy link
    Copy Markdown

    PR Description updated to latest commit (a1c0131)

    @github-actions
    Copy link
    Copy Markdown

    github-actions Bot commented Feb 24, 2026

    Coverage

    Coverage Report
    FileStmtsMissCoverMissing
    __init__.py00100% 
    data_types.py40100% 
    calibration
       __init__.py00100% 
       calibration_features.py2641195%148–149, 312–314, 549–551, 1024–1026
       calibrator.py911583%69–70, 72, 106–109, 134–135, 137, 162–163, 167, 194–195
    compat
       __init__.py00100% 
       instanovo.py10640%12, 14–15, 17, 24–25
    datasets
       __init__.py00100% 
       calibration_dataset.py871286%138, 191, 193–194, 200–203, 205–208
       data_loaders.py20315324%62–64, 67, 69, 74, 79, 91, 93–96, 98, 102–103, 105, 107, 122, 128, 137–138, 142, 160–161, 163–165, 167–169, 171–172, 174, 188, 191–192, 194–195, 200, 206–207, 216, 219, 229, 247–249, 258, 272, 277–279, 281, 285–286, 288–289, 294, 297, 304, 310, 324–325, 328, 331–332, 341, 350, 407–408, 410–413, 415, 419–420, 422, 434–436, 439–440, 458–459, 461–462, 465–467, 472, 475–476, 479–480, 486–487, 489, 501, 504, 516–517, 524, 530, 534, 536, 539, 543, 565, 590–591, 593–594, 597–599, 609–610, 640, 653–654, 658, 662, 676, 696, 706–707, 718, 795, 815–816, 818–820, 826–830, 835–836, 839, 842, 847, 853–859, 865–866
       interfaces.py30100% 
       psm_dataset.py250100% 
    fdr
       __init__.py00100% 
       base.py581574%81, 85–86, 91, 98–99, 105, 126, 129–130, 135, 137–138, 144, 186
       database_grounded.py28196%52
       nonparametric.py25484%62, 68–69, 72
    scripts
       __init__.py00100% 
       main.py1421420%8, 10–14, 17–21, 24–25, 27–29, 33, 40, 45, 48, 54, 56–57, 60, 69, 77, 80, 87, 89–91, 93, 95–100, 103, 105–106, 111, 126, 129, 135–136, 138–140, 143–144, 147, 160–162, 165, 168, 173, 175–177, 179, 181–182, 185–186, 189, 191–192, 194, 196, 198–199, 201, 204–205, 208–209, 212–213, 216–218, 220, 223, 237–239, 242, 245, 250, 252–254, 256–257, 259–260, 263–264, 267, 269–270, 272, 274, 276–277, 279, 282–283, 289–290, 293–294, 297–298, 301–302, 310–312, 315–318, 322, 325, 348, 361–362, 365, 390, 403–404, 407, 422, 434–435, 438, 453, 465–466
    utils
       __init__.py40100% 
       config_formatter.py534024%29, 37–38, 40–42, 44, 55, 58–60, 62–63, 66–69, 72–74, 77–78, 80, 91, 102, 113, 127–128, 130–132, 145–147, 150, 153–154, 157–158, 160
       config_path.py76593%24–26, 117–118
       peptide.py160100% 
    TOTAL108940462% 

    Tests Skipped Failures Errors Time
    174 0 💤 0 ❌ 0 🔥 12.440s ⏱️

    @JemmaLDaniel JemmaLDaniel requested a review from BioGeek February 24, 2026 11:09
    @JemmaLDaniel JemmaLDaniel marked this pull request as ready for review February 24, 2026 11:09
    Comment thread winnow/fdr/database_grounded.py Outdated
    @JemmaLDaniel JemmaLDaniel requested a review from BioGeek February 25, 2026 09:21
    @JemmaLDaniel JemmaLDaniel merged commit 75d28d9 into main Feb 25, 2026
    4 checks passed
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    bug Something isn't working

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants