+def getParser(usage):
+ parser = optparse.OptionParser(usage=usage)
+ parser.add_option("--color", dest="color")
+ parser.add_option("--score", type="int", dest="scoreField")
+ parser.add_option("--narrowPeak", action="store_true", dest="doNarrow")
+ parser.add_option("--broadPeak", action="store_true", dest="doBroad")
+ parser.add_option("--itemRgb", action="store_true", dest="itemRGB")
+ parser.add_option("--nolabel", action="store_true", dest="noLabel")
+
+ configParser = getConfigParser()
+ section = "regiontobed"
+ color = getConfigOption(configParser, section, "color", "0,0,0")
+ scoreField = getConfigOption(configParser, section, "scoreField", None)
+ doNarrow = getConfigBoolOption(configParser, section, "doNarrow", False)
+ doBroad = getConfigBoolOption(configParser, section, "doBroad", False)
+ itemRGB = getConfigBoolOption(configParser, section, "itemRGB", False)
+ noLabel = getConfigBoolOption(configParser, section, "noLabel", False)
+
+ parser.set_defaults(color=color, scoreField=scoreField, doNarrow=doNarrow,
+ doBroad=doBroad, itemRGB=itemRGB, noLabel=noLabel)
+
+ return parser
+
+