Ejemplo n.º 1
0
    def test_parallel_align_seqs_pynast(self):
        """ parallel_align_seqs_pynast functions as expected """

        params = {
            'min_percent_id': 0.75,
            'min_length': 15,
            'template_fp': self.template_fp,
            'pairwise_alignment_method': 'uclust',
            'blast_db': None
        }

        app = ParallelAlignSeqsPyNast()
        r = app(self.inseqs1_fp,
                self.test_out,
                params,
                job_prefix='PTEST',
                poll_directly=True,
                suppress_submit_jobs=False)
        # confirm that the total number of output sequences equals the total
        # number of input sequences
        num_input_seqs = count_seqs_in_filepaths([self.inseqs1_fp])[1]
        num_template_seqs = count_seqs_in_filepaths([self.template_fp])[1]
        num_output_seqs = \
            count_seqs_in_filepaths(glob(join(self.test_out, '*fasta')))[1] \
            - num_input_seqs - num_template_seqs
        self.assertEqual(num_input_seqs, num_output_seqs)
Ejemplo n.º 2
0
    def test_parallel_align_seqs_pynast(self):
        """ parallel_align_seqs_pynast functions as expected """

        params = {
            'min_percent_id': 0.75,
            'min_length': 15,
            'template_fp': self.template_fp,
            'pairwise_alignment_method': 'uclust',
            'blast_db': None
        }

        app = ParallelAlignSeqsPyNast()
        r = app(self.inseqs1_fp,
                self.test_out,
                params,
                job_prefix='PTEST',
                poll_directly=True,
                suppress_submit_jobs=False)
        # confirm that the total number of output sequences equals the total
        # number of input sequences
        num_input_seqs = count_seqs_in_filepaths([self.inseqs1_fp])[1]
        num_template_seqs = count_seqs_in_filepaths([self.template_fp])[1]
        num_output_seqs = \
            count_seqs_in_filepaths(glob(join(self.test_out, '*fasta')))[1] \
            - num_input_seqs - num_template_seqs
        self.assertEqual(num_input_seqs, num_output_seqs)
Ejemplo n.º 3
0
def main():
    option_parser, opts, args =\
       parse_command_line_parameters(**script_info)
    suppress_errors = opts.suppress_errors
    input_fps = []
    for e in opts.input_fps.split(','):
        input_fps.extend(glob(e))
    input_fps = set(input_fps)
    if len(input_fps) == 0:
        option_parser.error(\
         "No filepaths match pattern(s) passed via -i: %s" % ''.join(opts.input_fps))

    output_fp = opts.output_fp

    count_data, total, inaccessible_filepaths = count_seqs_in_filepaths(
        input_fps)
    r = format_output(count_data, total, inaccessible_filepaths,
                      suppress_errors)

    if opts.output_fp:
        f = open(output_fp, 'w')
        f.write(r)
        f.close()
    else:
        print r
Ejemplo n.º 4
0
def main():
    option_parser, opts, args =\
       parse_command_line_parameters(**script_info)
    suppress_errors = opts.suppress_errors
    input_fps = opts.input_fps
        
    output_fp = opts.output_fp

    count_data, total, inaccessible_filepaths = count_seqs_in_filepaths(input_fps)
    r = format_output(count_data, total, inaccessible_filepaths, suppress_errors)
    
    if opts.output_fp:
        f = open(output_fp,'w')
        f.write(r)
        f.close()
    else:
        print r
Ejemplo n.º 5
0
def main():
    option_parser, opts, args =\
       parse_command_line_parameters(**script_info)
    suppress_errors = opts.suppress_errors
    input_fps = []
    for e in opts.input_fps.split(','):
        input_fps.extend(glob(e))
    input_fps = set(input_fps)
    if len(input_fps) == 0:
        option_parser.error(\
         "No filepaths match pattern(s) passed via -i: %s" % ''.join(opts.input_fps))
        
    output_fp = opts.output_fp

    count_data, total, inaccessible_filepaths = count_seqs_in_filepaths(input_fps)
    r = format_output(count_data, total, inaccessible_filepaths, suppress_errors)
    
    if opts.output_fp:
        f = open(output_fp,'w')
        f.write(r)
        f.close()
    else:
        print r