Mercurial > repos > jowong > prince_galaxy
comparison data_path.py @ 0:88748989a22a draft default tip
planemo upload
author | jowong |
---|---|
date | Tue, 13 Nov 2018 11:41:37 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:88748989a22a |
---|---|
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])) |