diff vmap_dnaindex.py @ 0:f63d639b223c draft

Initial Upload
author mzeidler
date Wed, 25 Sep 2013 11:41:16 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vmap_dnaindex.py	Wed Sep 25 11:41:16 2013 -0400
@@ -0,0 +1,30 @@
+from argparse import ArgumentParser
+import os
+from vmap import DNAIndex
+
+if __name__ == "__main__":
+    
+    
+    parser = ArgumentParser()
+    
+    a = parser.add_argument
+    a("-o","--html_file",dest="html_file")
+    a("-d","--dir",dest="directory")
+      
+    (options,args)= parser.parse_known_args()
+    
+    args.insert(0,"dummy")
+    try:
+        DNAIndex.run(argv=args)
+    except SystemExit:
+        f = open(options.html_file,'w')
+        rval = ["<html><head><title>BWA Index Galaxy Composite Dataset </title></head><body><p/>\n"]
+        rval.append('<div>This composite dataset is composed of the following files:<p/><ul>')
+        flist = os.listdir(options.directory)
+
+        for file in flist:
+            rval.append( '<li><a href="%s">%s</a></li>' % ( file, file) )
+        rval.append( '</ul></body></html>' )
+    
+        f.write("\n".join( rval ))
+        f.close()