Ejemplo n.º 1
0
 def setUp(self):
     l = logging.getLogger()
     l.manager.loggerDict.clear()
     
     #add only one handler to the macsypy logger
     from macsypy.gene import _log
     macsy_log = _log.parent
     log_file = 'NUL' if platform.system() == 'Windows' else '/dev/null'
     log_handler = logging.FileHandler(log_file)
     macsy_log.addHandler(log_handler)
     
     self.cfg = Config( sequence_db = os.path.join(self._data_dir, "base", "test_base.fa"),
                        db_type = "gembase",
                        hmmer_exe = "",
                        e_value_res = 1,
                        i_evalue_sel = 0.5,
                        def_dir = os.path.join(self._data_dir, 'DEF'),
                        res_search_dir = tempfile.gettempdir(),
                        res_search_suffix = "",
                        profile_dir = os.path.join(self._data_dir, 'profiles'),
                        profile_suffix = ".hmm",
                        res_extract_suffix = "",
                        log_level = 30,
                        log_file = log_file
                        )
     self.profile_registry = ProfilesRegistry(self.cfg)
 def setUp(self):
     self.cfg = Config(sequence_db=os.path.join(self._data_dir, "base",
                                                "test_base.fa"),
                       db_type="gembase",
                       hmmer_exe="",
                       e_value_res=1,
                       i_evalue_sel=0.5,
                       def_dir=os.path.join(self._data_dir, 'DEF'),
                       res_search_dir="/tmp",
                       res_search_suffix="",
                       profile_dir=os.path.join(self._data_dir, 'profiles'),
                       profile_suffix=".hmm",
                       res_extract_suffix="",
                       log_level=30,
                       log_file='/dev/null')
     self.profile_registry = ProfilesRegistry(self.cfg)
Ejemplo n.º 3
0
    def setUp(self):
        self.cfg = Config(hmmer_exe="hmmsearch",
                          sequence_db=os.path.join(self._data_dir, "base",
                                                   "test_base.fa"),
                          db_type="gembase",
                          e_value_res=1,
                          i_evalue_sel=0.5,
                          def_dir=os.path.join(self._data_dir, 'DEF'),
                          res_search_dir='/tmp',
                          res_search_suffix=".search_hmm.out",
                          profile_dir=os.path.join(self._data_dir, 'profiles'),
                          profile_suffix=".hmm",
                          res_extract_suffix="",
                          log_level=30,
                          log_file='/dev/null')
        shutil.copy(self.cfg.sequence_db, self.cfg.working_dir)
        self.cfg.options['sequence_db'] = os.path.join(
            self.cfg.working_dir, os.path.basename(self.cfg.sequence_db))
        self.profile_registry = ProfilesRegistry(self.cfg)

        idx = Indexes(self.cfg)
        idx._build_my_indexes()