+def getParser(usage):
+ parser = optparse.OptionParser(usage=usage)
+ parser.add_option("--dataset", dest="chipfilename")
+ parser.add_option("--cache", action="store_true", dest="doCache")
+ parser.add_option("--best", action="store_true", dest="bestOnly",
+ help="only report the best position for each region")
+ parser.add_option("--usepeak", action="store_true", dest="usePeak",
+ help="use peak position and height from regions file")
+ parser.add_option("--printseq", action="store_true", dest="printSeq")
+ parser.add_option("--nomerge", action="store_true", dest="noMerge")
+ parser.add_option("--markov1", action="store_true", dest="doMarkov1")
+ parser.add_option("--rank", type="int", dest="useRank",
+ help="return region ranking based on peak height ranking [requires --usepeak]")
+
+ configParser = getConfigParser()
+ section = "getallsites"
+ chipfilename = getConfigOption(configParser, section, "chipfilename", "")
+ doCache = getConfigBoolOption(configParser, section, "doCache", False)
+ bestOnly = getConfigBoolOption(configParser, section, "bestOnly", False)
+ usePeak = getConfigBoolOption(configParser, section, "usePeak", False)
+ printSeq = getConfigBoolOption(configParser, section, "printSeq", False)
+ doMarkov1 = getConfigBoolOption(configParser, section, "doMarkov1", False)
+ useRank = getConfigBoolOption(configParser, section, "useRank", False)
+ noMerge = getConfigBoolOption(configParser, section, "noMerge", False)
+
+ parser.set_defaults(chipfilename=chipfilename, doCache=doCache, bestOnly=bestOnly, usePeak=usePeak,
+ printSeq=printSeq, doMarkov1=doMarkov1, useRank=useRank, noMerge=noMerge)
+
+ return parser
+
+