-def geneLocusCounts(genome, hitfile, outfilename, upstream=0, downstream=0, doUniqs=True, doMulti=False, doSplices=False, useCDS=True, spanTSS=False, bplength=0, acceptfile=""):
- print 'returning only up to %d bp from gene locus' % bplength
- print 'upstream = %d downstream = %d useCDS = %s spanTSS = %s' % (upstream, downstream, useCDS, spanTSS)
+def getParser(usage):
+ parser = optparse.OptionParser(usage=usage)
+ parser.add_option("--noUniqs", action="store_false", dest="doUniqs",
+ help="do not count unique reads")
+ parser.add_option("--multi", action="store_true", dest="doUniqs",
+ help="count multi reads")
+ parser.add_option("--splices", action="store_true", dest="doUniqs",
+ help="count splice reads")
+ parser.add_option("--spanTSS", action="store_true", dest="spanTSS")
+ parser.add_option("--regions", dest="acceptfile")
+ parser.add_option("--noCDS", action="store_false", dest="useCDS")
+ parser.add_option("--locusLength", type="int", dest="bplength",
+ help="number of bases to report")
+
+ configParser = getConfigParser()
+ section = "geneLocusCounts"
+ doUniqs = getConfigBoolOption(configParser, section, "doUniqs", True)
+ doMulti = getConfigBoolOption(configParser, section, "doMulti", False)
+ doSplices = getConfigBoolOption(configParser, section, "doSplices", False)
+ useCDS = getConfigBoolOption(configParser, section, "useCDS", True)
+ spanTSS = getConfigBoolOption(configParser, section, "spanTSS", False)
+ bplength = getConfigIntOption(configParser, section, "bplength", 0)
+ acceptfile = getConfigOption(configParser, section, "acceptfile", "")
+
+ parser.set_defaults(doUniqs=doUniqs, doMulti=doMulti, doSplices=doSplices,
+ useCDS=useCDS, spanTSS=spanTSS, bplength=bplength,
+ acceptfile=acceptfile)
+
+ return parser
+
+
+def geneLocusCounts(genome, hitfile, outfilename, upstream=0, downstream=0,
+ doUniqs=True, doMulti=False, doSplices=False, useCDS=True,
+ spanTSS=False, bplength=0, acceptfile=""):
+
+ print "returning only up to %d bp from gene locus" % bplength
+ print "upstream = %d downstream = %d useCDS = %s spanTSS = %s" % (upstream, downstream, useCDS, spanTSS)