Skip to content

update biotype and consequence enums ids #825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 28, 2024
Merged

Conversation

bpblanken
Copy link
Collaborator

@bpblanken bpblanken commented Jun 26, 2024

Plan is to merge and then run the following for 37 & 38 SNV_INDEL + MITO (since this enum is shared).

from v03_pipeline.lib.annotations.enums import (
    BIOTYPES,
    FIVEUTR_CONSEQUENCES,
    LOF_FILTERS,
    TRANSCRIPT_CONSEQUENCE_TERMS,
)
BIOTYPE_LOOKUP = hl.dict(hl.enumerate(BIOTYPES, index_first=False))
TRANSCRIPT_CONSEQUENCE_TERMS_LOOKUP = hl.dict(
    hl.enumerate(TRANSCRIPT_CONSEQUENCE_TERMS, index_first=False),
)

BIOTYPE_REVERSE_LOOKUP = hl.dict(hl.enumerate(ht.enums.sorted_transcript_consequences.biotype, index_first=True))
TRANSCRIPT_CONSEQUENCE_TERMS_REVERSE_LOOKUP = hl.dict(hl.enumerate(ht.enums.sorted_transcript_consequences.consequence_term, index_first=True))

ht = ht.annotate(
    sorted_transcript_consequences = ht.sorted_transcript_consequences.map(
        lambda c: c.annotate(
            biotype_id=BIOTYPE_LOOKUP[BIOTYPE_REVERSE_LOOKUP[c.biotype_id]], 
            consequence_terms_ids=c.consequence_term_ids.map(lambda t: TRANSCRIPT_CONSEQUENCE_TERMS_LOOKUP[TRANSCRIPT_CONSEQUENCE_TERMS_REVERSE_LOOKUP[t]])
        )
    )
)

ht = ht.annotate_globals(
    enums=ht.enums.annotate(
        sorted_transcript_consequences=ht.sorted_transcript_consequences.annotate(
            biotype=BIOTYPES,
            consequence_term=TRANSCRIPT_CONSEQUENCE_TERMS,
        )
    )
)

@bpblanken bpblanken marked this pull request as ready for review June 26, 2024 19:22
@bpblanken bpblanken requested a review from a team as a code owner June 26, 2024 19:22
@bpblanken bpblanken changed the title update ids update biotype and consequence enums ids Jun 26, 2024
@bpblanken bpblanken merged commit 4e7a634 into dev Jun 28, 2024
3 checks passed
@bpblanken bpblanken deleted the benb/remove_unused_enums branch June 28, 2024 16:18
bpblanken added a commit that referenced this pull request Jul 1, 2024
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.

3 participants