Mercurial > repos > charles-bernard > data_manager_build_alfa_indexes
comparison data_manager_build_alfa_indexes/data_manager/data_manager_build_alfa_indexes.py @ 4:6f0be85be8fb draft
Uploaded
author | charles-bernard |
---|---|
date | Thu, 27 Oct 2016 06:49:58 -0400 |
parents | 016200d4e379 |
children | 54c2c66e45a9 |
comparison
equal
deleted
inserted
replaced
3:4ada30780811 | 4:6f0be85be8fb |
---|---|
154 | 154 |
155 | 155 |
156 def generate_alfa_indexes(path_to_alfa, gtf_file_name): | 156 def generate_alfa_indexes(path_to_alfa, gtf_file_name): |
157 logging.info("____________________________________________________________") | 157 logging.info("____________________________________________________________") |
158 logging.info("*** Generating alfa indexes from %s" % gtf_file_name) | 158 logging.info("*** Generating alfa indexes from %s" % gtf_file_name) |
159 alfa_result = subprocess.Popen(['python', path_to_alfa + 'ALFA.py', '-a', gtf_file_name], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 159 alfa_result = subprocess.Popen(['python', path_to_alfa, '-a', gtf_file_name], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
160 alfa_out, alfa_err = alfa_result.communicate() | 160 alfa_out, alfa_err = alfa_result.communicate() |
161 if alfa_err != None and not re.search('### End of program', alfa_err): | 161 if alfa_err != None and not re.search('### End of program', alfa_err): |
162 msg = 'Generation Failed due an alfa error: %s' % (alfa_err) | 162 msg = 'Generation Failed due an alfa error: %s' % (alfa_err) |
163 logging.critical(msg) | 163 logging.critical(msg) |
164 sys.exit(msg) | 164 sys.exit(msg) |
179 | 179 |
180 | 180 |
181 def main(): | 181 def main(): |
182 options, args = get_arg() | 182 options, args = get_arg() |
183 galaxy_root_dir = args[0] | 183 galaxy_root_dir = args[0] |
184 | 184 tool_dir = args[1] |
185 path_to_alfa = os.path.join(galaxy_root_dir, 'tools/alfa/') | 185 |
186 path_to_alfa = os.path.join(tool_dir, 'ALFA.py') | |
186 path_to_tmp_dir = os.path.join(galaxy_root_dir, 'database/tmp/') | 187 path_to_tmp_dir = os.path.join(galaxy_root_dir, 'database/tmp/') |
187 | 188 |
188 if options.output_filename == None: | 189 if options.output_filename == None: |
189 msg = 'No json output file specified' | 190 msg = 'No json output file specified' |
190 logging.critical(msg) | 191 logging.critical(msg) |