Genomic to protein projection#437
Conversation
Guard protein projection by checking the computed reference codon against the curated protein residue before translating alternate codons. Add selenocysteine, stop-gain, and unsupported multi-residue edge coverage for the genomic-to-cDNA-to-protein path.
Add an explicit VariantProjector.close() hook and call it from REST lifespan and projection test teardown. Cover shutdown with a unit test that verifies the loop thread starts, stops, closes, and tolerates repeated close calls.
Add an explicit Allele-only projection guard, keep internal AttributeError failures on the unexpected-error path, and cover transcript-to-protein registration through the REST API.
jsstevenson
left a comment
There was a problem hiding this comment.
some initial thoughts
There was a problem hiding this comment.
I'm getting weird github server errors trying to leave a review but
- add env var to .env config
- add a blurb to features.rst about auto-add of projection stuff during registration
- I think the
UTA_DB_URLcheck already happens inCoolSeqToolinitialization so doesn't need to be handled by AnyVar
| # the longest compatible remaining transcript when MANE is unavailable | ||
| # or incompatible. | ||
| result = self._run_async_projection( | ||
| self.cst.mane_transcript.grch38_to_mane_c_p( |
There was a problem hiding this comment.
It looks like this function is GRCh38-specific. What happens if someone registers a GRCh37 variant?
There was a problem hiding this comment.
I'm thinking through this. I think we don't want to have two paths of lifting over GRCh37 variants in our application. Our REST API layer can/does already do liftover for GRCh37 inputs. So I think we should use that lifted over GRCh38 version for the input to the projector, and make the VariantProjector class require genomic inputs to be GRCh38. At least for now.
There was a problem hiding this comment.
Revised my above thoughts. We'll support GRCh37 inputs to VariantProjector and let cool-seq-tool attempt to project forward to GRCh38 in order to try to get to a MANE transcript, even if AnyVar's logic around the unambiguous round-trippability decided not to persist a GRCh38 form.
…mane_transcript.g_to_grch38
…ool-seq-tool 0.17.x. Remove UTA_DB_URL passthrough as it's no longer supported in cool-seq-tool anyways. Add feature doc section about variant projection across molecule types. Add ANYVAR_ENABLE_PROJECTION to env.example with comments.
Resolve conflicts from #480, which moved bulk-registration logic from variations_router.py into the shared translate/register.py module. - anyvar.py: keep both sides (projection helpers + main's queueing/error additions) - variations_router.py: drop locally-defined registration funcs, import them from translate.register; keep `import os` - translate/register.py: port the projection hook and add_projection_mappings onto main's relocated register_variations (also covers the Celery async path)
jennifer-bowser
left a comment
There was a problem hiding this comment.
Looks really good, just one last minor change and then I think this is good to go!
Touch #146
This PR adds:
PUT /variationPUT /variation