def test_add_tag_values_missingGTTags(self): tag = summarize_caller._HCGenotypeTag() sample_tag_values = {"SA": {"JQ_foo_XX": "0/1"}} record = VcfRecord("CHROM", "POS", "REF", "ALT", sample_tag_values=sample_tag_values) tag.add_tag_values(record) self.assertEquals(".", record.sample_tag_values["SA"][HCGenotypeTagTestCase._TAG_ID])
def test_prioritize_genotype(self): tag = summarize_caller._HCGenotypeTag() self.assertEquals("0/1", tag._prioritize_genotype(["0/1"])) self.assertEquals("0/1", tag._prioritize_genotype(["0/0", "0/1"])) self.assertEquals("1/1", tag._prioritize_genotype(["0/0", "1/1"])) self.assertEquals("1/1", tag._prioritize_genotype(["1/1", "1/1", "0/1"])) self.assertEquals("0/1", tag._prioritize_genotype(["1/1", "0/1", "0/1"])) self.assertEquals("0/1", tag._prioritize_genotype(["0/1", "0/2"]))
def test_metaheader(self): self.assertEquals('##FORMAT=<ID={}HC_GT,Number=1,Type=String,Description="High confidence consensus genotype (inferred from JQ_*_GT and JQ_*_CALLER_PASSED). Majority rules; ties go to the least unusual variant (0/1>0/2>1/1). Variants which failed their filter are ignored.">'.format(summarize_caller.JQ_SUMMARY_TAG), summarize_caller._HCGenotypeTag().metaheader)