comparison create_config_file.py @ 0:decc6b5631dc draft

"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/pindel commit 9bae2cc35b71dabcb73cd586eb1bdc458132548c"
author artbio
date Wed, 29 Sep 2021 21:30:31 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:decc6b5631dc
1 import argparse
2
3
4 description = ("This script will create a configuration file for samples \
5 to be run in Pindel")
6
7
8 parser = argparse.ArgumentParser()
9 parser.add_argument("--input_file", nargs="*",
10 help="One or more alignment files")
11 parser.add_argument("--insert_size", nargs="+",
12 help="Expected Insert size")
13 parser.add_argument("--sample_label", nargs="+",
14 help="Sample label")
15 parser.add_argument("--output_config_file",
16 help="Output config file")
17 args = parser.parse_args()
18
19 template = "{input_file}\t{insert_size}\t{sample_label}\n"
20 with open(args.output_config_file, "w") as output:
21 for input_file, insert_size, sample_label in zip(args.input_file,
22 args.insert_size,
23 args.sample_label):
24 config_line = template.format(input_file=input_file,
25 insert_size=insert_size,
26 sample_label=sample_label)
27 output.write(config_line)