Mouse reference names: mm9 maps to a nonexistent GRCm37, and GRCm38/GRCm39 accessions misparse

Open Beginner friendly
#690 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
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Start with the reference-name mappings and matching logic in varcode/reference.py, then look for existing tests of infer_genome. Check the listed accession versions against pyensembl’s assembly_catalog.json and the NCBI data mentioned in the issue. Done means mm9 and each listed GCA/GCF accession resolve to the expected assembly, without treating GRCm39 accessions as GRCm38 releases.

Written by the indexing model from the issue text.

Description

Found while fixing #668 (#689); varcode 11.5.1 branch, pyensembl 2.32.3. infer_genome(name):

name result expected
mm9 ValueError: Failed to infer genome assembly name for mm9 NCBIM37 (UCSC mm9 is NCBI Build 37; pyensembl serves NCBIM37 in releases 54–67)
NCBIM37 NCBIM37, release 67 (works)
GCA_000001635.8 (GRCm38.p6) ValueError: Invalid Ensembl releases 8, must be greater than 40 GRCm38
GCA_000001635.9 (GRCm39) ValueError: Invalid Ensembl releases 9, must be greater than 40 GRCm39
GCF_000001635.26 (GRCm38.p6) Failed to infer genome assembly name GRCm38
GCF_000001635.27 (GRCm39) Failed to infer genome assembly name GRCm39
GCF_000001635.24 (GRCm38.p4) GRCm38 (works)

Causes, in varcode/reference.py:

  1. ucsc_to_ensembl_reference_names maps mm9 to "GRCm37", which isn't a name pyensembl knows. _collect_candidate_matches only walks pyensembl's canonical names, so mm9 never matches.
  2. ensembl_reference_aliases["GRCm38"] includes the unversioned "GCA_000001635". Since it is an exact alias, _split_release reads any versioned accession GCA_000001635.N as "GRCm38, Ensembl release N". That breaks every GRCm38 GCA accession as well as GRCm39's, and as a substring it would also claim GRCm39 files named by accession for GRCm38. The GCF list stops at GRCm38.p4 (.24), and GRCm39 has no accession aliases.

Suggested fix: map mm9 to NCBIM37. Replace the unversioned GCA with versioned accessions taken from pyensembl's assembly_catalog.json, the shared metadata: GRCm38 GCA_000001635.2–.8, GRCm39 GCA_000001635.9. Add the GCF accessions for GRCm38.p5/p6 (.25, .26) and GRCm39 (.27), checked against NCBI. Test that each accession resolves to its own assembly, and that GRCm39's accession is never read as a GRCm38 release.

Dominant language
Python
Stars
88
Forks
28
Avg merge
2h 40m
Merged PRs (30d)
50

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.