def test_remove_triallelic(self):
     args = Args()
     args.haps = get_file('triallelic_haps.haps')
     args.output = get_file('output.haps')
     args.maf = 0.05
     args.missing = 0.80
     args.hwe = .05
     args.chi_square = True
     filter_haps_file(args)
     with open(args.output) as f:
         lines = sum(1 for line in f)
     assert lines == 1
     os.remove(args.output)
 def test_remove_triallelic(self):
     args = Args()
     args.haps = get_file('triallelic_haps.haps')
     args.output = get_file('output.haps')
     args.maf = 0.05
     args.missing = 0.80
     args.hwe = .05
     args.chi_square = True
     filter_haps_file(args)
     with open(args.output) as f:
         lines = sum(1 for line in f) 
     assert lines == 1
     os.remove(args.output)
 def test_filter_hap_file(self):
     args = Args()
     args.haps = get_file('filter.haps')
     args.output = get_file('output.haps')
     args.maf = 0.05
     args.missing = 0.05
     args.hwe = .05
     args.chi_square = True
     filter_haps_file(args)
     with open(args.output) as f:
         lines = sum(1 for line in f)
     assert lines == 1
     with open(args.output) as f:
         line = f.readline()
         line = line.split()
         assert line[0] == '2'
         assert line[1] == 'rs4662641'
         assert line[2] == '130000272'
     os.remove(args.output)
 def test_filter_hap_file(self):
     args = Args()
     args.haps = get_file('filter.haps')
     args.output = get_file('output.haps')
     args.maf = 0.05
     args.missing = 0.05
     args.hwe = .05
     args.chi_square = True
     filter_haps_file(args)
     with open(args.output) as f:
         lines = sum(1 for line in f)
     assert lines == 1
     with open(args.output) as f:
         line = f.readline()
         line = line.split()
         assert line[0] == '2'
         assert line[1] == 'rs4662641'
         assert line[2] == '130000272' 
     os.remove(args.output)