Deprecated aliases (load_vcf_fast, detect_loh, ensembl=, extended_protein_sequence) survive 11.0 and varcode still calls some of them

Open
#693 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
44/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start with the listed callers in varcode/variant_collection.py, varcode/effects/effect_collection.py, and varcode/cli/variant_args.py, then inspect the deprecated aliases in varcode/variant.py and varcode/effects/effect_classes.py. The issue also identifies exports and API pages to update, plus varcode/util.py and varcode/effects/common.py. Done means internal callers use current names, deprecated APIs are handled as described, and the release notes and documentation reflect the changes.

Written by the indexing model from the issue text.

Description

Problem

Varcode still exports several names it documents as deprecated, through the 11.0.0 major release, and its own code keeps calling some of them. Deprecated names therefore look current to anyone reading the source, the API reference still renders them, and removing them later will mean touching internal callers as well.

Evidence

Read at d1b4280 (version 11.4.2).

  • load_vcf_fast (varcode/vcf.py:264-271) only warns and forwards to load_vcf. It is still exported (varcode/__init__.py:119, :283) and rendered as an API entry (docs/api_variants.md:253).
  • detect_loh (varcode/germline.py:745-757) was deprecated in 10.1.0 and now always returns None. It is still exported (varcode/__init__.py:51, :261) and documented (docs/api_phasing.md:43).
  • Variant(ensembl=...) and the Variant.ensembl property are documented as deprecated (varcode/variant.py:110, :252-260), but the keyword is accepted without a warning (variant.py:157-160). Library code reads variant.ensembl instead of variant.genome at varcode/variant_collection.py:353, varcode/effects/effect_collection.py:320 and :684, and varcode/cli/variant_args.py:166. random_variants (varcode/util.py:30) still takes ensembl= as its only genome keyword.
  • StopLoss.extended_protein_sequence is marked "Deprecated name for aa_alt" (varcode/effects/effect_classes.py:1605), but StopLoss.short_description uses it (effect_classes.py:1614).
  • bio_seq_to_str (varcode/effects/common.py:16-20) converts Biopython Seq objects with str(seq). Biopython was dropped in #293, and the function is just str(seq).

Suggested fix

  • Replace internal uses: variant.ensembl becomes variant.genome, extended_protein_sequence becomes aa_alt, and bio_seq_to_str(x) becomes str(x) (then delete bio_seq_to_str). Give random_variants a genome= keyword.
  • Make Variant(ensembl=...) and Variant.ensembl emit DeprecationWarning, as load_vcf_fast and detect_loh already do.
  • In the next major release, remove load_vcf_fast, detect_loh, ensembl=/.ensembl and extended_protein_sequence, with a CHANGELOG entry. Until then, list them in one "Deprecated" section of docs/conventions.md instead of as API reference entries.

https://claude.ai/code/session_01JHJhwj29oDqoeu7TYd34Pi

Dominant language
Python
Stars
88
Forks
28
Avg merge
3h 17m
Merged PRs (30d)
52

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openvax/varcode

All issues in openvax/varcode

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.