first pass cleanup of cistematic/genomes; change bamPreprocessing
[erange.git] / combinerds.py
index 2878423a9716a0e4f31d0a1738a0770339c8ed6c..d6960c2783908d67db405315b797aab3db5a02e9 100755 (executable)
@@ -21,7 +21,7 @@ def main(argv=None):
     if not argv:
         argv = sys.argv
 
-    usage = "usage: python %s destinationRDS inputrds1 [inputrds2 ....] [-table table_name] [--init] [--initrna] [--index] [--cache pages]" % argv[0]
+    usage = "usage: python %s destinationRDS inputrds1 [inputrds2 ....] [--table table_name] [--init] [--initrna] [--index] [--cache pages]" % argv[0]
     parser = makeParser(usage)
     (options, args) = parser.parse_args(argv[1:])
 
@@ -35,9 +35,7 @@ def main(argv=None):
     combinerds(datafile, infileList, options.tableList, options.withFlag, options.doIndex, options.cachePages, options.doInit, options.initRNA)
 
 
-def makeParser():
-    usage = __doc__
-
+def makeParser(usage):
     parser = optparse.OptionParser(usage=usage)
     parser.add_option("--table", action="append", dest="tablelist")
     parser.add_option("--init", action="store_true", dest="doInit")
@@ -100,9 +98,7 @@ def combinerds(datafile, infileList, tableList=[], withFlag="", doIndex=False, c
         for table in tableList:
             print "importing table %s from file %s" % (table, inputfile)
             dbColumns = "*"
-            if table == "uniqs":
-                dbColumns = "NULL, '%s' || readID, chrom, start, stop, sense, weight, flag, mismatch" % dbName
-            elif table == "multi":
+            if table in ["uniqs", "multi"]:
                 dbColumns = "NULL, '%s' || readID, chrom, start, stop, sense, weight, flag, mismatch" % dbName
             elif table == "splices":
                 dbColumns = "NULL, '%s' || readID, chrom, startL, stopL, startR, stopR, sense, weight, flag, mismatch" % dbName