def test_run_process_sff_through_pick_otus_parallel(self): """run_process_sff_through_pick_otus in parallel runs with out error""" run_process_sff_through_pick_otus( sff_input_fp=self.sff_fp, mapping_fp=self.fasting_mapping_fp, output_dir=self.wf_out, denoise=False, command_handler=call_commands_serially, params=self.params, qiime_config=self.qiime_config, parallel=True, status_update_callback=no_status_updates) input_file_basename = splitext(split(self.sff_fp)[1])[0] otu_fp = join(self.wf_out,'picked_otus','seqs_otus.txt') split_lib_seqs_fp = join(self.wf_out,'split_libraries',\ 'seqs.fna') # check that the two final output files have non-zero size self.assertTrue(getsize(split_lib_seqs_fp) > 0) self.assertTrue(getsize(otu_fp) > 0) # Check that the log file is created and has size > 0 log_fp = glob(join(self.wf_out,'log*.txt'))[0] self.assertTrue(getsize(log_fp) > 0)
def main(): option_parser, opts, args =\ parse_command_line_parameters(**script_info) study_id = opts.study_id for i in range(1,25): output_dir='/home/wwwdevuser/user_data/studies/study_%s/processed_data_%s/' % (study_id,i) if not exists(output_dir): break else: continue print output_dir sff_fname=opts.sff_fname map_fname = opts.map_fname verbose = opts.verbose print_only = opts.print_only parallel = opts.parallel denoise=opts.denoise if parallel: raise_error_on_parallel_unavailable() try: parameter_f = open(opts.parameter_fp) except IOError: raise IOError,\ "Can't open parameters file (%s). Does it exist? Do you have read access?"\ % opts.parameter_fp try: makedirs(output_dir) except OSError: if opts.force: pass else: # Since the analysis can take quite a while, I put this check # in to help users avoid overwriting previous output. print "Output directory already exists. Please choose "+\ "a different directory, or force overwrite with -f." exit(1) if print_only: command_handler = print_commands else: command_handler = web_app_call_commands_serially if verbose: status_update_callback = print_to_stdout else: status_update_callback = no_status_updates run_process_sff_through_pick_otus(sff_input_fp=sff_fname,\ mapping_fp=map_fname,\ output_dir=output_dir,\ denoise=denoise,\ command_handler=command_handler,\ params=parse_qiime_parameters(parameter_f),\ qiime_config=qiime_config,\ parallel=parallel,\ status_update_callback=status_update_callback)