diff --git a/scripts/NanoCaller.py b/scripts/NanoCaller.py index 583b29d..38640ca 100644 --- a/scripts/NanoCaller.py +++ b/scripts/NanoCaller.py @@ -10,10 +10,7 @@ def run(args): import snpCaller, indelCaller - if args.cpu==1: - pool=None - else: - pool = mp.Pool(processes=args.cpu) + pool = mp.Pool(processes=args.cpu) if not args.output: args.output=os.getcwd() @@ -136,9 +133,8 @@ def run(args): final_path=os.path.join(args.output,'%s.final.vcf.gz' %args.prefix) run_cmd('bcftools concat %s.phased.vcf.gz %s.vcf.gz -a -d all |bgziptabix %s' %(snp_vcf, indel_vcf, final_path)) - if pool: - pool.close() - pool.join() + pool.close() + pool.join() if __name__ == '__main__': diff --git a/scripts/indelCaller.py b/scripts/indelCaller.py index b30eefa..c45b567 100644 --- a/scripts/indelCaller.py +++ b/scripts/indelCaller.py @@ -95,11 +95,7 @@ def test_model(params,pool): d['end']=min(end,mbase+50000) in_dict_list.append(d) - if params['cpu']==1: - result=map(get_indel_testing_candidates, in_dict_list) - - else: - result=pool.imap_unordered(get_indel_testing_candidates, in_dict_list) + result=pool.imap_unordered(get_indel_testing_candidates, in_dict_list) total_regions=len(in_dict_list) completed=0 diff --git a/scripts/snpCaller.py b/scripts/snpCaller.py index 41cb9cb..5211456 100644 --- a/scripts/snpCaller.py +++ b/scripts/snpCaller.py @@ -117,11 +117,7 @@ def test_model(params,pool): d['end']=min(end,mbase+200000) in_dict_list.append(d) - if params['cpu']==1: - result=map(get_snp_testing_candidates, in_dict_list) - - else: - result=pool.imap_unordered(get_snp_testing_candidates, in_dict_list) + result=pool.imap_unordered(get_snp_testing_candidates, in_dict_list) total_regions=len(in_dict_list) completed=0