Skip to content

GRCh38.p14 contigs and cdot 0.2.38, for cdot data 0.2.37's alt alignments - #2944

Merged
davmlaw merged 1 commit into
masterfrom
2937_grch38_p14_contigs
Nov 30, 2026
Merged

davmlaw merged 1 commit into
masterfrom
2937_grch38_p14_contigs

Conversation

@davmlaw

@davmlaw davmlaw commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

For #2937: getting VariantGrid ready for cdot data 0.2.37, which adds alt_alignments (a transcript's chrY PAR copy, alt loci NT_ and patches NW_).

Changes

  • GRCh38.p14 contigs (snpdb/migrations/0023_grch38_p14_contigs.py). RefSeq GRCh38 annotation is on p14, but VariantGrid builds GRCh38 from the p13 assembly report. The migration adds the 71 patches p14 introduced, after the existing contigs, and keeps the gene-level contig last. snpdb/genome/reference_contigs.py:add_patch_release_contigs adds the contigs a later patch release has that the build doesn't. Builds are still created from p13, and every database then gets the p14 patches from the migration, so fresh and existing installs end up the same. Left out on purpose:

    • Rows the p14 report gives no RefSeq accession (na): contigs are unique by that accession.
    • The 5 contigs p13 has and p14 dropped: they stay, in case variants are on them.

    The genome FASTA doesn't have these contigs. That's harmless: biocommons only maps transcripts to chromosomes, and SingleBuildFastaSeqFetcher already raises ContigNotInBuildError for a missing contig.

  • TranscriptVersion.get_contigs() reads the alt_alignments keys, falling back to other_chroms for older data. The new get_chromosome_contigs() keeps only assembled molecules. get_chromosomes() uses it, which drives the "maps to multiple chromosomes" warnings on the gene and transcript pages. So does the gene-symbol g. search in variantopedia/signals/hgvs_search.py. Otherwise nearly every gene with an alt-locus copy would warn, and a search like "BRCA1 g.…" would also try NT_ contigs.

  • cdot 0.2.38. Its data providers use alt_alignments. DjangoTranscriptDataProvider doesn't override any method 0.2.38 changed. cdot is exempt from the uv cooldown.

Checked against real data

I built a cdot 0.2.37-format RefSeq GRCh38 file from the RS_2025_08 GFF with cdot master: 186,222 transcripts, 7,829 of them on alt loci or patches only.

  • Before the migration: 1,121 transcripts on unknown p14 patches, which raise a KeyError in import_gene_annotation, and 1,253 unknown alt_alignments contigs, which raise a KeyError in get_contigs.
  • After the migration: none. All 93 transcripts on two chromosomes are X/Y PAR, and biocommons already chooses chrX for those.

Tests

The full suite passes, except 5 tests that need a T2T FASTA, which this box doesn't have. They fail on master too. ImportCdotAltAlignmentsTest imports a PAR transcript with an alt-locus alignment and a transcript only on a p14 patch.

🤖 Generated with Claude Code

…RCh38.p14 introduced, as RefSeq GRCh38 annotation is on p14 and cdot data 0.2.37 aligns transcripts to them (1,121 transcripts have one as their only contig). TranscriptVersion.get_contigs reads alt_alignments, falling back to other_chroms, and the "maps to multiple chromosomes" warnings and gene-symbol g.HGVS search count chromosomes only, not alt loci and patches #2937
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant