def main():
    option_parser, opts, args = parse_command_line_parameters(**script_info)

    input_dirs = opts.input_dirs.split(',')
    assignment_methods = opts.assignment_methods.split(',')

    confidences = opts.confidences
    if confidences is not None:
        confidences = map(float, opts.confidences.split(','))

    e_values = opts.e_values
    if e_values is not None:
        e_values = map(float, opts.e_values.split(','))

    if opts.print_only:
        command_handler = print_commands
    else:
        command_handler = call_commands_serially

    if opts.verbose:
        status_update_callback = print_to_stdout
    else:
        status_update_callback = no_status_updates

    assign_taxonomy_multiple_times(input_dirs, opts.output_dir,
        assignment_methods, opts.reference_seqs_fp, opts.input_fasta_filename,
        opts.clean_otu_table_filename,
        id_to_taxonomy_fp=opts.id_to_taxonomy_fp,
        confidences=confidences, e_values=e_values,
        read_1_seqs_fp=opts.read_1_seqs_fp,
        read_2_seqs_fp=opts.read_2_seqs_fp,
        rdp_max_memory=opts.rdp_max_memory,
        command_handler=command_handler,
        status_update_callback=status_update_callback, force=opts.force)
コード例 #2
0
def main():
    option_parser, opts, args = parse_command_line_parameters(**script_info)

    input_dirs = opts.input_dirs.split(',')
    assignment_methods = opts.assignment_methods.split(',')

    confidences = split_input_str(opts.confidences)
    e_values = split_input_str(opts.e_values)
    rtax_modes = split_input_str(opts.rtax_modes, map_fn=str)
    uclust_min_consensus_fractions = \
            split_input_str(opts.uclust_min_consensus_fractions)
    uclust_similarities = split_input_str(opts.uclust_similarities)
    uclust_max_accepts = split_input_str(opts.uclust_max_accepts, map_fn=int)

    rtax_read_id_regexes = split_input_str(opts.rtax_read_id_regexes,
                                           map_fn=str)
    rtax_amplicon_id_regexes = split_input_str(opts.rtax_amplicon_id_regexes,
                                               map_fn=str)
    rtax_header_id_regexes = split_input_str(opts.rtax_header_id_regexes,
                                             map_fn=str)

    if opts.print_only:
        command_handler = print_commands
    else:
        command_handler = call_commands_serially

    if opts.verbose:
        status_update_callback = print_to_stdout
    else:
        status_update_callback = no_status_updates

    assign_taxonomy_multiple_times(input_dirs, opts.output_dir,
        assignment_methods, opts.reference_seqs_fp,
        opts.id_to_taxonomy_fp, confidences=confidences,
        e_values=e_values, rtax_modes=rtax_modes,
        uclust_min_consensus_fractions=uclust_min_consensus_fractions,
        uclust_similarities=uclust_similarities,
        uclust_max_accepts=uclust_max_accepts,
        input_fasta_filename=opts.input_fasta_filename,
        clean_otu_table_filename=opts.clean_otu_table_filename,
        read_1_seqs_filename=opts.read_1_seqs_filename,
        read_2_seqs_filename=opts.read_2_seqs_filename,
        rtax_read_id_regexes=rtax_read_id_regexes,
        rtax_amplicon_id_regexes=rtax_amplicon_id_regexes,
        rtax_header_id_regexes=rtax_header_id_regexes,
        rdp_max_memory=opts.rdp_max_memory,
        command_handler=command_handler,
        status_update_callback=status_update_callback, force=opts.force)
def main():
    option_parser, opts, args = parse_command_line_parameters(**script_info)

    input_dirs = opts.input_dirs.split(',')
    assignment_methods = opts.assignment_methods.split(',')

    confidences = opts.confidences
    if confidences is not None:
        confidences = map(float, opts.confidences.split(','))

    e_values = opts.e_values
    if e_values is not None:
        e_values = map(float, opts.e_values.split(','))

    if opts.print_only:
        command_handler = print_commands
    else:
        command_handler = call_commands_serially

    if opts.verbose:
        status_update_callback = print_to_stdout
    else:
        status_update_callback = no_status_updates

    assign_taxonomy_multiple_times(
        input_dirs,
        opts.output_dir,
        assignment_methods,
        opts.reference_seqs_fp,
        opts.input_fasta_filename,
        opts.clean_otu_table_filename,
        id_to_taxonomy_fp=opts.id_to_taxonomy_fp,
        confidences=confidences,
        e_values=e_values,
        read_1_seqs_fp=opts.read_1_seqs_fp,
        read_2_seqs_fp=opts.read_2_seqs_fp,
        rdp_max_memory=opts.rdp_max_memory,
        command_handler=command_handler,
        status_update_callback=status_update_callback,
        force=opts.force)
    def test_assign_taxonomy_multiple_times_invalid_input_uclust(self):
        """Test that errors are thrown using invalid input for uclust."""
        out_dir = self.output_dir

        # Missing uclust consensus parameters.
        with self.assertRaises(WorkflowError):
            assign_taxonomy_multiple_times([out_dir, out_dir], out_dir,
                    ['uclust', 'uclust'], '/foo/ref_seqs.fasta',
                    '/foo/tax.txt', rtax_modes=['single'], force=True)

        # Missing uclust similarity parameters.
        with self.assertRaises(WorkflowError):
            assign_taxonomy_multiple_times([out_dir, out_dir], out_dir,
                    ['uclust', 'uclust'], '/foo/ref_seqs.fasta',
                    '/foo/tax.txt', uclust_min_consensus_fractions=[0.51],
                    force=True)

        # Missing uclust max accepts parameters.
        with self.assertRaises(WorkflowError):
            assign_taxonomy_multiple_times([out_dir, out_dir], out_dir,
                    ['uclust', 'uclust'], '/foo/ref_seqs.fasta',
                    '/foo/tax.txt', uclust_min_consensus_fractions=[0.51],
                    uclust_similarities=[0.97], force=True)