From: Brandon King Date: Wed, 16 Jan 2008 00:44:17 +0000 (+0000) Subject: Fix for tickets #45 & #47 X-Git-Tag: 0.1.0~7 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=100da45fd60d32a9ecb2153a6941da14650f5937 Fix for tickets #45 & #47 * retrieve_config needed the genome_dir substitution implemented (ticket:45) * configure_pipeline has a name clash, now fixed (ticket:47) --- diff --git a/gaworkflow/pipeline/retrieve_config.py b/gaworkflow/pipeline/retrieve_config.py index d6bcbed..0003cff 100644 --- a/gaworkflow/pipeline/retrieve_config.py +++ b/gaworkflow/pipeline/retrieve_config.py @@ -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 diff --git a/scripts/configure_pipeline b/scripts/configure_pipeline index c70f319..495b1c0 100644 --- a/scripts/configure_pipeline +++ b/scripts/configure_pipeline @@ -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/' diff --git a/scripts/retrieve_config b/scripts/retrieve_config index c2c7409..b0ddd46 100644 --- a/scripts/retrieve_config +++ b/scripts/retrieve_config @@ -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 or --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 or \n" \ + " --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__":