return args.input, args.target_specs, args.output_suffix; elif errorflag == 1: parser.print_help(); sys.exit(); ############################################ #Main Block ############################################ starttime = gwctcore.getLogTime(); indir, targets, suffix = optParse(0); targets = targets.split(","); indir, script_outdir = gwctcore.getOutdir(indir, "gwct", starttime, suffix); print "# " + gwctcore.getTime() + " | Creating main output directory:\t" + script_outdir; os.system("mkdir " + script_outdir); logfilename = os.path.join(script_outdir, "gwct.log"); logfile = open(logfilename, "w"); logfile.write(""); logfile.close(); uniq_header = "#\tChromosome\tGeneID\tAlignLen\tPosition\tBackgroundAlleles\tTargetAlleles\n"; l = 1; sp = 65; gwctcore.logCheck(l, logfilename, "# ======================================================================="); gwctcore.logCheck(l, logfilename, "#\tGWCT: Genome-Wide Convergence Tester -- Unique substitutions"); gwctcore.logCheck(l, logfilename, "#\t\t\t" + gwctcore.getDateTime());
############################################ #Main Block ############################################ ins, ppath, treefile, prune, seqtype, bsopt, aopt, v, l, outdir_suffix = optParse(0); starttime = gwctcore.getLogTime(); if not os.path.isdir(ppath): gwctcore.errorOut(10, "-c must be a valid directory path"); optParse(1); if os.path.isfile(ins): fileflag = 1; indir = os.path.dirname(os.path.realpath(ins)); indir, script_outdir = gwctcore.getOutdir(indir, "run_codeml", starttime, outdir_suffix); outdir = os.path.join(script_outdir, "codeml_out"); if aopt == 1: ancdir = os.path.join(script_outdir, "anc_seqs_fa"); filelist = [ins]; else: fileflag = 0; indir, script_outdir = gwctcore.getOutdir(ins, "run_codeml", starttime, outdir_suffix); outdir = os.path.join(script_outdir, "codeml_out"); filelist = os.listdir(indir); if aopt == 1: ancdir = os.path.join(script_outdir, "anc_seqs_fa"); print gwctcore.getTime() + " | Creating main output directory:\t" + script_outdir; os.system("mkdir " + script_outdir);
return args.input, args.target_specs, args.output_suffix elif errorflag == 1: parser.print_help() sys.exit() ############################################ #Main Block ############################################ starttime = gwctcore.getLogTime() indir, targets, suffix = optParse(0) targets = targets.split(",") indir, script_outdir = gwctcore.getOutdir(indir, "gwct", starttime, suffix) print "# " + gwctcore.getTime( ) + " | Creating main output directory:\t" + script_outdir os.system("mkdir " + script_outdir) logfilename = os.path.join(script_outdir, "gwct.log") logfile = open(logfilename, "w") logfile.write("") logfile.close() uniq_header = "#\tChromosome\tGeneID\tAlignLen\tPosition\tBackgroundAlleles\tTargetAlleles\n" l = 1 sp = 65 gwctcore.logCheck( l, logfilename,