def test_should_filter_variant_when_all_reads_have_quality_below_threshold( self): svc = SVCDriver(self) threshold = 50 svc.with_var_filters("MQ") svc.with_min_root_mean_square_mapping_q(threshold) svc.with_read_mapping_filter_q(0) svc\ .with_ref_sequence( "AAAGCGTACAACCGGGTTAGTCACAAACCCGTTACGTATGCATG")\ .with_read( "................G...........................", n_fwd=10, n_rev=10, mapping_quality=threshold - 1) expect = svc.call() vcf_expectation = expect.with_output_vcf() vcf_expectation.record_count(1) vcf_expectation\ .has_record_for_variant(Variant(DEFAULT_CHROM, 16, "T", "G"))\ .with_filters({"MQ"})
def test_should_take_max_mq_over_all_the_samples_which_support_the_variant( self): svc = SVCDriver(self) threshold = 50 svc.with_var_filters("MQ") svc.with_min_root_mean_square_mapping_q(threshold) svc.with_read_mapping_filter_q(0) svc\ .with_ref_sequence( # 1234567890123456789 "AAAGCGTACAACCGGGTTAGTCACAAACCCGTTACGTATGCATG")\ .with_read( "................G......................... ", n_fwd=10, n_rev=10, mapping_quality=threshold - 1, sample_name="Ugly")\ .with_read( "................G...........................", n_fwd=10, n_rev=10, mapping_quality=threshold, sample_name="Good") expect = svc.call() vcf_expectation = expect.with_output_vcf() vcf_expectation.record_count(1) vcf_expectation\ .has_record_for_variant(Variant(DEFAULT_CHROM, 16, "T", "G"))\ .with_no_filters()