def main(): option_parser, opts, args = parse_command_line_parameters(**script_info) input_path = opts.input_path out_path = opts.out_path output_CSS_statistics = opts.output_CSS_statistics DESeq_negatives_to_zero = opts.DESeq_negatives_to_zero algorithm = opts.algorithm list_algorithms = opts.list_algorithms if list_algorithms: print 'Available normalization algorithms are:\n%s' % ', '.join( algorithm_list()) else: almost_required_options = ['input_path', 'out_path'] for option in almost_required_options: if getattr(opts, option) is None: option_parser.error('Required option --%s omitted.' % option) if algorithm == 'CSS': if os.path.isdir(input_path): multiple_file_normalize_CSS(input_path, out_path, output_CSS_statistics) elif os.path.isfile(input_path): normalize_CSS(input_path, out_path, output_CSS_statistics) else: # it shouldn't be possible to get here option_parser.error("Unknown input type: %s" % input_path) elif algorithm == 'DESeq2': if os.path.isdir(input_path): multiple_file_normalize_DESeq2(input_path, out_path, DESeq_negatives_to_zero) elif os.path.isfile(input_path): normalize_DESeq2(input_path, out_path, DESeq_negatives_to_zero) else: # it shouldn't be possible to get here option_parser.error("Unknown input type: %s" % input_path) else: # it shouldn't be possible to get here option_parser.error("Unknown normalization algorithm: %s" % algorithm)
def main(): option_parser, opts, args = parse_command_line_parameters(**script_info) input_path = opts.input_path out_path = opts.out_path output_CSS_statistics = opts.output_CSS_statistics DESeq_negatives_to_zero = opts.DESeq_negatives_to_zero algorithm = opts.algorithm list_algorithms = opts.list_algorithms if list_algorithms: print 'Available normalization algorithms are:\n%s' % ', '.join(algorithm_list()) else: almost_required_options = ['input_path', 'out_path'] for option in almost_required_options: if getattr(opts, option) is None: option_parser.error('Required option --%s omitted.' % option) if algorithm == 'CSS': if os.path.isdir(input_path): multiple_file_normalize_CSS(input_path, out_path, output_CSS_statistics) elif os.path.isfile(input_path): normalize_CSS(input_path, out_path, output_CSS_statistics) else: # it shouldn't be possible to get here option_parser.error("Unknown input type: %s" % input_path) elif algorithm == 'DESeq2': if os.path.isdir(input_path): multiple_file_normalize_DESeq2(input_path, out_path, DESeq_negatives_to_zero) elif os.path.isfile(input_path): normalize_DESeq2(input_path, out_path, DESeq_negatives_to_zero) else: # it shouldn't be possible to get here option_parser.error("Unknown input type: %s" % input_path) else: # it shouldn't be possible to get here option_parser.error("Unknown normalization algorithm: %s" % algorithm)
action='store_true', help='output CSS statistics file. This ' 'will be a directory for batch processing, and a filename for ' 'single file operation [default: %default]'), make_option('-z', '--DESeq_negatives_to_zero', default=False, action='store_true', help='replace negative numbers produced by ' 'the DESeq normalization technique with zeros [default: ' '%default]'), make_option('-a', '--algorithm', default='CSS', type='choice', choices=algorithm_list(), help='normalization algorithm to apply to input ' 'BIOM table(s). [default: %default]' + ' Available options are: ' '%s' % ', '.join(algorithm_list())), make_option('-l', '--list_algorithms', action='store_true', default=False, help='show available normalization algorithms and exit ' '[default: %default]'), ] script_info['version'] = __version__ def main():
help='path to the input BIOM file (e.g., the output ' 'from OTU picking) or directory containing input BIOM files ' 'for batch processing [REQUIRED if not passing -l]'), make_option('-o', '--out_path', type='new_path', help='output filename for single file operation, or output ' 'directory for batch processing [REQUIRED if not passing -l]'), make_option('-s', '--output_CSS_statistics', default=False, action='store_true', help='output CSS statistics file. This ' 'will be a directory for batch processing, and a filename for ' 'single file operation [default: %default]'), make_option('-z', '--DESeq_negatives_to_zero', default=False, action='store_true', help='replace negative numbers produced by ' 'the DESeq normalization technique with zeros [default: ' '%default]'), make_option('-a', '--algorithm', default='CSS', type='choice', choices=algorithm_list(), help='normalization algorithm to apply to input ' 'BIOM table(s). [default: %default]' + ' Available options are: ' '%s' % ', '.join(algorithm_list())), make_option('-l', '--list_algorithms', action='store_true', default=False, help='show available normalization algorithms and exit ' '[default: %default]'), ] script_info['version'] = __version__ def main(): option_parser, opts, args = parse_command_line_parameters(**script_info) input_path = opts.input_path out_path = opts.out_path