Repository navigation
UniProt XML: proteoform provenance (stacked on #149) - #152
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 44 minutes. View limit details
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ypriverol
marked this pull request as ready for review
October 14, 2026 12:54
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
ypriverol
force-pushed
the
feat/uniprot-proteoform-provenance
branch
from
October 14, 2026 12:55
df3078e to
52105ae
Compare
ypriverol
marked this pull request as draft
October 14, 2026 16:02
ypriverol
marked this pull request as ready for review
October 15, 2026 05:36
Base automatically changed from
claude/uniprot-openms-reference-kun7zu
to
main
October 15, 2026 05:42
…, DeltaRefScore, IsotopeMimic)
…e origins - IsVariant/IsIsoform/IsChain are set when ANY protein of the peptide is of that kind. Counting a peptide shared with the canonical entry as canonical was not target/decoy symmetric: shuffled decoys and pseudo-reversed chain decoys do not keep the peptides their targets share, so the flags were set on decoys more often than on targets. - DeltaRefScore compares a row with the best canonical candidate of another peptidoform (RefTracker keeps best and second-best by peptidoform key), so a shared peptide does not compete with its own canonical copy. - --decoy-strategy shuffle is refused when the database holds isoform or mature-chain entries. - Canonical UniProt entries carry an origin (Reference, family = accession), so every entry of a family reports the same ProteinFamily. - --refine Pass-2 mini-proteins and their decoys keep the origin of the entry their backbone came from.
A variant entry with a single-residue substitution could emit a form that weighs the same, residue by residue, as a searchable form of the canonical peptide: N10D reads D where the canonical N10 deamidated weighs the same, and D18N deamidated is the canonical D18. On one Astral file, adding deamidation as a variable mod raised accepted variant PSMs from 98 to 159, almost all of them deamidation-like substitutions. The reader now records each equal-length substitution (position, original residue); decoys map the positions through their permutation. SpanSites, the per-position filter every expansion path uses, rejects a form at a substituted position whose residue+mod mass equals a searchable form of the original residue (within SITE_MASS_TOLERANCE). A multi-residue substitution loses such a form even when another of its positions still differs.
Rebased onto main after #149. For every out-of-core golden case and the precursor-cal PIN/TSV, the new output with the six provenance columns (three TSV columns) removed equals main's golden exactly; every new value is 0.
ypriverol
force-pushed
the
feat/uniprot-proteoform-provenance
branch
from
October 15, 2026 10:40
177ecea to
706e685
Compare
ypriverol
added a commit
that referenced
this pull request
Oct 15, 2026
Variant substitutions are judged against the forms the replaced residue takes in the same terminal context; the stacked form tables and the single-copy Met walk are kept. Goldens regenerated: with the six provenance columns removed they equal the previous ones.
3 of 5 tasks
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.
Based on
main(after #149 was merged). The last commit is the same fix as #160 (annotation: Noneon seven test proteins added by #151), so the branch's tests compile until #160 is merged.What it adds
Entry origin. Every protein from a UniProt XML database carries a kind (Reference / Isoform / Variant / Chain), a family accession and a feature id. Variants also carry the mass change of their substitution. Decoys keep their target's origin.
--refinePass-2 mini-proteins, and their decoys, keep the origin of the entry their backbone came from.Six PIN columns, appended after
DeltaRTNorm, beforePeptide. They are Percolator features.IsVariant,IsIsoform,IsChainRefCompetitorDeltaRefScoreIsotopeMimicsearch::isotope_mimic.Three TSV columns:
ProteinFamily,EntryKindandFeatureIdsfor the named protein.Two guards:
--uniprot-variantsis on;--decoy-strategy shuffleis refused when the database holds isoform or mature-chain entries.Target/decoy symmetry
The first design counted a peptide shared with the canonical entry as canonical. Review found that rule asymmetric:
The flags were therefore set on decoys more often than on targets, and Percolator would learn the label. The flags now mean "any protein of this kind". Specific evidence for an alternative sequence is a row whose
Proteinsnames no canonical entry.DeltaRefScoreis computed against canonical candidates of a different peptidoform, so a shared peptide doesn't compete with its own canonical copy.Unchanged
RefCompetitor=DeltaRefScore= 0.protein_accessionschema is unchanged.Verification
main: out-of-core slices, the E. coli digests, and the precursor-cal PIN/TSV. For every case, the new output with the new columns removed equals the previous golden exactly, and every new value is 0.cargo clippy --workspace --all-targets -D warnings: clean.cargo test --release --workspacewith CI's skip list: 1,548 passed, 0 failed (after the rebase onto main).--include-ignored, the out-of-core goldens also pass.onnx-inferandmodel-trainfail on that run because they need exported ONNX models; this PR doesn't touch either crate.Variant forms that a searched mod makes canonical (177ecea)
A variant entry could emit a form that weighs the same, residue by residue, as a searchable form of the canonical peptide. For example, N→D reads D, and D is what the canonical N weighs after deamidation. Variant entries now record each single-residue substitution (position, original residue), and decoys map these through their permutation.
SpanSites, the per-position filter every expansion path uses, rejects a substituted residue whose form weighs the same as a searchable form of the residue it replaced.One Astral file (HYE, reviewed UniProt XML, Percolator 3.7.1)
The class FDR in brackets is that class's decoys divided by its targets above the global 1% cutoff.
IsotopeMimicflags them, but no searched mod can make them canonical.Rejected: counting a peptide shared by several entries as one fragment-index candidate lowered Astral PSMs by 0.4–0.8% and did not reduce the churn isoforms cause. It was not committed. Why isoforms cost about 0.9% of canonical PSMs is still unknown.
Not done
Validation on real data. The plan is genotype truth on PXD001406, using 1000 Genomes lymphoblastoid lines with open genotypes. Report: