Exemplo n.º 1
0
 def load_config(self):
     Configure.load_config(self)
     self.__ucsc_reader = UcscReader()
     self.__ucsc_reader.read(self.config_values[combivep_settings.LATEST_UCSC_FILE_NAME])
     self.__ljb_reader = LjbReader()
     self.__ljb_reader.read(self.config_values[combivep_settings.LATEST_LJB_FILE_PREFIX] + '.txt.gz')
Exemplo n.º 2
0
 def __init__(self):
     Configure.__init__(self)
Exemplo n.º 3
0
 def __init__(self):
     LjbUpdater.__init__(self)
     Configure.__init__(self)
     self.chromosome_list = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', 'X', 'Y']
Exemplo n.º 4
0
 def __init__(self):
     UcscUpdater.__init__(self)
     Configure.__init__(self)
Exemplo n.º 5
0
class TestConfigure(SafeGeneralTester):


    def __init__(self, test_name):
        SafeGeneralTester.__init__(self, test_name)

    def setUp(self):
        self.test_class = 'configure'

    def init_configure_instance(self):
        self.__configure = Configure()

    def test_initial(self):
        #init
        self.individual_debug = True
        self.init_test('test_initial')
        self.init_configure_instance()
        output_file = os.path.join(self.working_dir, 'out_config.txt')
        self.__configure.config_file = output_file
        expected_out_file = os.path.join(self.data_dir, 'expected_update_initial_config_output.txt')
        #run test
        self.__configure.write_ljb_config('4.5', '/home/jessada/development/scilifelab/projects/CombiVEP/combivep/refdb/test/data/ljb_controller/dummy_dbNSFP_light1.4')
        self.assertTrue(filecmp.cmp(output_file, expected_out_file), "Configure cannot update LJB config correctly")

    def test_load(self):
        #init
        self.init_test('test_load')
        self.init_configure_instance()
        test_file = os.path.join(self.data_dir, 'test_load.txt')
        self.__configure.config_file = test_file
        #run test
        out = self.__configure.load_config()
        self.assertEqual(out[combivep_settings.LATEST_UCSC_DATABASE_VERSION], '7.5', "Configure cannot load configuration correctly")
        self.assertEqual(out[combivep_settings.LATEST_UCSC_FILE_NAME], 'ucsc_file7.5.txt', "Configure cannot load configuration correctly")
        self.assertEqual(out[combivep_settings.LATEST_LJB_DATABASE_VERSION], '4.4', "Configure cannot load configuration correctly")
        self.assertEqual(out[combivep_settings.LATEST_LJB_FILE_PREFIX], '/home/jessada/development/scilifelab/projects/CombiVEP/combivep/refdb/test/data/ljb_controller/dummy_dbNSFP_light1.3', "Configure cannot load configuration correctly")

    def test_update_ljb_config(self):
        #init
        self.init_test('test_update_ljb_config')
        self.init_configure_instance()
        test_file = os.path.join(self.data_dir, 'test_load.txt')
        output_file = os.path.join(self.working_dir, 'out_config.txt')
        self.copy_file(test_file, output_file)
        self.__configure.config_file = output_file
        expected_out_file = os.path.join(self.data_dir, 'expected_update_ljb_config_output.txt')
        #run test
        self.__configure.write_ljb_config('4.5', '/home/jessada/development/scilifelab/projects/CombiVEP/combivep/refdb/test/data/ljb_controller/dummy_dbNSFP_light1.4')
        self.assertTrue(filecmp.cmp(output_file, expected_out_file), "Configure cannot update LJB config correctly")

    def test_update_ucsc_config(self):
        #init
        self.init_test('test_update_ucsc_config')
        self.init_configure_instance()
        test_file = os.path.join(self.data_dir, 'test_load.txt')
        output_file = os.path.join(self.working_dir, 'out_config.txt')
        self.copy_file(test_file, output_file)
        self.__configure.config_file = output_file
        expected_out_file = os.path.join(self.data_dir, 'expected_update_ucsc_config_output.txt')
        #run test
        self.__configure.write_ucsc_config('7.6', 'ucsc_file7.6.txt')
        self.assertTrue(filecmp.cmp(output_file, expected_out_file), "Configure cannot update UCSC config correctly")

    def tearDown(self):
        self.remove_working_dir()
Exemplo n.º 6
0
 def init_configure_instance(self):
     self.__configure = Configure()