+def getParser(usage):
+ parser = optparse.OptionParser(usage=usage)
+ parser.add_option("--upstream", type="int", dest="upstreamBp")
+ parser.add_option("--downstream", type="int", dest="downstreamBp")
+ parser.add_option("--regions", dest="acceptfile")
+ parser.add_option("--cache", action="store_true", dest="doCache")
+ parser.add_option("--normalize", action="store_true", dest="normalize")
+ parser.add_option("--tagCount", action="store_true", dest="doTagCount")
+ parser.add_option("--bins", type="int", dest="bins")
+
+ configParser = getConfigParser()
+ section = "geneStallingBins"
+ upstreamBp = getConfigIntOption(configParser, section, "upstreamBp", 300)
+ downstreamBp = getConfigIntOption(configParser, section, "downstreamBp", 0)
+ acceptfile = getConfigOption(configParser, section, "acceptfile", "")
+ doCache = getConfigBoolOption(configParser, section, "doCache", False)
+ normalize = getConfigBoolOption(configParser, section, "normalize", False)
+ doTagCount = getConfigBoolOption(configParser, section, "doTagCount", False)
+ bins = getConfigIntOption(configParser, section, "bins", 4)
+
+ parser.set_defaults(upstreamBp=upstreamBp, downstreamBp=downstreamBp, acceptfile=acceptfile,
+ doCache=doCache, normalize=normalize, doTagCount=doTagCount, bins=bins)
+
+ return parser
+
+