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)
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)
def parseArgs1(Program, logger): # create the cc tbx aspect of the parser parser = CCTBXParser( program_class = Program, # custom_process_arguments = custom_args_proc, logger=logger) # add the old suitename aspect of the parser buildParser(parser) # do it namespace = parser.parse_args(sys.argv[1:]) return parser.working_phil
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)
def parseArgs(programClass, logger): for i, arg in enumerate(sys.argv): # make case insensitive if arg[0]=="-": sys.argv[i] = arg.lower() parser = argparse.ArgumentParser() buildParser(parser) # set up the arguments for suite name args, others = parser.parse_known_args() args2 = argsToPhilForm(args, others) args2.extend(others) # create the cctbx aspect of the parser parser2 = CCTBXParser( program_class = programClass, # custom_process_arguments = custom_args_proc, logger=logger ) # do it namespace = parser2.parse_args(args2) extracted = parser2.working_phil.extract() # for name, value in extracted.suitename.__dict__.items(): # print(name, ":", value) return parser2