+def getParser(usage):
+ parser = optparse.OptionParser(usage=usage)
+ parser.add_option("--nouniq", action="store_false", dest="withUniqs")
+ parser.add_option("--nomulti", action="store_false", dest="withMulti")
+ parser.add_option("--splices", action="store_true", dest="doSplices")
+ parser.add_option("--spliceColor", action="store_true", dest="doSpliceColor")
+ parser.add_option("--flag", dest="withFlag")
+ parser.add_option("--flaglike", action="store_true", dest="useFlagLike")
+ parser.add_option("--pairs", type="int", dest="pairDist")
+ parser.add_option("--cache", type="int", dest="cachePages")
+ parser.add_option("--enforceChr", action="store_true", dest="enforceChr")
+ parser.add_option("--chrom", action="append", dest="chromList")
+ parser.add_option("--strand", dest="strand")
+
+ configParser = getConfigParser()
+ section = "makebedfromrds"
+ withUniqs = getConfigBoolOption(configParser, section, "withUniqs", True)
+ withMulti = getConfigBoolOption(configParser, section, "withMulti", False)
+ doSplices = getConfigBoolOption(configParser, section, "doSplices", False)
+ doSpliceColor = getConfigBoolOption(configParser, section, "doSpliceColor", False)
+ pairDist = getConfigOption(configParser, section, "pairDist", None)
+ withFlag = getConfigOption(configParser, section, "withFlag", "")
+ useFlagLike = getConfigBoolOption(configParser, section, "useFlagLike", False)
+ enforceChr = getConfigBoolOption(configParser, section, "enforceChr", False)
+ senseStrand = getConfigOption(configParser, section, "senseStrand", "")
+ allChrom = getConfigBoolOption(configParser, section, "allChrom", True)
+ doCache = getConfigBoolOption(configParser, section, "doCache", False)
+ cachePages = getConfigOption(configParser, section, "cachePages", 100000)
+
+ parser.set_defaults(withUniqs=withUniqs, withMulti=withMulti, doSplices=doSplices, doSpliceColor=doSpliceColor,
+ pairDist=pairDist, withFlag=withFlag, useFlagLike=useFlagLike, enforceChr=enforceChr,
+ senseStrand=senseStrand, allChrom=allChrom, doCache=doCache, cachePages=cachePages,
+ chromList=[])
+
+ return parser
+
+