parser.add_option("-d","--refgene-directory",metavar="DIR",dest="refgene_dir",help="Specifies the directory that contains refGene-converted.txt",default="/humgen/gsa-hpprojects/GATK/data/Annotations/refseq/hg18_b36/raw/")
parser.add_option("-p","--print",dest="output",action="store_true",default=False,help="Only print the commands to standard out, don't actually execute them yet.")
parser.add_option("-e","--execute",dest="execute",action="store_true",default=False,help="Executes the commands. This flag acts as a confirmation that you want to proceed with launching the processes.")
parser.add_option("-l","--locally",dest="run_locally",action="store_true",default=False,help="Don't submit the commands to LSF. Run them sequentially on the current machine.")
(options,args)=parser.parse_args()
deferror(msg):
print("ERROR: %s. (Rerun with -h to print help info) \n"%msg)
parser.print_help()
sys.exit(-1)
run=options.execute
output=options.output
run_locally=options.run_locally
ifnotrunandnotoutput:
error("Must run with either -p or -e")
contig_chars=["M"]+range(1,23)+["X","Y"]
contigs=[]
contigs+=["chr"+str(x)forxincontig_chars]
contigs+=["chr"+str(x)+"_random"forxinset(contig_chars).difference(set(['M',12,14,20,'X','Y']))]# There are no "_random" chromosomes for chrM,12,14,20,Y