def test_nonspecific_refseq(self): # null matches anything assert match.compare_positional_variants( {'break1Start': {'pos': 1}, 'refSeq': 'T'}, {'break1Start': {'pos': 1}} ) assert match.compare_positional_variants( {'break1Start': {'pos': 1}}, {'break1Start': {'pos': 1}, 'refSeq': 'T'} )
def test_refseq_length_mismatch(self): assert not match.compare_positional_variants( {'break1Start': {'pos': 1}, 'refSeq': '??'}, {'break1Start': {'pos': 1}, 'refSeq': 'T'}, ) assert not match.compare_positional_variants( {'break1Start': {'pos': 1}, 'refSeq': '?'}, {'break1Start': {'pos': 1}, 'refSeq': 'TT'}, )
def test_nonspecific_altseq(self): assert match.compare_positional_variants( {'break1Start': {'pos': 1}}, {'break1Start': {'pos': 1}} ) # null matches anything assert match.compare_positional_variants( {'break1Start': {'pos': 1}, 'untemplatedSeq': 'T'}, {'break1Start': {'pos': 1}} ) assert match.compare_positional_variants( {'break1Start': {'pos': 1}}, {'break1Start': {'pos': 1}, 'untemplatedSeq': 'T'} )
def test_range_vs_sub(self): sub = { 'break1Repr': 'p.G776', 'break1Start': {'@Class': 'ProteinPosition', 'pos': 776, 'refAA': 'G'}, 'break2Repr': 'p.V777', 'break2Start': {'@Class': 'ProteinPosition', 'pos': 777, 'refAA': 'V'}, 'reference1': 'ERBB2', 'type': 'insertion', 'untemplatedSeq': 'YVMA', 'untemplatedSeqSize': 4, } range_variant = { 'break1Repr': 'p.G776', 'break1Start': {'@Class': 'ProteinPosition', 'pos': 776, 'refAA': 'G'}, 'break2Repr': 'p.?776', 'break2Start': None, 'refSeq': 'G', 'untemplatedSeq': 'VV', } assert not match.compare_positional_variants(sub, range_variant) assert not match.compare_positional_variants(range_variant, sub)
def test_same_refseq_matches(self): assert match.compare_positional_variants( {'break1Start': {'pos': 1}, 'refSeq': 'R'}, {'break1Start': {'pos': 1}, 'refSeq': 'R'}, )
def test_diff_refseq(self): assert not match.compare_positional_variants( {'break1Start': {'pos': 1}, 'refSeq': 'M'}, {'break1Start': {'pos': 1}, 'refSeq': 'R'}, )
def test_same_altseq_matches(self): assert match.compare_positional_variants( {'break1Start': {'pos': 1}, 'untemplatedSeq': 'R'}, {'break1Start': {'pos': 1}, 'untemplatedSeq': 'R'}, )
def test_diff_altseq(self): assert not match.compare_positional_variants( {'break1Start': {'pos': 1}, 'untemplatedSeq': 'M'}, {'break1Start': {'pos': 1}, 'untemplatedSeq': 'R'}, )
def test_ambiguous_refseq(self, seq1, seq2): # ambiguous AA matches anything the same length assert match.compare_positional_variants( {'break1Start': {'pos': 1}, 'refSeq': seq1}, {'break1Start': {'pos': 1}, 'refSeq': seq2}, )