def test_predict_deleterious_probability_vcf(self):
     #init
     self.init_test('predict_deleterious_probability_vcf')
     test_file = os.path.join(self.data_dir, 'test_test_combivep.vcf')
     output_file  = os.path.join(self.working_dir, 'vcf_output.txt')
     #run test
     predict_deleterious_probability(test_file,
                                     params_file=combivep_settings.COMBIVEP_CENTRAL_TEST_PARAMETER_FILE,
                                     file_type=combivep_settings.FILE_TYPE_VCF,
                                     config_file=combivep_settings.COMBIVEP_CENTRAL_TEST_CONFIGURATION_FILE,
                                     output_file=output_file,
                                     )
     self.assertTrue(os.path.exists(output_file), msg='Predictor does not functional properly')
     f = open(output_file, 'r')
     self.assertEqual(f.readline().strip(), '#CHROM\tPOS\tREF\tALT\tACTUAL_DELETERIOUS_EFFECT\tPREDICTED_DELETERIOUS_PROBABILITY')
     self.assertEqual(f.readline().strip(), '3\t361508\tC\tT\tNone\t0.024209\t0.0\t0\t0.950380\t0.000019\t-2.66\t0.0001')
     f.close()
    def test_predict_deleterious_probability_cbv(self):
        #init
#        self.individual_debug = True
        self.init_test('predict_deleterious_probability_cbv')
        test_file = os.path.join(self.data_dir, 'test_test_combivep.cbv')
        output_file  = os.path.join(self.working_dir, 'cbv_output.txt')
        #run test
        args = {}
        args["params_file"] = combivep_settings.COMBIVEP_CENTRAL_TEST_PARAMETER_FILE
        args["file_type"]   = combivep_settings.FILE_TYPE_CBV
        args["config_file"] = combivep_settings.COMBIVEP_CENTRAL_TEST_CONFIGURATION_FILE
        args["output_file"] = output_file
        predict_deleterious_probability(test_file,
                                        **args
                                        )
        self.assertTrue(os.path.exists(output_file), msg='Predictor does not functional properly')
        f = open(output_file, 'r')
        self.assertEqual(f.readline().strip(), '#CHROM\tPOS\tREF\tALT\tACTUAL_DELETERIOUS_EFFECT\tPREDICTED_DELETERIOUS_PROBABILITY')
        self.assertEqual(f.readline().strip(), '1\t35227264\tT\tC\t1\t0.968087\t0.96\t0.031\t1.000000\t0.838867\t4.45\t0.2605')
        f.close()
Exemple #3
0
 def test_predict_deleterious_probability_vcf(self):
     #init
     self.init_test('predict_deleterious_probability_vcf')
     test_file = os.path.join(self.data_dir,
                              'test_test_combivep.vcf')
     output_file = os.path.join(self.working_dir,
                                'vcf_output.txt')
     #run test
     kwargs = {}
     kwargs["params_file"] = cbv_const.CBV_SAMPLE_PARAM_FILE
     kwargs["file_type"]   = cbv_const.FILE_TYPE_VCF
     kwargs["cfg_file"]    = cbv_const.CBV_SAMPLE_CFG_FILE
     kwargs["output_file"] = output_file
     predict_deleterious_probability(test_file,
                                     **kwargs)
     self.assertTrue(os.path.exists(output_file),
                     msg='Predictor does not functional properly')
     f = open(output_file, 'r')
     self.assertEqual(f.readline().strip(),
                      "#"+"\t".join(cbv_const.PREDICTION_OUT_COLS_HEADER))
     self.assertEqual(f.readline().strip(),
                      '3\t361508\tC\tT\tNone\t0.0001\t0.024209\t0.0\t0\t0.950380\t0.000019\t-2.66')
     f.close()
Exemple #4
0
 def test_predict_deleterious_probability_cbv(self):
     #init
     self.init_test('predict_deleterious_probability_cbv')
     test_file = os.path.join(self.data_dir,
                              'test_test_combivep.cbv')
     output_file = os.path.join(self.working_dir,
                                'cbv_output.txt')
     #run test
     kwargs = {}
     kwargs["params_file"] = cbv_const.CBV_SAMPLE_PARAM_FILE
     kwargs["file_type"]   = cbv_const.FILE_TYPE_CBV
     kwargs["cfg_file"]    = cbv_const.CBV_SAMPLE_CFG_FILE
     kwargs["output_file"] = output_file
     predict_deleterious_probability(test_file,
                                     **kwargs)
     self.assertTrue(os.path.exists(output_file),
                     msg='Predictor does not functional properly')
     f = open(output_file, 'r')
     self.assertEqual(f.readline().strip(),
                      "#"+"\t".join(cbv_const.PREDICTION_OUT_COLS_HEADER))
     self.assertEqual(f.readline().strip(),
                      '1\t35227264\tT\tC\t1\t0.2605\t0.968087\t0.96\t0.031\t1.000000\t0.838867\t4.45')
     f.close()