def test_get_strands_lumpy(lumpy, bnd): bnd[0]["id"] = "_1" p = vcf_sv_parser.SV_vcf(lumpy, caller="lumpy") mate1, mate2 = p._get_mates(bnd) strand1, strand2 = p._get_strands(mate1, mate2) assert strand1 == "+" assert strand2 == "-"
def test_filter_low_qual_calls_lumpy_filtered(lumpy): p = vcf_sv_parser.SV_vcf(lumpy, caller="lumpy") records = p._parse_vcf() record = [list(next(p._group_bnds(records)))] record[0][0]["filter"] = "LOW_QUAL" filt_records = list(p._filter_low_qual_calls(record)) assert filt_records == []
def test_filter_low_qual_calls_non_svaba_filtered(svaba): p = vcf_sv_parser.SV_vcf(svaba, caller="svaba") records = p._parse_vcf() record = [list(next(p._group_bnds(records)))] record[0][0]["filter"] = "LOW_QUAL" record[0][1]["filter"] = "LOW_QUAL" filt_records = list(p._filter_low_qual_calls(record)) assert filt_records == []
def test_get_strands_lumpy_unmatched(lumpy, bnd): bnd[0]["id"] = "_1" bnd[0]["STRANDS"] = bnd[1]["STRANDS"] p = vcf_sv_parser.SV_vcf(lumpy, caller="lumpy") mate1, mate2 = p._get_mates(bnd) assert _raises_correct_error(p._get_strands, mate1, mate2, expected_error=AssertionError)
def test_filter_low_qual_calls_svaba_unfiltered(svaba): p = vcf_sv_parser.SV_vcf(svaba, caller="svaba") records = p._parse_vcf() record = [list(next(p._group_bnds(records)))] filt_records = list(p._filter_low_qual_calls(record)) assert record[0][0] == filt_records[0][0]
def test_filter_low_qual_calls_lumpy_unfiltered(lumpy): p = vcf_sv_parser.SV_vcf(lumpy, caller="lumpy") records = p._parse_vcf() record = [list(next(p._group_bnds(records)))] filt_records = list(p._filter_low_qual_calls(record)) assert record[0][0] == filt_records[0][0]
def test_get_mates_reversed_svaba(svaba, bnd): bnd[0]["id"] = ":2" matched = vcf_sv_parser.SV_vcf(svaba, caller="svaba")._get_mates(bnd) assert bnd[0] == matched[1] assert bnd[1] == matched[0]
def test_get_mates_reversed_gridss(gridss, bnd): bnd[0]["id"] = "_2" matched = vcf_sv_parser.SV_vcf(gridss, caller="gridss")._get_mates(bnd) assert bnd[0] == matched[1] assert bnd[1] == matched[0]
def test_get_mates_reversed_lumpy(lumpy, bnd): bnd[0]["id"] = "_2" matched = vcf_sv_parser.SV_vcf(lumpy, caller="lumpy")._get_mates(bnd) assert bnd[0] == matched[1] assert bnd[1] == matched[0]
def test_bnd_matched(lumpy, bnd): matched = next( vcf_sv_parser.SV_vcf(lumpy, caller="lumpy")._group_bnds(bnd)) assert isinstance(matched, tuple)