Mercurial > repos > jowong > prince_galaxy
comparison data_path.py @ 4:82569b47df8d draft
planemo upload
| author | jowong |
|---|---|
| date | Mon, 29 Oct 2018 07:52:12 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 3:dde3036465de | 4:82569b47df8d |
|---|---|
| 1 #!/usr/bin/env python | |
| 2 | |
| 3 import sys | |
| 4 import argparse as ap | |
| 5 | |
| 6 parser = ap.ArgumentParser(prog='data_path', conflict_handler='resolve', | |
| 7 description="Output the galaxy file path of datasets in a text file") | |
| 8 | |
| 9 input = parser.add_argument_group('Input', '') | |
| 10 input.add_argument('-i', '--input', nargs='+', required=True, help="Paths to data1") | |
| 11 input.add_argument('-j', '--input2', nargs='*', required=True, help="Paths to data2") | |
| 12 | |
| 13 if len(sys.argv) == 0: | |
| 14 parser.print_usage() | |
| 15 sys.exit(1) | |
| 16 | |
| 17 args = parser.parse_args() | |
| 18 output = open('paths.txt', 'w') | |
| 19 if len(args.input2) == 0: | |
| 20 for index,path in enumerate(args.input): | |
| 21 output.write("%s\n" % (path)) | |
| 22 else: | |
| 23 for index,path in enumerate(args.input): | |
| 24 output.write("%s\t%s\n" % (path, args.input2[index])) |
