Skip to content

Commit

Permalink
Indent Job.Runner, add sanity checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jvivian committed Jun 28, 2016
1 parent 79e3542 commit b812b86
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/toil_scripts/batch_alignment/bwa_alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,15 @@ def main():
require(os.path.exists(args.manifest), '{} not found and no sample provided. '
'Please run "generate-manifest"'.format(args.manifest))
# Parse config

# Launch Pipeline
Job.Runner.startToil(Job.wrapJobFn(download_shared_files, inputs, options.sample, options.output_dir), options)
parsed_config = {x.replace('-', '_'): y for x, y in yaml.load(open(args.config).read()).iteritems()}
config = argparse.Namespace(**parsed_config)
config.maxCores = int(args.maxCores) if args.maxCores else sys.maxint
samples = [args.sample] if args.sample else parse_manifest(args.manifest)
# Sanity checks
require(config.ref, 'Missing URL for reference file: {}'.format(config.ref))
require(config.output_dir, 'No output location specified: {}'.format(config.output_dir))
# Launch Pipeline
Job.Runner.startToil(Job.wrapJobFn(download_reference_files, config, samples), args)


if __name__ == "__main__":
Expand Down

0 comments on commit b812b86

Please sign in to comment.