load_vcf can't infer the build from common reference names (hs37d5, human_g1k_v37, Homo_sapiens_assembly19/38)

Open Beginner friendly
#712 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Start with varcode/reference.py, especially ensembl_reference_aliases and the resolver used by infer_genome and infer_reference_name. Check the Broad resource bundle documentation for the stated b37 and hg38 contig names, then add a test for each listed reference value. Done means these names resolve to the indicated builds and the tests pass.

Written by the indexing model from the issue text.

Description

Problem

load_vcf (through infer_genome and infer_reference_name) can't recognize the build in several widely used ##reference header values. It fails with Failed to infer genome assembly name, so the caller has to pass genome= by hand. load_vcf_samples/varcode check-samples now share this resolver (#691), so they need --assembly for the same files.

Checked on main at 6b444d5 (11.9.0):

##reference value Build Result
file:///refs/hs37d5.fa GRCh37 + decoy, 1000 Genomes phase 2 fails
/refs/human_g1k_v37.fasta GRCh37, 1000 Genomes phase 1 fails
file:///refs/Homo_sapiens_assembly19.fasta b37, Broad/GATK bundle fails
file:///refs/Homo_sapiens_assembly38.fasta hg38, Broad/GATK bundle fails
GRCh37-lite.fa, b37_decoy GRCh37 recognized

#207 fixed a hs37d5.fasta path only because its directory was named b37decoy-…; the file name alone still fails.

Suggested fix

Add these reference file names as aliases in varcode/reference.py (ensembl_reference_aliases, or a separate table of well-known FASTA names), with a test per name. The Broad names should be checked against the GATK resource bundle documentation: Homo_sapiens_assembly19 uses b37 contig names (1, MT), and Homo_sapiens_assembly38 uses hg38 names (chr1, chrM).

https://claude.ai/code/session_01JHJhwgzAgwTefwxNLB1ztR

Dominant language
Python
Stars
88
Forks
28
Avg merge
4h 47m
Merged PRs (30d)
55

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.