예제 #1
0
def main(_):
  """TODO(nh2tran): docstring."""

  print("main()")

  if deepnovo_config.FLAGS.knapsack_build:
    deepnovo_main_modules.knapsack_build()
  elif deepnovo_config.FLAGS.train:
    deepnovo_main_modules.train()
  elif deepnovo_config.FLAGS.test_true_feeding:
    deepnovo_main_modules.test_true_feeding()
  elif deepnovo_config.FLAGS.decode:
    deepnovo_main_modules.decode()
  elif deepnovo_config.FLAGS.search_denovo:
    model = deepnovo_model.ModelInference()
    model.build_model()
    worker_io = deepnovo_worker_io.WorkerIO(
        input_file=deepnovo_config.denovo_input_file,
        output_file=deepnovo_config.denovo_output_file)
    worker_denovo = deepnovo_worker_denovo.WorkerDenovo()
    worker_denovo.search_denovo(model, worker_io)
  elif deepnovo_config.FLAGS.search_db:
    model = deepnovo_model.ModelInference()
    model.build_model()
    worker_io = deepnovo_worker_io.WorkerIO(
        input_file=deepnovo_config.db_input_file,
        output_file=deepnovo_config.db_output_file)
    worker_db = deepnovo_worker_db.WorkerDB()
    worker_db.build_db()
    worker_db.search_db(model, worker_io)
  elif deepnovo_config.FLAGS.search_hybrid:
    model = deepnovo_model.ModelInference()
    model.build_model()
    # denovo search
    worker_io = deepnovo_worker_io.WorkerIO(
        input_file=deepnovo_config.hybrid_input_file,
        output_file=deepnovo_config.hybrid_denovo_file)
    worker_denovo = deepnovo_worker_denovo.WorkerDenovo()
    predicted_denovo_list = worker_denovo.search_denovo(model, worker_io)
    # db search with predicted_denovo_list
    worker_io = deepnovo_worker_io.WorkerIO(
        input_file=deepnovo_config.hybrid_input_file,
        output_file=deepnovo_config.hybrid_output_file)
    worker_db = deepnovo_worker_db.WorkerDB()
    worker_db.build_db()
    worker_db.search_db(model, worker_io, predicted_denovo_list)
  elif deepnovo_config.FLAGS.test:
    # test 1%FDR
    #~ worker_db = deepnovo_worker_db.WorkerDB()
    #~ worker_db.build_db()
    #~ worker_test = deepnovo_worker_test.WorkerTest()
    #~ worker_test.test_accuracy(worker_db.peptide_list)
    worker_test = deepnovo_worker_test.WorkerTest()
    worker_test.test_accuracy()
  else:
    print("ERROR: wrong option!")
    sys.exit()
예제 #2
0
def main(_):
    """TODO(nh2tran): docstring."""

    print("main()")

    if deepnovo_config.FLAGS.knapsack_build:
        deepnovo_main_modules.knapsack_build()
    elif deepnovo_config.FLAGS.train:
        deepnovo_main_modules.train()
    elif deepnovo_config.FLAGS.test_true_feeding:
        deepnovo_main_modules.test_true_feeding()
    elif deepnovo_config.FLAGS.decode:
        deepnovo_main_modules.decode()
    elif deepnovo_config.FLAGS.search_db:
        model = deepnovo_model.DecodingModel()
        worker_io = deepnovo_worker_io.WorkerIO(
            input_file=deepnovo_config.input_file,
            output_file=deepnovo_config.output_file)
        worker_db = deepnovo_worker_db.WorkerDB()
        worker_db.build_db()
        worker_db.search_db(model, worker_io)
        # due to some mistakes in cleavage rules, we need worker_db.peptide_list to
        #   check for consistency
        worker_test = deepnovo_worker_test.WorkerTest()
        worker_test.test_accuracy(worker_db.peptide_list)
    elif deepnovo_config.FLAGS.test:
        pass
    else:
        print("ERROR: wrong option!")
        sys.exit()
예제 #3
0
def main(_):
    hostname = socket.gethostname()
    print('hostname:', hostname)

    print("main()")

    if deepnovo_config.FLAGS.knapsack_build:
        deepnovo_main_modules.knapsack_build()
    elif deepnovo_config.FLAGS.train:
        deepnovo_main_modules.train()
    elif deepnovo_config.FLAGS.test_true_feeding:
        deepnovo_main_modules.test_true_feeding()
    elif deepnovo_config.FLAGS.decode:
        deepnovo_main_modules.decode()
    elif deepnovo_config.FLAGS.multi_decode:
        deepnovo_main_modules.multi_decode()
    elif deepnovo_config.FLAGS.multi_train:
        if deepnovo_config.data_format == 'mgf':
            deepnovo_main_modules.multi_train()
        elif deepnovo_config.data_format == 'pickle':
            deepnovo_main_modules.multi_train_pickles()
    elif deepnovo_config.FLAGS.sigopt:
        deepnovo_main_modules.sigopt()
    elif deepnovo_config.FLAGS.search_denovo:
        model = deepnovo_model.ModelInference()
        model.build_model()
        worker_io = deepnovo_worker_io.WorkerIO(
            input_file=deepnovo_config.denovo_input_file,
            output_file=deepnovo_config.denovo_output_file)
        worker_denovo = deepnovo_worker_denovo.WorkerDenovo()
        worker_denovo.search_denovo(model, worker_io)
    elif deepnovo_config.FLAGS.search_db:
        model = deepnovo_model.ModelInference()
        model.build_model()
        worker_io = deepnovo_worker_io.WorkerIO(
            input_file=deepnovo_config.db_input_file,
            output_file=deepnovo_config.db_output_file)
        worker_db = deepnovo_worker_db.WorkerDB()
        worker_db.build_db()
        worker_db.search_db(model, worker_io)
    elif deepnovo_config.FLAGS.search_hybrid:
        model = deepnovo_model.ModelInference()
        model.build_model()
        # denovo search
        worker_io = deepnovo_worker_io.WorkerIO(
            input_file=deepnovo_config.hybrid_input_file,
            output_file=deepnovo_config.hybrid_denovo_file)
        worker_denovo = deepnovo_worker_denovo.WorkerDenovo()
        predicted_denovo_list = worker_denovo.search_denovo(model, worker_io)
        # db search with predicted_denovo_list
        worker_io = deepnovo_worker_io.WorkerIO(
            input_file=deepnovo_config.hybrid_input_file,
            output_file=deepnovo_config.hybrid_output_file)
        worker_db = deepnovo_worker_db.WorkerDB()
        worker_db.build_db()
        worker_db.search_db(model, worker_io, predicted_denovo_list)
    elif deepnovo_config.FLAGS.test:
        worker_test = deepnovo_worker_test.WorkerTest()
        worker_test.test_accuracy()
    else:
        print("ERROR: wrong option!")
        sys.exit()