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")
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
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
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/'
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
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__":