docs(tutorials): reproduce the published result in the Bludau 2021 tutorial - #35
Conversation
…actly The tutorial previously recovered 65 proteins against the paper's 63 and attributed the gap to "implementation details". It now recovers the same 63 accessions: 0 missed, 0 false positives, checked in the notebook against the published set rather than asserted in prose. Four workflow changes get there: - Missing values are no longer zero-filled at read time. The intensities encode an unmeasured peptide as NA and a measured zero as 0, and the completeness filter depends on telling them apart. - Peptide summarisation uses summarize_peptides_by_neighbourhood_union with the shipped FASTA, grouping by position in the protein sequence and selecting the most abundant member, in place of summarize_modifications + summarize_overlapping_peptides. Both unresolved-position policies are set to "keep". - The filters moved into the preprocessing section and now run in the published order: drop peptides missing in any sample, then constant peptides, then proteins with fewer than 2 peptides. The threshold was 4. Because every remaining peptide is complete, the exploratory section that follows needs no imputation. - The iRT protein is no longer removed by hand. It is absent from the FASTA, so its peptides collapse into one group and the peptide-count filter drops the protein, which is how the reference removes it. This yields 24,534 peptides across 2,885 proteins entering COPF, BH n of 1,272, and the proteoform score plot of Figure 6B. The sequence maps now search on a derived peptide_sequence column via alt_pep_sequence_key, because summarisation keeps each surviving peptide's own identifier with its modifications, as the reference does. Adds docs/tutorials/uniprot_mus-musculus_reviewed_bludau-2021.fasta (11 MB) so the notebook runs straight after cloning, with the path hardcoded relative to the notebook. Shipping a FASTA in the repository is not ideal and is worth revisiting. Outputs are committed, as in the other tutorials. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review of the edits to the Bludau 2021 tutorial. Three of them stopped the notebook executing from a clean kernel: - `bludauI_proteoforms` was used one cell before it was assigned, and the list had changed from accessions to gene symbols while the filter still matched it against `protein_id`. The definition moves into the cell that uses it and the filter matches `gene_id`. - The verification cell still referred to `scores`, a name removed when it was rewritten around `sig_df`. - The cell deriving `peptide_sequence` was removed, but both sequence maps still pass `alt_pep_sequence_key="peptide_sequence"`. Restored: summarisation keeps modification tags in the identifier, so the maps cannot locate peptides without a stripped column. `pf_df` counts only scorable proteins, so reporting it as "proteins analysed" understated the figure at 1,272. Now reported as three separate lines: 24,534 peptides, 2,885 proteins analysed, 1,272 scored. Prose: - The filtering section offered zero-filling as an alternative to the completeness filter. It is not one: exp_04 measured that zero-filling changes which peptide represents each group, and so changes the peptide set reaching COPF. Now stated as the reason the filter exists. - Restored two load-bearing explanations that had been cut: why missing values are preserved at read time, and why iRT needs no removal step. Both are relied on by later cells. - The header claimed the tests "guarantee" agreement to 1e-14. They establish it given the same peptide input, which is the whole point of the peptide set being the thing to get right. Reworded, typo fixed. - Completed a sentence in the summary that promised three choices and listed none, and replaced the closing "minor discrepancies ... expected" with the specific reason the ANOVA figure differs. - Fixed "detected as significatnexamined", subject-verb agreement in the summarisation section, and "technical modified forms". Result unchanged: 24,534 peptides, 2,885 proteins, BH n of 1,272, and IDENTICAL SET : True against the published 63. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Keeps the leaner narrative: the read-time note on missing values, the iRT explanation and the caveat against imputing are removed, PUBLISHED_63 is reflowed, and the Sorbs2 sequence map gains a sentence on the brain-specific region. Two fixes on top: "previously describes as brain-specific and exclusively in the neurons" -> "previously described as brain-specific and exclusive to neurons", and "as the paper's" -> "as the paper". Markdown and whitespace only, so the committed outputs still correspond to what the code cells do; not re-executed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
💡 Codex Reviewhttps://github.com/UKHD-NP/proteopy/blob/7d1a3e15878c403389bbbad0bb75323d2b1844c2/docs/tutorials/uniprot_mus-musculus_reviewed_bludau-2021.fasta#L1 The new 11 MB, 17,033-record FASTA is committed beside the notebook without a UniProt release, retrieval date/query, source URL, license, or checksum. Because this exact sequence snapshot determines peptide grouping and therefore the claimed 63-protein result, future contributors cannot reproduce or verify the input if UniProt changes; place the tutorial dataset under AGENTS.md reference: AGENTS.md:L469-L471 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Updates the Bludau 2021 tutorial so it reproduces the published result.
It previously recovered 65 proteins with proteoform groups against the paper's 63, and closed by attributing the gap to implementation details. It now recovers the same 63 accessions, and the notebook checks that against the published set rather than stating it in prose.
Workflow changes:
pr.pp.summarize_peptides_by_neighbourhood_union(), grouping by position in the protein sequence, in place ofsummarize_modifications()+summarize_overlapping_peptides().Adds
docs/tutorials/uniprot_mus-musculus_reviewed_bludau-2021.fasta(11 MB), which the new summarisation step needs, so the notebook runs after cloning. Shipping a FASTA in the repository is not ideal and could be replaced by a download helper later.Outputs are committed, as in the other tutorials.