def test_get_consequence_last_base(self): '''check get_consequence() works with last base of exon changes ''' chrom, pos = '1', 1000 alts = ('C', ) info = Info('CQ=missense_variant;HGNC=TEST') info.set_genes_and_consequence(chrom, pos, alts, []) # Now check that if the variant is at a position where it is a final # base in an exon with a conserved base, the consequence gets converted. info.last_base = set([("1", 1000)]) self.assertEqual(info.get_consequences(chrom, pos, alts, []), [["conserved_exon_terminus_variant"]]) # If we have a variant in multiple genes, check that it only alters the # missense/splice_region variants, and doesn't alter synonymous variants # (since these will be in transcripts where the variant is distant from # an exon boundary.) info = Info('CQ=missense_variant|synonymous_variant;HGNC=TEST|TEST1') info.set_genes_and_consequence(chrom, pos, alts, []) info.last_base = set([("1", 1000)]) self.assertEqual( info.get_consequences(chrom, pos, alts, []), [["conserved_exon_terminus_variant", "synonymous_variant"]])
def test_get_consequence(self): """ test that get_consequence works correctly """ chrom, pos = '1', 1000 info = Info('CQ=missense_variant;HGNC=TEST') alts = ('C', ) # check that in the absence of any known conserved final exon positions, # the consequence is unchanged. self.assertEqual(info.get_consequences(chrom, pos, alts, []), [['missense_variant']]) info = Info('CQ=missense_variant|stop_gained;HGNC=TEST|TEST2') self.assertEqual(info.get_consequences(chrom, pos, alts, []), [['missense_variant', 'stop_gained']])
def test_get_consequence(self): """ test that get_consequence works correctly """ chrom, pos = '1', 1000 info = Info('CQ=missense_variant;HGNC=TEST') alts = ('C',) # check that in the absence of any known conserved final exon positions, # the consequence is unchanged. self.assertEqual(info.get_consequences(chrom, pos, alts, []), [['missense_variant']]) info = Info('CQ=missense_variant|stop_gained;HGNC=TEST|TEST2') self.assertEqual(info.get_consequences(chrom, pos, alts, []), [['missense_variant', 'stop_gained']])
def test_get_consequence_multiallelic(self): ''' test that get_consequence works correctly with multiple alleles ''' chrom, pos = '1', 1000 info = Info('CQ=missense_variant,synonymous_variant') alts = ('C', 'G') self.assertEqual(info.get_consequences(chrom, pos, alts, []), [['missense_variant'], ['synonymous_variant']])
def test_get_consequence_multiallelic_with_masked(self): ''' test that get_consequence works correctly with multiple alleles ''' chrom, pos = '1', 1000 info = Info('CQ=missense_variant,synonymous_variant') alts = ('C', 'G') self.assertEqual(info.get_consequences(chrom, pos, alts, ['G']), [['missense_variant']])
def test_get_consequence_last_base(self): '''check get_consequence() works with last base of exon changes ''' chrom, pos = '1', 1000 alts = ('C',) info = Info('CQ=missense_variant;HGNC=TEST') info.set_genes_and_consequence(chrom, pos, alts, []) # Now check that if the variant is at a position where it is a final # base in an exon with a conserved base, the consequence gets converted. info.last_base = set([("1", 1000)]) self.assertEqual(info.get_consequences(chrom, pos, alts, []), [["conserved_exon_terminus_variant"]]) # If we have a variant in multiple genes, check that it only alters the # missense/splice_region variants, and doesn't alter synonymous variants # (since these will be in transcripts where the variant is distant from # an exon boundary.) info = Info('CQ=missense_variant|synonymous_variant;HGNC=TEST|TEST1') info.set_genes_and_consequence(chrom, pos, alts, []) info.last_base = set([("1", 1000)]) self.assertEqual(info.get_consequences(chrom, pos, alts, []), [["conserved_exon_terminus_variant", "synonymous_variant"]])