Repository navigation
Annotate the rCRS mitochondrion in t2t-chm13 as contig NC_012920.1 (0.52.0) - #206
Merged
Merged
Conversation
….52.0) The chm13v2.0_maskedY_rCRS analysis set carries the rCRS as chrM, and Ensembl's rapid-release T2T annotation has no mitochondrial genes. The rCRS is GRCh38's MT, so t2t-chm13 now includes Ensembl GRCh38 release 115's 37 MT genes on a contig named NC_012920.1, which can't be read as CHM13's own MT. The three files (about 12 KB) are packaged, pinned under the pin's new mitochondria entry and rebuilt by tools/build_rcrs_mitochondrion.py, which checks the MT DNA against NC_012920.1, exons against cDNA and table 2 translations against proteins. The GTF the index reads is the downloaded GTF with the MT records appended, written beside the index; downloaded files are reused, and the index is rebuilt once. contig_aliases maps the _rCRS set's chrM to NC_012920.1, and PyEnsembl is told the contig is mitochondrial so it translates with table 2. Part of openvax/varcode#722. Claude-Session: https://claude.ai/code/session_01JHJhwfx4um52Nczrv3G814
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.
Part of openvax/varcode#722. Bumps to 0.52.0.
Why
Most T2T VCFs come from the T2T Consortium's
chm13v2.0_maskedY_rCRSanalysis set, which its README recommends for short-read variant calling. That set's chrM is the rCRS (NC_012920.1), not CHM13's own mitochondrion (CP068254.1), and Ensembl's rapid-release T2T annotation has no mitochondrial genes. So chrM variants from those files could not be annotated.The rCRS is GRCh38's MT (
J01415.2 = NC_012920.1in GRCh38's assembly report), so Ensembl GRCh38's MT annotation describes that chrM exactly.Change
t2t-chm13now includes Ensembl GRCh38 release 115's MT annotation: 37 genes, of which 13 are protein coding, 22 are tRNAs and 2 are rRNAs.Contig name. The genes are on a contig named
NC_012920.1. It can't be confused withMT, Ensembl's name for CHM13's own mitochondrion. CHM13's own begins at what the rCRS numbers 577, and both are 16,569 bp.Files. The three files (GTF, cDNA+ncRNA and protein FASTAs, 12 KB in all) are packaged in
orfdata/data/genomes/. They are pinned by SHA-256 under a newmitochondriaentry of the pin.PinnedGenome.mitochondriais generic, so another assembly's alternative mitochondrion would be a registry entry.Builder.
tools/build_rcrs_mitochondrion.pyrebuilds the files from the five Ensembl 115 source files, each pinned by SHA-256 and checked against Ensembl's CHECKSUMS. It checks:Opening the genome. The GTF that PyEnsembl indexes is the downloaded Ensembl GTF with the MT GTF's gzip stream appended; gzip readers read the two as one file. The packaged FASTAs are copied beside the index, so the genome still opens and unpickles after ORFdata is upgraded.
NC_012920.1is declared mitochondrial inreference_metadata, so its transcripts translate with table 2.Contig table.
contig_aliases("chm13v2.0_maskedY_rCRS")mapschrMtoNC_012920.1(GenBankJ01415.2). Files with CHM13's own mitochondrion keepchrM→MT, which stays unannotated.Reinstalling. Downloaded files are reused because the store digest is unchanged. The index digest changes, so the next
load_genomerebuilds the index once (about 1.1 GB). The CHANGELOG says the old index can be deleted.Validated on the real genome
I installed
t2t-chm13from Ensembl into a scratch cache: 3m37s, 236,688 transcripts.NC_012920.1, 13 of them protein coding, and noMTorchrMcontig.translation_table == 2,compartment == "mitochondrial", and the expected protein. The table survives pickling.22:21798486still lies in RIMBP3B and RIMBP3C.Proteome.build(genome)gives 104,970 reference proteins, the documented 104,957 plus the 13 MT proteins; the docs are updated.Tests
tests/test_genomes.py:tests/data/t2t/), offline: all 37 transcripts spell their cDNA, all 13 CDSs translate to their proteins with table 2 (and differently with table 1), and the gene count and names are as expected._rCRSnames' contig table maps chrM to NC_012920.1; no CHM13-own name lists it.NC_012920.1with table 2 after install, load and pickling. The FASTAs are copied beside the index, the merged GTF's size is checked, andforce=Truerebuilds.Verification
./lint.sh: passes.pytest tests -n 8: 1531 passed, 6 skipped.mkdocs build --strict: passes.https://claude.ai/code/session_01JHJhwfx4um52Nczrv3G814