print '--sleep ' + str(args.sleep) print '--mem-req ' + str(args.mem_req) print '--threads ' + str(args.threads) if args.full_pipe: print '--full-pipe' if str(args.addout) != '' and args.addout is not None: outdot = str(args.out) + '.' + str(args.addout) else: outdot = str(args.out) ############# print '\n...Checking dependencies...' ############# plinkx = find_exec('plink', key='p2loc') shapeit_ex = find_exec('shapeit', key='shloc') if args.ref_dir is not None: # verify exists assert os.path.isdir( args.ref_dir ), "Failed to find imputation reference directory %s" % args.ref_dir # prepend to references accordingly args.ref_maps = str(args.ref_dir) + '/' + args.ref_maps args.ref_haps = str(args.ref_dir) + '/' + args.ref_haps args.ref_legs = str(args.ref_dir) + '/' + args.ref_legs args.ref_samps = str(args.ref_dir) + '/' + args.ref_samps args.ref_info = str(args.ref_dir) + '/' + args.ref_info
print '\nAnalysis Subset:' if args.keep is not None: print '--keep ' + str(args.keep) else: print '--remove ' + str(args.remove) if args.extract is not None: print '--extract ' + str(args.extract) else: print '--exclude ' + str(args.exclude) ############# print '\n...Checking dependencies...' # check exists, executable ############# plinkx = find_exec('plink', key='p2loc') # verify bfiles are files, not paths assert '/' not in args.bfile, "--bfile must specify only a file stem, not a path" # verify input files exist if args.covar is not None: assert os.path.isfile( args.covar), "Covariate file does not exist (%r)" % args.covar if args.keep is not None: assert os.path.isfile( args.keep), "ID inclusion file does not exist (%r)" % args.keep if args.remove is not None: assert os.path.isfile( args.remove), "ID exclusion file does not exist (%r)" % args.remove if args.extract is not None:
print '--full-pipe' ############# print '\n...Checking dependencies...' ############# # get cluster configuration # needed for specifying logfile names with clust_conf['log_task_id'] conf_file = os.environ['HOME']+"/picopili.conf" configs = read_conf(conf_file) cluster = configs['cluster'] clust_conf = read_clust_conf() # from config impute_ex = find_exec('impute2',key='i2loc') shapeit_ex = find_exec('shapeit',key='shloc') # get directory containing current script # (to get absolute path for scripts) rp_bin = os.path.dirname(os.path.realpath(__file__)) chunker_ex = rp_bin+'/chunk_snps.py' test_exec(chunker_ex,'picopili chunking script') if args.ref_dir is not None: # verify exists assert os.path.isdir(args.ref_dir), "Failed to find imputation reference directory %s" % args.ref_dir # prepend to references accordingly args.ref_maps = str(args.ref_dir) +'/' + args.ref_maps args.ref_haps = str(args.ref_dir) +'/' + args.ref_haps
other_pch = "4" # print settings print 'Using settings:' print '--bfile ' + args.bfile print '--out ' + args.out print '--rel-th ' + str(args.rel_th) print '--npcs ' + str(args.npcs) ############# print '\n...Checking dependencies...' # check exists, executable ############# # from config plinkx = find_exec('plink', key='p2loc') smartpcax = find_exec('smartpca', key='eloc') # if unspecified if args.rscript_ex == None or args.rscript_ex == "None": args.rscript_ex = find_exec("Rscript", key='rscloc') if args.primus_ex == None or args.primus_ex == "None": args.primus_ex = find_exec("run_PRIMUS.pl", key='priloc') # get directory containing current script # (to get absolute path for scripts) rp_bin = os.path.dirname(os.path.realpath(__file__)) Rplotpcax = str(rp_bin) + '/plot_pca.Rscript' # test executables
print '--exclude' # print '--info-th' # print '--rserve-active' print '\n' if int(args.snp_chunk) % 100 == 0: warn("Setting --snp-chunk to a multiple of 100 is NOT recommended currently, due to potential plink --R errors.") ############# print '\n...Checking dependencies...' ############# plinkx = find_exec('plink',key='p2loc') if args.model == 'gmmat' or args.model == 'gmmat-fam': if args.rscript_ex == None or args.rscript_ex == "None": args.rscript_ex = find_exec('Rscript', key='rscloc') if args.model == 'gee' or args.model == 'dfam': if args.rplink_ex is None or args.rplink_ex == "None": args.rplink_ex = find_exec('plink',key='rplloc') if args.model == 'gee': if args.rserve_ex is None or args.rserve_ex == "None": args.rserve_ex = find_exec('Rserve',key='rservloc') # get cluster configuration
print '\nSoftware Settings:' #if args.rserve_active: # print '--rserve-active '+str(args.rserve_active) #else: print '--r-ex ' + str(args.r_ex) print '--rplink-ex ' + str(args.rplink_ex) print '--rserve-ex ' + str(args.rserve_ex) print '--port ' + str(args.port) ############# print '\n...Checking dependencies...' # check exists, executable ############# if args.rplink_ex is None or args.rplink_ex == "None": args.rplink_ex = find_exec('plink', key='rplloc') # get R if not provided if args.r_ex == None or args.r_ex == "None": args.r_ex = find_from_path('R', 'R') # if still fail, try config if args.r_ex is None or args.r_ex == "None": args.r_ex = find_exec('R', key='rloc') if args.rserve_ex is None or args.rserve_ex == "None": args.rserve_ex = find_exec('Rserve', key='rservloc') # verify executables test_exec(args.rplink_ex, 'Plink') test_exec(args.r_ex, 'R')
if args.extract is not None: print '--extract ' + str(args.extract) else: print '--exclude ' + str(args.exclude) print '\nSoftware Settings:' print '--rplink-ex ' + str(args.rplink_ex) ############# print '\n...Checking dependencies...' # check exists, executable ############# # R-compatible plink if args.rplink_ex is None or args.rplink_ex == "None": args.rplink_ex = find_exec('plink', key='rplloc') test_exec(args.rplink_ex, 'Plink') # verify bfiles are files, not paths assert '/' not in args.bfile, "--bfile must specify only a file stem, not a path" # verify input files exist if args.keep is not None: assert os.path.isfile( args.keep), "ID inclusion file does not exist (%r)" % args.keep if args.remove is not None: assert os.path.isfile( args.remove), "ID exclusion file does not exist (%r)" % args.remove if args.extract is not None: assert os.path.isfile(
if args.use_exemplars: print '--min-exemplar ' + str(args.min_exemplar) if args.admix_q is not None and args.admix_q != "": print '--admix-q ' + args.admix_q print '--prop-th ' + str(args.prop_th) print '--min-exemplar ' + str(args.min_exemplar) print '--min-rel ' + str(args.min_rel) if args.plot_admix_pca is not None and args.plot_admix_pca != "": print '--plot-admix-pca ' + str(args.plot_admix_pca) ############# print '\n...Checking dependencies...' # find, check exists, executable ############# plinkx = find_exec('plink', key='p2loc') if args.admixture_ex is None or args.admixture_ex == "None": args.admixture_ex = find_exec('admixture', key='admloc') else: test_exec(args.admixture_ex, 'ADMIXTURE') if args.rscript_ex is None or args.rscript_ex == "None": args.rscript_ex = find_exec('Rscript', key='rscloc') else: test_exec(args.rscript_ex, 'Rscript') if args.reap_ex is None or args.reap_ex == "None": args.reap_ex = find_exec('REAP', key='reaploc') else: test_exec(args.reap_ex, 'REAP')