Example #1
0
 def test_impute_with_unphased_pedigree_wild_ibd_control(self):
     command = [
         "-c",
         "--start",
         "0",
         "--end",
         f"{self.subsample_snp}",
         "--ibd",
         f"{tests_root}/test_data/[email protected]",
         "--bed",
         f"{tests_root}/test_data/sample_reduced@",
         "--chr_range",
         "1-2",
         "--pedigree",
         f"{tests_root}/test_data/sample.ped",
         "--threads",
         "2",
         "--out",
         f"{output_root}/test_impute_with_unphased_pedigree_control@",
     ]
     if not self.log:
         command = ["-silent_progress"] + command
     args = impute.parser.parse_args(command)
     impute.main(args)
     coef, z, p_value = imputation_test(
         [1],
         imputed_prefix=
         f"{output_root}/test_impute_with_unphased_pedigree_control",
         expected_prefix=f"{tests_root}/test_data/sample",
         start=0,
         end=self.subsample_snp,
     )
     self.assertGreaterEqual(p_value[0], self.p_value_threshold)
     self.assertGreaterEqual(p_value[1], self.p_value_threshold)
Example #2
0
 def test_impute_with_unphased_pedigree_control_backup(self):
     command = [
         "-c",
         "--start",
         "0",
         "--end",
         f"{self.subsample_snp}",
         "--ibd",
         f"{tests_root}/test_data/sample.empty",
         "--bed",
         f"{tests_root}/test_data/sample_reduced@",
         "--chr_range",
         "1-2",
         "--pedigree",
         f"{tests_root}/test_data/sample.ped",
         "--threads",
         "2",
         "--out",
         f"{output_root}/test_impute_with_unphased_pedigree_control_backup@",
     ]
     if not self.log:
         command = ["-silent_progress"] + command
     args = impute.parser.parse_args(command)
     impute.main(args)
     coef, z, p_value = imputation_test(
         [1],
         imputed_prefix=
         f"{output_root}/test_impute_with_unphased_pedigree_control_backup",
         expected_prefix=f"{tests_root}/test_data/sample",
         start=0,
         end=self.subsample_snp,
     )
Example #3
0
 def test_impute_with_unphased_king(self):
     command = [
         "--start",
         "0",
         "--end",
         f"{self.subsample_snp}",
         "--ibd",
         f"{tests_root}/test_data/sample.our",
         "--bed",
         f"{tests_root}/test_data/sample_reduced@",
         "--chr_range",
         "1-2",
         "--king",
         f"{tests_root}/test_data/sample.king",
         "--agesex",
         f"{tests_root}/test_data/sample.agesex",
         "--threads",
         "2",
         "--out",
         f"{output_root}/test_impute_with_unphased_king@",
     ]
     if not self.log:
         command = ["-silent_progress"] + command
     args = impute.parser.parse_args(command)
     impute.main(args)
Example #4
0
 def test_impute_with_unphased_king_control_pca(self):
     command = [
         "-c",
         "--start",
         "0",
         "--end",
         f"{self.subsample_snp}",
         "--ibd",
         f"{tests_root}/test_data/sample.our",
         "--bed",
         f"{tests_root}/test_data/sample@",
         "--chr_range",
         "1-2",
         "--king",
         f"{tests_root}/test_data/sample.king",
         "--agesex",
         f"{tests_root}/test_data/sample.agesex",
         "--pcs",
         f"{tests_root}/test_data/sample1_2_pca.eigenvec",
         "--pc_num",
         "8",
         "-find_optimal_pc",
         "--threads",
         "2",
         "--out",
         f"{output_root}/test_impute_with_unphased_king_control@",
     ]
     if not self.log:
         command = ["-silent_progress"] + command
     args = impute.parser.parse_args(command)
     impute.main(args)
     coef, z, p_value = imputation_test(
         [1, 2],
         imputed_prefix=
         f"{output_root}/test_impute_with_unphased_king_control",
         expected_prefix=f"{tests_root}/test_data/sample",
         start=0,
         end=self.subsample_snp,
     )
     #TODO use pvals
     print(coef)
     self.assertAlmostEqual(coef[0], 1., delta=0.02)
     self.assertAlmostEqual(coef[1], 1., delta=0.02)