Rename PhaseAmbiguousEffect -> PhaseCandidateSet#376
Merged
Conversation
The class wraps a set of phase-hypothesis candidates, so a plural-
flavored name reads better at call sites:
if isinstance(eff, PhaseCandidateSet):
for c in eff.candidates:
...
Hard rename (no alias). The class is only exported via
varcode.effects.effect_classes, so this affects only callers that
imported the name directly.
docs/germline.md rewritten to lead with three concrete scenarios:
1. no germline (reference-relative)
2. germline + unknown phase -> PhaseCandidateSet
3. germline + phase_resolver -> single MutationEffect
Capturing real CFTR test-fixture output throughout.
Mirror the worker-cap logic from trufflepig/hitlist/tsarina/vaxrank so concurrent test runs across sibling repos can't fork-bomb the laptop. Picks min(cpu_reserve, available_RAM / PER_WORKER_GB), reserves 1-2 cores, falls back to serial pytest when xdist isn't installed, logs inputs so the chosen worker count is auditable.
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.
Summary
Renames the public class returned by germline-aware effect prediction when somatic + germline share a codon and phase is unknown:
PhaseAmbiguousEffect(singular, describes the cause).PhaseCandidateSet(plural-flavored, describes the contents — a set of phase-hypothesis candidates).The class wraps
.candidates(a tuple of per-hypothesis classified effects) and exposes.outcomes(same candidates plus per-haplotype evidence metadata). The plural name reads better at call sites:This is a hard rename — no deprecation alias. The class was only accessible via
varcode.effects.effect_classes.PhaseCandidateSet(never re-exported fromvarcode/__init__.py), so the blast radius is limited to external code that imported the old name directly.Bumps to 4.23.0 (breaking).
Docs rewrite
docs/germline.mdwas rewritten to be substantially clearer and to demonstrate the resolver-injection pattern with concrete output. It now leads with three side-by-side scenarios on the same CFTR test-fixture coordinates (7:117531100 T>A somatic + 7:117531101 T>C germline, same codon):Substitution p.L159M.PhaseCandidateSet ?p.L159M, with.outcomeslisting both haplotypes (B: ref-relative L->M; A: cis-germline S->T).phase_resolverforcing cis or trans → singleSubstitution(p.S159Tfor cis,p.L159Mfor trans).This makes the "varcode enumerates, an external phase source collapses" design explicit instead of buried prose.
Files touched
varcode/effects/effect_classes.py— class rename + comment update.varcode/germline.py— three internal references.varcode/variant.py,varcode/effects/effect_prediction.py— docstrings.tests/test_germline_effects.py— class import + isinstance assertions (8 references).docs/germline.md— full rewrite with the three-scenario demo.varcode/version.py— 4.22.1 -> 4.23.0.Test plan
pytest tests/test_germline_effects.py— 34/34.pytest tests/— 1185/1187 (2 skipped, same as before).Out of scope
.candidates/.outcomesattribute names..outcomesis part of theMultiOutcomeEffectcontract shared withSpliceOutcomeSetand SV machinery; renaming there would cascade.PhaseAmbiguousEffect = PhaseCandidateSetin a follow-up patch.