Initial commit

This commit is contained in:
2025-11-28 11:52:04 +08:00
commit f74dc351f7
51 changed files with 2402 additions and 0 deletions

41
tests/test_acmg.py Normal file
View File

@@ -0,0 +1,41 @@
from genomic_consultant.acmg.tagger import ACMGConfig, tag_variant
from genomic_consultant.utils.models import Variant
def test_ba1_trumps():
cfg = ACMGConfig(ba1_af=0.05, bs1_af=0.01, pm2_af=0.0005, lof_genes=set())
v = Variant(chrom="1", pos=1, ref="A", alt="T", allele_frequency=0.2)
result = tag_variant(v, cfg)
assert result.suggested_class == "Benign"
assert any(e.tag == "BA1" for e in result.evidence)
def test_pvs1_pm2_likely_pathogenic():
cfg = ACMGConfig(lof_genes={"GENE1"}, pm2_af=0.0005, ba1_af=0.05, bs1_af=0.01)
v = Variant(
chrom="1",
pos=1,
ref="A",
alt="T",
gene="GENE1",
consequence="stop_gained",
allele_frequency=0.0001,
)
result = tag_variant(v, cfg)
assert result.suggested_class == "Likely pathogenic"
tags = {e.tag for e in result.evidence}
assert {"PVS1", "PM2"} <= tags
def test_bp7_supporting():
cfg = ACMGConfig(bp7_splice_ai_max=0.1)
v = Variant(
chrom="1",
pos=1,
ref="A",
alt="T",
consequence="synonymous_variant",
annotations={"splice_ai_delta_score": 0.05},
)
result = tag_variant(v, cfg)
assert any(e.tag == "BP7" for e in result.evidence)