Repository navigation
Keep GRCh37 chrM apart from the rCRS MT (0.50.0) - #202
Merged
Merged
Conversation
Under GRCh37, hg19's chrM (NC_001807, 16,571 bp) is not the rCRS that Ensembl names MT (16,569 bp), and its positions are offset from it. _contig now takes the build and, under GRCh37, keeps chrM/M distinct from MT/chrMT unless a known length is the rCRS's (Ensembl's chain files repeat the rCRS chain as chrM with that length). Every caller passes its build. Closes #200. Claude-Session: https://claude.ai/code/session_01JHJhwgzAgwTefwxNLB1ztR
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.
Closes #200. Bumps to 0.50.0, because GRCh37 contig matching changes.
Problem
orfdata.model._contigmappedMandchrMtoMTwhatever the build. Under GRCh37 these are different sequences:chrM: NC_001807, 16,571 bp.MT: the rCRS, NC_012920, 16,569 bp.Their positions are offset (hg19 chrM:12995 is rCRS MT:12994). So a GRCh37
chrMrecord could be bound to Ensembl MT transcripts, merged with an MT record, or lifted through the rCRS chain.Change
_contig(value, build, length=None):GRCh37,hg19,b37,NCBI37, with or without a.pNpatch suffix),chrM/MstayschrM, andMT/chrMTstaysMT.chrMwhose known length is the rCRS's, 16,569 bp, is read asMT.buildis required, so no caller can merge the two silently. Every caller passes the build it already has:_merge_key;RNAFeature.overlaps;chrM 16569. The header's contig size marks that copy as the rCRS, so it still coincides with theMTcopy, as the existing comment expects.chrM(16,571 bp) chain is used only forchrMqueries.chrMrecord with no chain of its own doesn't lift.chrM, should name itMT. The CHANGELOG says so.chrMapart fromMTin its own ORF matching.Verification
tests/test_grch37_mitochondrion.py: both tests fail onmainand pass here.MTandchrM 16569rCRS chains plus a synthetic hg19chrM 16571chain:MT:12995maps toMT:12995.chrM:12995maps toMT:12993, through the hg19 chain only.main, both queries are ambiguous and returnNone.chrMstill maps asMT.MT/chrMTqueries find only the rCRS record, andchrM/Monly the hg19 one.mainmerged them into one.GRCh37_to_GRCh38.chain.gzandGRCh38_to_GRCh37.chain.gz(pinned SHA-256s) contain exactlyMT 16569andchrM 16569mitochondrial chains../lint.shpasses, andmkdocs build --strictis clean._contig.https://claude.ai/code/session_01JHJhwgzAgwTefwxNLB1ztR