Example #1
0
def run(args):

    # create parser
    logger = multi_out()
    logger.register('stderr', sys.stderr)
    logger2 = multi_out()
    logger2.register('stdout', sys.stdout)

    parser = CCTBXParser(program_class=cablam.Program, logger=logger)
    namespace = parser.parse_args(sys.argv[1:])

    # start program
    print('Starting job', file=logger)
    print('=' * 79, file=logger)
    task = cablam.Program(parser.data_manager,
                          parser.working_phil.extract(),
                          logger=logger2)

    # validate inputs
    task.validate()

    # run program
    task.run()

    # stop timer
    print('', file=logger)
    print('=' * 79, file=logger)
    print('Job complete', file=logger)
    show_total_time(out=logger)
Example #2
0
def run(args):

    # create parser
    #logger = multi_out() #logging.getLogger('main')
    #logger.register('stdout', sys.stdout)
    #logger = null_out()
    logger = multi_out()
    logger.register('stderr', sys.stderr)
    logger2 = multi_out()
    logger2.register('stdout', sys.stdout)
    #only omegalyze output is sent to stdout for backward compatibility with
    #  MolProbity website

    parser = CCTBXParser(program_class=omegalyze.Program, logger=logger)
    namespace = parser.parse_args(sys.argv[1:])

    # start program
    print('Starting job', file=logger)
    print('=' * 79, file=logger)
    task = omegalyze.Program(parser.data_manager,
                             parser.working_phil.extract(),
                             logger=logger2)

    # validate inputs
    task.validate()

    # run program
    task.run()

    # stop timer
    print('', file=logger)
    print('=' * 79, file=logger)
    print('Job complete', file=logger)
    show_total_time(out=logger)
Example #3
0
def run(args):
    # create parser
    logger = multi_out()  #logging.getLogger('main')
    logger.register('stdout', sys.stdout)

    parser = CCTBXParser(program_class=atom_selection.Program,
                         custom_process_arguments=custom_args_proc,
                         logger=logger)
    #
    # Stick in additional keyword args
    # They going to end up in namespace.cryst1_replacement_buffer_layer etc
    # file_name is obsolet, parser takes care of it putting it in data manager
    # inselections is going to be handled by custom_args_proc function
    # because it is intended to be positional argument
    #
    # !!! This is done here for legacy support and illustrative purposes.
    # Don't do it anywhere else, since we strive to have the same
    # command-line flags across all programs, like --overwrite etc.
    parser.add_argument(
        "--cryst1-replacement-buffer-layer",
        action="store",
        type=float,
        help="replace CRYST1 with pseudo unit cell covering the selected"
        " atoms plus a surrounding buffer layer",
        default=None)
    parser.add_argument("--write-pdb-file",
                        "--write_pdb_file",
                        "--write_pdb-file",
                        "--write-pdb_file",
                        action="store",
                        help="write selected atoms to new PDB file",
                        default=None)

    namespace = parser.parse_args(sys.argv[1:])

    # start program
    print('Starting job', file=logger)
    print('=' * 79, file=logger)

    task = atom_selection.Program(parser.data_manager,
                                  parser.working_phil.extract(),
                                  master_phil=parser.master_phil,
                                  logger=logger)

    # validate inputs
    task.validate()

    # run program
    task.run()

    # stop timer
    print('', file=logger)
    print('=' * 79, file=logger)
    print('Job complete', file=logger)
    show_total_time(out=logger)