def test_mendelian_from_ivan_2(): # AC AA AC mendel assert FV.check_mendelian_trio(np.array([0, 1]), np.array([0, 0]), np.array([0, 1]), 0) assert FV.check_mendelian_trio(np.array([0, 1]), np.array([0, 0]), np.array([0, 1]), 1)
def test_weird_mendel_from_ivan_4(): # AC AT CT mendel assert not FV.check_mendelian_trio(np.array([0, 1]), np.array([0, 2]), np.array([1, 2]), 0) assert FV.check_mendelian_trio(np.array([0, 1]), np.array([0, 2]), np.array([1, 2]), 1) assert FV.check_mendelian_trio(np.array([0, 1]), np.array([0, 2]), np.array([1, 2]), 2)
def test_omission_not_denovo(): # AA,CC -> AA trio = [ np.array([0, 0]), # p1 np.array([1, 1]), # p2 np.array([0, 0]), # ch ] assert FV.check_omission_trio(*trio, allele_index=1) assert not FV.check_denovo_trio(*trio, allele_index=1) assert not FV.check_mendelian_trio(*trio, allele_index=1) # FIXME: assert not FV.check_omission_trio(*trio, allele_index=0) assert not FV.check_denovo_trio(*trio, allele_index=0) assert FV.check_mendelian_trio(*trio, allele_index=0)
def test_mixed_check_4(): # AA,CC -> AG trio = [ np.array([1, 1]), # p1 np.array([0, 0]), # p2 np.array([0, 2]), # ch ] assert not FV.check_denovo_trio(*trio, allele_index=0) assert not FV.check_denovo_trio(*trio, allele_index=1) assert FV.check_denovo_trio(*trio, allele_index=2) assert not FV.check_omission_trio(*trio, allele_index=0) assert FV.check_omission_trio(*trio, allele_index=1) assert not FV.check_omission_trio(*trio, allele_index=2) assert FV.check_mendelian_trio(*trio, allele_index=0) assert not FV.check_mendelian_trio(*trio, allele_index=1) assert not FV.check_mendelian_trio(*trio, allele_index=2)
def test_mixed_check_1(): # AA,CC -> GG trio = [ np.array([1, 1]), np.array([0, 0]), np.array([2, 2]), ] assert not FV.check_denovo_trio(*trio, allele_index=0) assert not FV.check_denovo_trio(*trio, allele_index=1) assert FV.check_denovo_trio(*trio, allele_index=2) assert FV.check_omission_trio(*trio, allele_index=0) assert FV.check_omission_trio(*trio, allele_index=1) assert not FV.check_omission_trio(*trio, allele_index=2) assert not FV.check_mendelian_trio(*trio, allele_index=0) assert not FV.check_mendelian_trio(*trio, allele_index=1) assert not FV.check_mendelian_trio(*trio, allele_index=2)
def test_mendelian_from_ivan_5(): # AC AC CC mendel assert FV.check_mendelian_trio(np.array([0, 1]), np.array([0, 1]), np.array([1, 1]), 1) assert not FV.check_mendelian_trio(np.array([0, 1]), np.array([0, 1]), np.array([1, 1]), 0)