comparison create_config_file.py @ 0:694cbef83948 draft

planemo upload for repository https://github.com/portiahollyoak/Tools commit 9700cff725be112c4a813f914eca946e158fbebd-dirty
author portiahollyoak
date Fri, 13 May 2016 11:47:32 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:694cbef83948
1 import argparse
2
3
4 description = ("This script will create a configuration file for samples to be run in Breakdancer."
5 "If pooled analysis desired, only one config file needed for all samples."
6 "Otherwise, individual analysis requires individual config files for each sample.")
7
8 parser = argparse.ArgumentParser()
9 parser.add_argument("--input_file", nargs="*", help="One or more alignment files")
10 parser.add_argument("--mean", nargs="+", help="Mean insert size")
11 parser.add_argument("--std_dev", nargs="+", help="The standard deviation of insert size")
12 parser.add_argument("--read_length", nargs="+", help="Average read length")
13 parser.add_argument("--sample_name", nargs="+", help="Sample name")
14 parser.add_argument("--output_config_file", help="Name of the output config file")
15 args = parser.parse_args()
16
17 template = "map:{input_file}\tmean:{mean}\tstd:{std_dev}\treadlen:{read_length}\tsample:{sample_name}\texe:samtools view\n"
18 with open(args.output_config_file, "w") as output:
19 for input_file, mean, std_dev, read_length, sample_name in zip(args.input_file, args.mean, args.std_dev, args.read_length, args.sample_name):
20 config_line = template.format(input_file=input_file, mean=mean, std_dev=std_dev, read_length=read_length, sample_name=sample_name)
21 output.write(config_line)