Exemplo n.º 1
0
def matched_variants() -> List[Tuple[Variant, Dict[str, str]]]:
    return [
        # snp
        (
            Variant("22", 29083907, 29083907, "G", "A", id="VCV000422506.2"),
            {
                "symbol": "CHEK2",
                "hgvs_c": "NM_007194.4:c.1610C>T"
            },
        ),
        # deletion
        (
            Variant("22", 50967717, 50967719, "AGG", "A", id="VCV000223079.1"),
            {
                "symbol": "TYMP",
                "hgvs_c": "NM_001953.4:c.263_264del"
            },
        ),
        # indel
        (
            Variant("22", 51065766, 51065767, "GA", "AG", id="VCV000003062.1"),
            {
                "symbol": "ARSA",
                "hgvs_c": "NM_001085428.2:c.34_35delTCinsCT"
            },
        ),
    ]
Exemplo n.º 2
0
def test_variant_is_deletion(
    snp: Variant, insertion: Variant, deletion: Variant, sv: Variant
):
    assert not snp.is_deletion()
    assert not insertion.is_deletion()
    assert deletion.is_deletion()
    assert not sv.is_deletion()
Exemplo n.º 3
0
def test_warn_ref_mismatch(clinvar_tabix, caplog):
    # wrong ref should still match the clinvar but with a warning
    cols = clinvar_tabix.header[0][len("#"):].split("\t")
    v_wrong_ref = Variant("22", 29083907, 29083907, "C", "A")
    record = CharGer._match_clinvar_one_variant(v_wrong_ref, clinvar_tabix,
                                                cols)
    assert record is not None
    assert ("got a clinvar match but their reference alleles are different"
            in caplog.text)
Exemplo n.º 4
0
def not_found_variants() -> List[Variant]:
    return [
        Variant("22", 29083907, 29083907, "G", "T"),
        Variant("22", 50967718, 50967719, "GG", "G"),
        Variant("22", 51065766, 51065767, "GA", "C"),
    ]
Exemplo n.º 5
0
def grch38_vep95_annotated_variants_info_fixed(test_root: Path) -> List[Variant]:
    return list(
        Variant.read_and_parse_vcf(
            test_root.joinpath("examples/grch38_vep95_50_variants.info_fixed.vcf.gz")
        )
    )
Exemplo n.º 6
0
def grch37_vep85_annotated_variants(test_root: Path):
    return list(
        Variant.read_and_parse_vcf(
            test_root / "examples" / "grch37_vep85_5_variants.vcf"
        )
    )
Exemplo n.º 7
0
def sv() -> Variant:
    return Variant("1", 2827693, 2827701, "CCCCTCGCA", "C", info={"SVTYPE": "DEL"})
Exemplo n.º 8
0
def deletion() -> Variant:
    return Variant("1", 42, 44, "ATA", "A")
Exemplo n.º 9
0
def insertion() -> Variant:
    return Variant("1", 42, 42, "A", "ATAT")
Exemplo n.º 10
0
def snp() -> Variant:
    return Variant("1", 42, 42, "A", "G")
Exemplo n.º 11
0
def test_read_vcf_detect_vep_version(
    test_root: Path, caplog, vcf_pth: Path, vep_ver: int
):
    reader = Variant.read_and_parse_vcf(test_root.joinpath(vcf_pth))
    next(reader)
    assert f"VEP version {vep_ver}" in caplog.text
Exemplo n.º 12
0
def charger_result(test_root: Path):
    variant = next(
        Variant.read_and_parse_vcf(test_root / "examples" /
                                   "grch37_vep85_5_variants.vcf"))
    return CharGerResult(variant)