"window": '--window '+str(args.window), "duo_txt": str(duo_txt), "thread_str": '--thread '+str(args.threads), "seed_str": '--seed '+str(args.shape_seed), "outmax": '--output-max '+str(outstem)+'.phased.haps '+str(outstem)+'.phased.sample', "shapelog": str(outstem)+'.shape.resub_'+str(num_chr)+'.log', "cbopen":'{{', "cbclose":'}}', } shape_cmd = cmd_templ.format(**jobdict) # submit jobres = send_job(jobname='shape.'+str(outdot)+'.resub_'+str(num_chr), cmd=shape_cmd, logname='shape.'+str(outdot)+'.resub_'+str(num_chr)+'.sub.'+str(clust_conf['log_task_id'])+'.log', mem=int(args.mem_req)*1000, walltime=30, njobs=int(num_chr), threads=args.threads, sleep=args.sleep) print 'Pre-phasing jobs re-submitted for %d chromosomes.\n' % num_chr # put this job back in the queue print '\n...Replacing this imputation job in the queue...' os.chdir(wd) imp_log = 'imp_chunks.'+str(outdot)+'.sub.log' send_job(jobname='imp.chunks.'+str(outdot),
] print ' '.join(shape_call) + '\n' # setup naming from task index configs = read_conf(os.environ['HOME'] + '/picopili.conf') clust_confdir = os.path.dirname(str(rp_bin)) + '/cluster_templates/' clust_conf = read_conf(clust_confdir + str(configs['cluster'] + '.conf')) task_id = str(clust_conf['log_task_id']) # submit jobres = send_job(jobname='shape.' + str(outdot), cmd=' '.join(shape_call), logname='shape.' + str(outdot) + '.chr' + task_id + '.sub.log', mem=int(args.mem_req) * 1000, walltime=30, njobs=22, threads=int(args.threads), sleep=str(args.sleep)) ### # submit next imputation task ### if args.full_pipe: ###################### print '\n...Queuing best-guess script...' ###################### os.chdir(wd) next_call = str(rp_bin) + '/imp2_rel.py ' + ' '.join(sys.argv[1:])
job_dict['cfile'] = tmp_chunk_file_name # re-save new settings (primarily to track updating mem and walltime) save_job(jfile=orig_job_conf, cmd_templ=cmd_templ, job_dict=job_dict, sendjob_dict=sendjob_dict) # submit imp_cmd = cmd_templ.format(**job_dict) jobres = send_job(jobname=sendjob_dict['jobname'], cmd=imp_cmd, logname=sendjob_dict['logname'], mem=sendjob_dict['mem'], walltime=sendjob_dict['walltime'], njobs=sendjob_dict['njobs'], sleep=sendjob_dict['sleep'], forcearray=True) print 'GWAS jobs resubmitted for %d chunks.\n' % nummiss print '\n...Replacing this best-guess job in the queue...' os.chdir(wd) bg_log = 'bg.' + str(outdot) + '.resub_' + str(nummiss) + '.sub.log' # TODO: consider queue/mem for agg send_job( jobname='bg.chunks.' + str(outdot), cmd=' '.join(sys.argv[:]),
############# # TODO: here ############# print '\n...Submitting first task...' ############# rp_bin = os.path.dirname(os.path.realpath(__file__)) next_call = str(rp_bin) + '/shape_rel.py ' + ' '.join( sys.argv[1:]) + ' --full-pipe' shape_log = 'shape.' + str(outdot) + '.sub.log' # TODO: consider queue/mem send_job(jobname='shape.' + str(outdot), cmd=next_call, logname=shape_log, mem=int(args.mem_req * 1000), walltime=30, sleep=args.sleep) # finish print '\n############' print '\n' print 'SUCCESS!' print 'All jobs submitted.\n' exit(0) # eof
job_dict['cfile'] = tmp_chunk_file_name # re-save new settings (primarily to track updating mem and walltime) save_job(jfile=orig_job_conf, cmd_templ=cmd_templ, job_dict=job_dict, sendjob_dict=sendjob_dict) # submit gwas_cmd = cmd_templ.format(**job_dict) jobres = send_job(jobname=sendjob_dict['jobname'], cmd=gwas_cmd, logname=sendjob_dict['logname'], mem=sendjob_dict['mem'], walltime=sendjob_dict['walltime'], njobs=sendjob_dict['njobs'], maxpar=sendjob_dict['maxpar'], sleep=sendjob_dict['sleep'], forcearray=True) print 'GWAS jobs resubmitted for %d chunks.\n' % nummiss print '\n...Replacing this agg job in the queue...' # TODO: adjust memory setting here agg_log = 'agg.'+str(outdot)+'.resub_'+str(nummiss)+'.sub.log' send_job(jobname='agg_'+str(outdot),
clust_dict['mem'] = max(4000,args.plink_mem) clust_dict['walltime'] = 2 clust_dict['njobs'] = int(nchunk) clust_dict['maxpar'] = 200 clust_dict['sleep'] = args.sleep save_job(jfile=job_store_file, cmd_templ=gwas_templ, job_dict=jobdict, sendjob_dict=clust_dict) # submit job gwas_cmd = gwas_templ.format(**jobdict) jobres = send_job(jobname='gwas.chunks.'+str(outdot), cmd=gwas_cmd, logname=str('gwas.chunks.'+str(outdot)+'.'+str(clust_conf['log_task_id'])+'.sub.log'), mem=max(4000,args.plink_mem), walltime=2, njobs=int(nchunk), maxpar=200, sleep=args.sleep) print 'GWAS jobs submitted for %d chunks.\n' % nchunk ###################### print '\n...Preparing meta-data for aggregation...' # - create .frq file for aggregation script # TODO: any prep for info score file? ###################### if args.model == 'linear':
'strict_qc.py', '--bfile', args.bfile, '--out', args.out, clean_txt, '--mind-th', str(args.mind_th), '--maf-th', str(args.maf_th), '--hwe-th', str(args.hwe_th), '--miss-th', str(args.miss_th), '--ld-th', str(args.ld_th), '--ld-wind', str(args.ld_wind), '--plink-mem', str(args.plink_mem), mhc_txt, chr8inv_txt, ldregions_txt, indel_txt, strandambi_txt, allchr_txt ]) jobres = send_job(jobname=str('strictqc_' + args.out), arrayfile=None, cmd=str(strictqc_call), logname=str('strictqc_' + args.out + '.sub.log'), mem=int(args.plink_mem), walltime=2, sleep=0, testonly=args.test_sub) ##### # submit imus pca print '\n...Submitting IMUS PCA job...' ##### imuspca_call = ' '.join([ 'imus_pca.py', '--bfile', str(args.out + '.strictqc.pruned'), '--out', args.out, clean_txt, '--rel-th', str(args.rel_th), '--npcs', str(args.npcs), plotall_txt, '--pcadir',