mecfs_bio.build_system.task.ppp_database.allele_key
Order-agnostic allele key, shared across the PPP-database tasks for allele-aware variant matching (so a swapped effect/non-effect orientation still matches).
The key is valid only for SNVs. Mirrored indels such as T/TCA and TCA/T are distinct variants, yet they sort to the same {A, B} key and would collide. Callers that key on it must guarantee SNV-only input.
Functions:
-
assert_all_snv–Fail fast if any allele in the named columns is not a single base.
-
unordered_allele_key–Sort the two allele columns and join them, so {A, B} == {B, A}.
assert_all_snv
Fail fast if any allele in the named columns is not a single base.
Source code in mecfs_bio/build_system/task/ppp_database/allele_key.py
unordered_allele_key
Sort the two allele columns and join them, so {A, B} == {B, A}.
Valid only for SNVs: mirrored indels (T/TCA vs TCA/T) sort to the same key though they are distinct variants. Guard callers with assert_all_snv.