Fix for tickets #45 & #47
authorBrandon King <kingb@caltech.edu>
Wed, 16 Jan 2008 00:44:17 +0000 (00:44 +0000)
committerBrandon King <kingb@caltech.edu>
Wed, 16 Jan 2008 00:44:17 +0000 (00:44 +0000)
 * retrieve_config needed the genome_dir substitution implemented (ticket:45)
 * configure_pipeline has a name clash, now fixed (ticket:47)

gaworkflow/pipeline/retrieve_config.py
scripts/configure_pipeline
scripts/retrieve_config

index d6bcbed802745815fac473a7545a108ab0e7e2cd..0003cff128b838165f68539ea62396228de0bfdd 100644 (file)
@@ -81,6 +81,9 @@ Config File:
   
   parser.add_option("-f", "--flowcell",
                     action="store", type="string", dest="flowcell")
+
+  parser.add_option("-g", "--genome_dir",
+                    action="store", type="string", dest="genome_dir")
   
   #parser.set_default("url", "default")
   
@@ -94,6 +97,8 @@ def constructConfigParser():
   parser.read([CONFIG_SYSTEM, CONFIG_USER])
   if not parser.has_section('config_file_server'):
     parser.add_section('config_file_server')
+  if not parser.has_section('local_setup'):
+    parser.add_section('local_setup')
   
   return parser
 
@@ -114,11 +119,16 @@ def getCombinedOptions():
   if options.url is None:
     if conf_parser.has_option('config_file_server', 'base_host_url'):
       options.url = conf_parser.get('config_file_server', 'base_host_url')
+
+  if options.genome_dir is None:
+    if conf_parser.has_option('local_setup', 'genome_dir'):
+      options.genome_dir = conf_parser.get('local_setup', 'genome_dir')
   
   print 'USING OPTIONS:'
   print ' URL:', options.url
   print ' OUT:', options.output_filepath
   print '  FC:', options.flowcell
+  print 'GDIR:', options.genome_dir
   print ''
   
   return options
index c70f319beeebb54baef9446e47758b1d57b41fe7..495b1c002ed98f507209067f35702d0adc63df08 100644 (file)
@@ -3,13 +3,13 @@ import os
 import sys
 import re
 from gaworkflow.pipeline.configure_run import *
-from gaworkflow.pipeline import retrieve_config
+from gaworkflow.pipeline import retrieve_config as _rc
 from gaworkflow.pipeline.monitors import startCmdLineStatusMonitor
 
 s_fc = re.compile('FC[0-9]+')
 
 #Turn on built-in command-line parsing.
-retrieve_config.DISABLE_CMDLINE = False
+_rc.DISABLE_CMDLINE = False
 
 GENOME_DIR = '/data-store01/compbio/genomes/'
 
index c2c740972c11b784f32cbd1f45d7500dc38b3bb2..b0ddd46de7ea721a005a47507ec5cfaf76a156e9 100644 (file)
@@ -2,6 +2,8 @@
 import sys
 from gaworkflow.pipeline.retrieve_config import *
 from gaworkflow.pipeline import retrieve_config
+from gaworkflow.pipeline.genome_mapper import getAvailableGenomes
+from gaworkflow.pipeline.genome_mapper import constructMapperDict
 
 #Turn on built-in command-line parsing.
 retrieve_config.DISABLE_CMDLINE = False
@@ -22,12 +24,28 @@ def main(args=None):
   if options.url is None:
     msg_list.append("  URL argument required (-u <url> or --url=<url>), or entry\n" \
                     "    in /etc/ga_frontend/ga_frontend.conf or ~/.ga_frontend.conf")
+  if options.genome_dir is None:
+    msg_list.append("  genome_dir argument required (-g <genome_dir> or \n" \
+                    "    --genome_dir=<genome_dir>, or entry in \n" \
+                    "    /etc/ga_frontend/ga_frontend.conf or ~/.ga_frontend.conf")
     
   if len(msg_list) > 1:
     print '\n'.join(msg_list)
     return 1
   
   saveConfigFile(options.flowcell, options.url, options.output_filepath)
+
+  f = open(options.output_filepath, 'r')
+  data = f.read()
+  f.close()
+
+  genome_dict = getAvailableGenomes(options.genome_dir)
+  mapper_dict = constructMapperDict(genome_dict)
+
+  f = open(options.output_filepath, 'w')
+  f.write(data % (mapper_dict))
+  f.close()
+  
   return 0
   
 if __name__ == "__main__":