PGx: full call detail (PGX-016..020, 027/028, 031), pgx coverage (PGX-009/035), full HGVS
- supporting_variants.tsv, unresolved_variants.tsv, variants_not_covered.tsv with PGX-026 metadata; per-allele supporting/unresolved sites for both alleles of every candidate; variant_change vs top, distant_alternative, unexplained_variants, alleles_impacted_by_no_call, alleles_tested. - simurg pgx coverage: callable / not_covered / masked / equivalent_to per allele and manifest. - HGVS on GRCh38 RefSeq accessions (NC_...:g.).
This commit is contained in:
1 parent
9d3242828e
commit
abea028818
10 files changed
+352
-40
No files matched your search
+17
-1
@@ -19,7 +19,23 @@ from typing import Any
|
||||
Fetch = Callable[[str, int, int], str]
|
||||
HGVS_RE = re.compile(r"^([gm])\.(\d+)(?:_(\d+))?(.*)$")
|
||||
REPEAT_RE = re.compile(r"^([ACGT]+)\((\d+)\)$")
|
||||
IUPAC_WILDCARD = set("RYSWKMBDHVN") # CPIC core-allele definitions: the position does not constrain the allele
|
||||
IUPAC_WILDCARD = set("RYSWKMBDHVN")
|
||||
# GRCh38 RefSeq chromosome accessions, for full HGVS (PGX-028 "NC_000022.11:g.42126611C>G")
|
||||
REFSEQ_GRCH38 = {"1": "NC_000001.11", "2": "NC_000002.12", "3": "NC_000003.12", "4": "NC_000004.12",
|
||||
"5": "NC_000005.10", "6": "NC_000006.12", "7": "NC_000007.14", "8": "NC_000008.11",
|
||||
"9": "NC_000009.12", "10": "NC_000010.11", "11": "NC_000011.10", "12": "NC_000012.12",
|
||||
"13": "NC_000013.11", "14": "NC_000014.9", "15": "NC_000015.10", "16": "NC_000016.10",
|
||||
"17": "NC_000017.11", "18": "NC_000018.10", "19": "NC_000019.10", "20": "NC_000020.11",
|
||||
"21": "NC_000021.9", "22": "NC_000022.11", "X": "NC_000023.11", "Y": "NC_000024.10",
|
||||
"M": "NC_012920.1", "MT": "NC_012920.1"} # fmt: skip
|
||||
|
||||
|
||||
def full_hgvs(chrom: str, hgvs: str) -> str:
|
||||
"""``g.…``/``m.…`` → ``NC_…:g.…`` on the GRCh38 chromosome accession (unchanged when unknown)."""
|
||||
acc = REFSEQ_GRCH38.get(chrom.removeprefix("chr"))
|
||||
return (
|
||||
f"{acc}:{hgvs.split(';')[0].strip()}" if acc and not hgvs.startswith("NC_") else hgvs
|
||||
) # CPIC core-allele definitions: the position does not constrain the allele
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
||||
Reference in new issue
Block a user