def main(): option_parser, opts, args = parse_command_line_parameters(**script_info) if opts.show_metrics: print("Known metrics are: %s\n" \ % (', '.join(list_known_metrics()),)) print( "For more information, see http://qiime.org/scripts/alpha_diversity_metrics.html" ) exit(0) almost_required_options = ['input_path', 'output_path', 'metrics'] for option in almost_required_options: if getattr(opts, option) == None: option_parser.error('Required option --%s omitted.' % option) if os.path.isdir(opts.input_path): multiple_file_alpha(opts.input_path, opts.output_path, opts.metrics, opts.tree_path) elif os.path.isfile(opts.input_path): try: f = open(opts.output_path, 'w') f.close() except IOError: if os.path.isdir(opts.output_path): option_parser.error( "ioerror, couldn't create output file. The output path is a directory, which should be a single file" ) else: option_parser.error("ioerror, couldn't create output file") single_file_alpha(opts.input_path, opts.metrics, opts.output_path, opts.tree_path)
def main(): option_parser, opts, args = parse_command_line_parameters(**script_info) if opts.show_metrics: print("Known metrics are: %s\n" \ % (', '.join(list_known_metrics()),)) print("For more information, see http://qiime.org/scripts/alpha_diversity_metrics.html") exit(0) almost_required_options = ['input_path','output_path','metrics'] for option in almost_required_options: if getattr(opts,option) == None: option_parser.error('Required option --%s omitted.' % option) if os.path.isdir(opts.input_path): multiple_file_alpha(opts.input_path, opts.output_path, opts.metrics, opts.tree_path) elif os.path.isfile(opts.input_path): try: f = open(opts.output_path, 'w') f.close() except IOError: print("ioerror, couldn't create output file") exit(1) single_file_alpha(opts.input_path, opts.metrics, opts.output_path, opts.tree_path) else: print("io error, input path not valid. does it exist?") exit(1)
def main(): option_parser, opts, args = parse_command_line_parameters(**script_info) if opts.show_metrics: print("Known metrics are: %s\n" % (', '.join(list_known_metrics()),)) print("For more information, see http://scikit-bio.org/docs/latest/ge" "nerated/skbio.diversity.alpha.html#module-skbio.diversity.alpha") exit(0) almost_required_options = ['input_path', 'output_path', 'metrics'] for option in almost_required_options: if getattr(opts, option) is None: option_parser.error('Required option --%s omitted.' % option) if os.path.isdir(opts.input_path): multiple_file_alpha(opts.input_path, opts.output_path, opts.metrics, opts.tree_path) elif os.path.isfile(opts.input_path): try: f = open(opts.output_path, 'w') f.close() except IOError: if os.path.isdir(opts.output_path): option_parser.error( "ioerror, couldn't create output file. The output path is a directory, which should be a single file") else: option_parser.error("ioerror, couldn't create output file") single_file_alpha(opts.input_path, opts.metrics, opts.output_path, opts.tree_path)
def main(): option_parser, opts, args = parse_command_line_parameters(**script_info) if opts.show_metrics: print("Known metrics are: %s\n" \ % (', '.join(list_known_metrics()),)) exit(0) almost_required_options = ['input_path', 'output_path', 'metrics'] for option in almost_required_options: if getattr(opts, option) == None: option_parser.error('Required option --%s omitted.' % option) if os.path.isdir(opts.input_path): multiple_file_alpha(opts.input_path, opts.output_path, opts.metrics, opts.tree_path) elif os.path.isfile(opts.input_path): try: f = open(opts.output_path, 'w') f.close() except IOError: print("ioerror, couldn't create output file") exit(1) single_file_alpha(opts.input_path, opts.metrics, opts.output_path, opts.tree_path) else: print("io error, input path not valid. does it exist?") exit(1)