Esempio n. 1
0
 def __init__(self, dir):
     self.dir = dir
     self.files = dict()
     for best in glam2.best_files(dir):
         fragment, cross_fold_index, seed = glam2.interpret_output_filename(
             best)
         self.files[(fragment, cross_fold_index)] = best
Esempio n. 2
0
def worker():
    while True:
        if options.glam2_format:
            pssm_file = q.get()
            fragment, fold, seed = glam2.interpret_output_filename(pssm_file)
        else:
            fragment, fold = q.get()
            pssm_file = os.path.join(options.pssm_dir, "%s-%d.pssm" % (fragment, fold))
        try:

            def execute(args):
                logging.info("Executing: %s", " ".join(args))
                subprocess.check_call(args)

            logging.info("Scoring output: %s: %s, %d", pssm_file, fragment, fold)
            script_dir = os.path.dirname(__file__)
            args = [
                "python2.5",
                os.path.join(script_dir, "test_score_pssm.py"),
                "-q",
                "-d",
                harness.options.data_dir,  # where sequences are stored
                "-r",
                options.results_dir,  # where to put output
                method,
                pssm_file,
                fragment,
                str(fold),
            ]
            if options.glam2_format:
                args.append("--glam2-format")

            # do positive dataset
            execute(args)

            # do negative datasets
            args.append(None)
            for bg in harness.options.backgrounds:
                args[-1] = bg
                execute(args)
        except:
            type, value, traceback = sys.exc_info()
            logging.exception("Exception (%s) caught: %s", type, value)
            sys.exc_clear()
        q.task_done()
Esempio n. 3
0
def worker():
    while True:
        if options.glam2_format:
            pssm_file = q.get()
            fragment, fold, seed = glam2.interpret_output_filename(pssm_file)
        else:
            fragment, fold = q.get()
            pssm_file = os.path.join(options.pssm_dir, '%s-%d.pssm' % (fragment, fold))
        try:
            def execute(args):
                logging.info('Executing: %s', ' '.join(args))
                subprocess.check_call(args)

            logging.info('Scoring output: %s: %s, %d', pssm_file, fragment, fold)
            script_dir = os.path.dirname(__file__)
            args = [
                'python2.5',
                os.path.join(script_dir, 'test_score_pssm.py'),
                '-q',
                '-d', harness.options.data_dir, # where sequences are stored
                '-r', options.results_dir, # where to put output
                method,
                pssm_file,
                fragment,
                str(fold)
            ]
            if options.glam2_format:
                args.append('--glam2-format')

            # do positive dataset
            execute(args)

            # do negative datasets
            args.append(None)
            for bg in harness.options.backgrounds:
                args[-1] = bg
                execute(args)
        except:
            type, value, traceback = sys.exc_info()
            logging.exception('Exception (%s) caught: %s', type, value)
            sys.exc_clear()
        q.task_done()
Esempio n. 4
0
 def __init__(self, dir):
     self.dir = dir
     self.files = dict()
     for best in glam2.best_files(dir):
         fragment, cross_fold_index, seed = glam2.interpret_output_filename(best)
         self.files[(fragment, cross_fold_index)] = best