Exemple #1
0
def main():
    option_parser, opts, args = parse_command_line_parameters(**script_info)
    input_path = opts.input_path
    out_path = opts.out_path
    algorithm = opts.algorithm
    mapping_fp = opts.mapping_file_path
    mapping_category = opts.mapping_file_category
    subcategory_1 = opts.mapping_file_subcategory_1
    subcategory_2 = opts.mapping_file_subcategory_2
    list_algorithms = opts.list_algorithms
    DESeq2_diagnostic_plots = opts.DESeq2_diagnostic_plots

    if list_algorithms:
        print 'Available differential abundance algorithms are:\n%s' % ', '.join(
            algorithm_list())
    else:
        almost_required_options = [
            'input_path', 'out_path', 'mapping_file_path',
            'mapping_file_category', 'mapping_file_subcategory_1',
            'mapping_file_subcategory_2'
        ]
        for option in almost_required_options:
            if getattr(opts, option) is None:
                option_parser.error('Required option --%s omitted.' % option)
        if algorithm == 'metagenomeSeq_fitZIG':
            if os.path.isdir(input_path):
                multiple_file_DA_fitZIG(input_path, out_path, mapping_fp,
                                        mapping_category, subcategory_1,
                                        subcategory_2)
            elif os.path.isfile(input_path):
                DA_fitZIG(input_path, out_path, mapping_fp, mapping_category,
                          subcategory_1, subcategory_2)
            else:
                # it shouldn't be possible to get here
                option_parser.error("Unknown input type: %s" % input_path)
        elif algorithm == 'DESeq2_nbinom':
            if os.path.isdir(input_path):
                multiple_file_DA_DESeq2(input_path, out_path, mapping_fp,
                                        mapping_category, subcategory_1,
                                        subcategory_2, DESeq2_diagnostic_plots)
            elif os.path.isfile(input_path):
                DA_DESeq2(input_path, out_path, mapping_fp, mapping_category,
                          subcategory_1, subcategory_2,
                          DESeq2_diagnostic_plots)
            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
    algorithm = opts.algorithm
    mapping_fp = opts.mapping_file_path
    mapping_category = opts.mapping_file_category
    subcategory_1 = opts.mapping_file_subcategory_1
    subcategory_2 = opts.mapping_file_subcategory_2
    list_algorithms = opts.list_algorithms
    DESeq2_diagnostic_plots = opts.DESeq2_diagnostic_plots

    if list_algorithms:
        print 'Available differential abundance algorithms are:\n%s' % ', '.join(algorithm_list())
    else:
        almost_required_options = ['input_path', 'out_path', 'mapping_file_path', 'mapping_file_category', 'mapping_file_subcategory_1', 'mapping_file_subcategory_2']
        for option in almost_required_options:
            if getattr(opts, option) is None:
                option_parser.error('Required option --%s omitted.' % option)        
        if algorithm == 'metagenomeSeq_fitZIG':
            if os.path.isdir(input_path):
                multiple_file_DA_fitZIG(input_path, out_path, mapping_fp, mapping_category, subcategory_1, subcategory_2)
            elif os.path.isfile(input_path):
                DA_fitZIG(input_path, out_path, mapping_fp, mapping_category, subcategory_1, subcategory_2)
            else:
                # it shouldn't be possible to get here
                option_parser.error("Unknown input type: %s" % input_path)        
        elif algorithm == 'DESeq2_nbinom':
            if os.path.isdir(input_path):
                multiple_file_DA_DESeq2(input_path, out_path, mapping_fp, mapping_category, subcategory_1, subcategory_2, DESeq2_diagnostic_plots)
            elif os.path.isfile(input_path):
                DA_DESeq2(input_path, out_path, mapping_fp, mapping_category, subcategory_1, subcategory_2, DESeq2_diagnostic_plots)
            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)
Exemple #3
0
 make_option('-i',
             '--input_path',
             type='existing_path',
             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('-a',
             '--algorithm',
             default='metagenomeSeq_fitZIG',
             type='choice',
             choices=algorithm_list(),
             help='differential abundance algorithm to '
             'apply to input BIOM table(s) [default: %default]' +
             ' Available options are: '
             '%s' % ', '.join(algorithm_list())),
 make_option('-m',
             '--mapping_file_path',
             type='existing_filepath',
             help='path to mapping file [REQUIRED if not passing -l]'),
 make_option('-c',
             '--mapping_file_category',
             help='mapping file category [REQUIRED if not passing -l]'),
 make_option('-x',
             '--mapping_file_subcategory_1',
             help='mapping file subcategory [REQUIRED if not passing -l]'),
 make_option('-y',
    """Treatment:Fast groups.""",
    "%prog -i otu_tables/ -o diff_otus/ -m map.txt -a metagenomeSeq_fitZIG -c Treatment -x Control -y Fast")
    )
script_info['output_description']= "The resulting output OTU txt file contains a list of all the OTUs in the input matrix, along with their associated statistics and FDR p-values."
script_info['required_options']=[
]
script_info['optional_options']=[
    make_option('-i', '--input_path', type='existing_path',
    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('-a', '--algorithm', default='metagenomeSeq_fitZIG', type='choice',
    choices=algorithm_list(), help='differential abundance algorithm to '
    'apply to input BIOM table(s) [default: %default]' + ' Available options are: '
    '%s' % ', '.join(algorithm_list())),
make_option('-m', '--mapping_file_path', type='existing_filepath',
    help='path to mapping file [REQUIRED if not passing -l]'),
make_option('-c', '--mapping_file_category',
    help='mapping file category [REQUIRED if not passing -l]'),
make_option('-x', '--mapping_file_subcategory_1',
    help='mapping file subcategory [REQUIRED if not passing -l]'),
make_option('-y', '--mapping_file_subcategory_2',
    help='mapping file subcategory [REQUIRED if not passing -l]'),
make_option('-l', '--list_algorithms', action='store_true', default=False,
    help='show available differential abundance algorithms and exit '
    '[default: %default]'),
make_option('-d', '--DESeq2_diagnostic_plots', default=False,
    action='store_true', help='show a MA plot - y axis: log2 fold change, '
    """Treatment:Fast groups.""",
    "%prog -i otu_tables/ -o diff_otus/ -m map.txt -a metagenomeSeq_fitZIG -c Treatment -x Control -y Fast")
    )
script_info['output_description']= "The resulting output OTU txt file contains a list of all the OTUs in the input matrix, along with their associated statistics and FDR p-values."
script_info['required_options']=[
]
script_info['optional_options']=[
    make_option('-i', '--input_path', type='existing_path',
    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('-a', '--algorithm', default='metagenomeSeq_fitZIG', type='choice',
    choices=algorithm_list(), help='differential abundance algorithm to '
    'apply to input BIOM table(s) [default: %default]' + ' Available options are: '
    '%s' % ', '.join(algorithm_list())),
make_option('-m', '--mapping_file_path', type='existing_filepath',
    help='path to mapping file [REQUIRED if not passing -l]'),
make_option('-c', '--mapping_file_category',
    help='mapping file category [REQUIRED if not passing -l]'),
make_option('-x', '--mapping_file_subcategory_1',
    help='mapping file subcategory [REQUIRED if not passing -l]'),
make_option('-y', '--mapping_file_subcategory_2',
    help='mapping file subcategory [REQUIRED if not passing -l]'),
make_option('-l', '--list_algorithms', action='store_true', default=False,
    help='show available differential abundance algorithms and exit '
    '[default: %default]'),
make_option('-d', '--DESeq2_diagnostic_plots', default=False,
    action='store_true', help='show a MA plot - y axis: log2 fold change, '