<s> from genmod . annotate_models . models import check_X_recessive <EOL> from genmod . vcf_tools import Genotype <EOL> from ped_parser import FamilyParser <EOL> FAMILY_FILE = "<STR_LIT>" <EOL> def get_family ( family_file = None , family_lines = None ) : <EOL> """<STR_LIT>""" <EOL> family = None <EOL> if family_file : <EOL> family = FamilyParser ( open ( family_file , '<STR_LIT:r>' ) ) <EOL> elif family_lines : <EOL> family = FamilyParser ( family_lines ) <EOL> return family <EOL> def test_x_affected_recessive_male ( ) : <EOL> """<STR_LIT>""" <EOL> family_lines = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] <EOL> family = get_family ( family_lines = family_lines ) <EOL> recessive_variant = { '<STR_LIT>' : { } } <EOL> recessive_variant [ '<STR_LIT>' ] [ '<STR_LIT>' ] = Genotype ( ** { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> assert check_X_recessive ( <EOL> variant = recessive_variant , <EOL> family = family <EOL> ) == True <EOL> def test_x_affected_recessive_female ( ) : <EOL> """<STR_LIT>""" <EOL> family_lines = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] <EOL> family = get_family ( family_lines = family_lines ) <EOL> recessive_variant = { '<STR_LIT>' : { } } <EOL> recessive_variant [ '<STR_LIT>' ] [ '<STR_LIT>' ] = Genotype ( ** { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> assert check_X_recessive ( <EOL> variant = recessive_variant , <EOL> family = family <EOL> ) == False <EOL> def test_x_affected_homozygote_male ( ) : <EOL> """<STR_LIT>""" <EOL> family_lines = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] <EOL> family = get_family ( family_lines = family_lines ) <EOL> homozygote_variant = { '<STR_LIT>' : { } } <EOL> homozygote_variant [ '<STR_LIT>' ] [ '<STR_LIT>' ] = Genotype ( ** { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> assert check_X_recessive ( <EOL> variant = homozygote_variant , <EOL> family = family <EOL> ) == True <EOL> def test_x_affected_homozygote_female ( ) : <EOL> """<STR_LIT>""" <EOL> family_lines = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] <EOL> family = get_family ( family_lines = family_lines ) <EOL> homozygote_variant = { '<STR_LIT>' : { } } <EOL> homozygote_variant [ '<STR_LIT>' ] [ '<STR_LIT>' ] = Genotype ( ** { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> assert check_X_recessive ( <EOL> variant = homozygote_variant , <EOL> family = family <EOL> ) == True <EOL> def test_x_affected_male_ref_call ( ) : <EOL> """<STR_LIT>""" <EOL> family_lines = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] <EOL> family = get_family ( family_lines = family_lines ) <EOL> homozygote_variant = { '<STR_LIT>' : { } } <EOL> homozygote_variant [ '<STR_LIT>' ] [ '<STR_LIT>' ] = Genotype ( ** { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> assert check_X_recessive ( <EOL> variant = homozygote_variant , <EOL> family = family <EOL> ) == False <EOL> def test_x_affected_female_ref_call ( ) : <EOL> """<STR_LIT>""" <EOL> family_lines = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] <EOL> family = get_family ( family_lines = family_lines ) <EOL> homozygote_variant = { '<STR_LIT>' : { } } <EOL> homozygote_variant [ '<STR_LIT>' ] [ '<STR_LIT>' ] = Genotype ( ** { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> assert check_X_recessive ( <EOL> variant = homozygote_variant , <EOL> family = family <EOL> ) == False <EOL> def test_x_affected_no_call_male ( ) : <EOL> """<STR_LIT>""" <EOL> family_lines = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] <EOL> family = get_family ( family_lines = family_lines ) <EOL> no_call_variant = { '<STR_LIT>' : { } } <EOL> no_call_variant [ '<STR_LIT>' ] [ '<STR_LIT>' ] = Genotype ( ** { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> assert check_X_recessive ( <EOL> variant = no_call_variant , <EOL> family = family <EOL> ) == True <EOL> def test_x_affected_no_call_male_strict ( ) : <EOL> """<STR_LIT>""" <EOL> family_lines = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] <EOL> family = get_family ( family_lines = family_lines ) <EOL> no_call_variant = { '<STR_LIT>' : { } } <EOL> no_call_variant [ '<STR_LIT>' ] [ '<STR_LIT>' ] = Genotype ( ** { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> assert check_X_recessive ( <EOL> variant = no_call_variant , <EOL> family = family , <EOL> strict = True <EOL> ) == False <EOL> def test_x_healthy_recessive_male ( ) : <EOL> """<STR_LIT>""" <EOL> family_lines = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] <EOL> family = get_family ( family_lines = family_lines ) <EOL> recessive_variant = { '<STR_LIT>' : { } } <EOL> recessive_variant [ '<STR_LIT>' ] [ '<STR_LIT>' ] = Genotype ( ** { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> assert check_X_recessive ( <EOL> variant = recessive_variant , <EOL> family = family <EOL> ) == False <EOL> def test_x_healthy_recessive_female ( ) : <EOL> """<STR_LIT>""" <EOL> family_lines = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] <EOL> family = get_family ( family_lines = family_lines ) <EOL> recessive_variant = { '<STR_LIT>' : { } } <EOL> recessive_variant [ '<STR_LIT>' ] [ '<STR_LIT>' ] = Genotype ( ** { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> assert check_X_recessive ( <EOL> variant = recessive_variant , <EOL> family = family <EOL> ) == True </s>
