Mercurial > repos > dfornika > snippy
comparison snippy_core_wrapper.py @ 9:caed59c13f82 draft
planemo upload for repository https://github.com/tseemann/snippy commit 73ec6ea773b1b88f7c32a2e8bc57b644b82f7ff9-dirty
| author | dfornika |
|---|---|
| date | Mon, 21 Jan 2019 18:35:52 -0500 |
| parents | c441153cb4c2 |
| children | 9d46ea31b273 |
comparison
equal
deleted
inserted
replaced
| 8:c441153cb4c2 | 9:caed59c13f82 |
|---|---|
| 20 from shutil import copyfile | 20 from shutil import copyfile |
| 21 | 21 |
| 22 def main(): | 22 def main(): |
| 23 parser = argparse.ArgumentParser() | 23 parser = argparse.ArgumentParser() |
| 24 parser.add_argument('-r', '--ref', help='Reference fasta', required=True) | 24 parser.add_argument('-r', '--ref', help='Reference fasta', required=True) |
| 25 parser.add_argument('-i', '--indirs') | 25 parser.add_argument('-i', '--indirs' help='Comma-separated list of input datasets') |
| 26 args = parser.parse_args() | 26 args = parser.parse_args() |
| 27 | 27 |
| 28 snippy_core_command_line = ['snippy-core', '--ref', args.ref] | 28 snippy_core_command_line = ['snippy-core', '--ref', args.ref] |
| 29 | 29 |
| 30 for indir in args.indirs.split(): | 30 for indir in args.indirs.split(','): |
| 31 base_name = os.path.basename(indir) | 31 base_name = os.path.basename(indir) |
| 32 sys.stderr.write(indir + '\n') | 32 sys.stderr.write(indir + '\n') |
| 33 copyfile(indir, base_name) | 33 copyfile(indir, base_name) |
| 34 sys.stderr.write('\n'.join([indir, base_name]) + '\n') | 34 sys.stderr.write('\n'.join([indir, base_name]) + '\n') |
| 35 subprocess.run(['tar', '-xf', base_name]) | 35 subprocess.run(['tar', '-xf', base_name]) |
